Class CertificateEntity

java.lang.Object
de.xima.fc.certificate.ms.impl.dao.entities.AbstractAuditableEntity
de.xima.fc.certificate.ms.impl.dao.entities.CertificateEntity
All Implemented Interfaces:
IAuditableEntity, IKeyStoreEntryEntity

@Entity @ValidCertificateRenewalConfig public class CertificateEntity extends AbstractAuditableEntity implements IKeyStoreEntryEntity
An entity representing a certificate.
  • Constructor Details

    • CertificateEntity

      public CertificateEntity()
  • Method Details

    • addUsage

      public void addUsage(CertificateUsageEntity usage)
      Adds a usage to the certificate. This method ensures that the bidirectional relationship is properly maintained.
      Parameters:
      usage - the usage to add
    • getValidity

      public de.xima.cmn.time.DateTimeRange getValidity()
      The date time range of the certificate's validity.
      Returns:
      the date time range of the certificate's validity
    • onCreate

      protected void onCreate()
      Description copied from class: AbstractAuditableEntity
      Pre persist hook to set the creation date.
      Overrides:
      onCreate in class AbstractAuditableEntity
    • onUpdate

      protected void onUpdate()
      Description copied from class: AbstractAuditableEntity
      Pre update hook to set the last modification date.
      Overrides:
      onUpdate in class AbstractAuditableEntity
    • getId

      public Long getId()
    • getLockingVersion

      public int getLockingVersion()
    • getCertificateData

      public byte[] getCertificateData()
    • getFingerprint

      public String getFingerprint()
    • getValidFrom

      public Instant getValidFrom()
    • getValidUntil

      public Instant getValidUntil()
    • getIssuer

      public String getIssuer()
    • getSubject

      public String getSubject()
    • getSerialNumber

      public String getSerialNumber()
    • getCertificateType

      public ECertificateType getCertificateType()
    • getCertificateSource

      public ECertificateSource getCertificateSource()
    • getKeyAlgorithm

      public String getKeyAlgorithm()
    • getKeySize

      public int getKeySize()
    • getKeyPair

      public KeyPairEntity getKeyPair()
    • getKeyStore

      public KeyStoreEntity getKeyStore()
    • getUsages

      public Set<CertificateUsageEntity> getUsages()
    • getCsrData

      public byte[] getCsrData()
      The CSR (Certificate Signing Request) data for this certificate. This is stored as a byte array in the database.
    • getLastCsrExport

      public Instant getLastCsrExport()
      The instant when the CSR (Certificate Signing Request) was last exported. If this is null, the CSR has never been exported and therefore no CSR process has been initiated for this certificate.
    • getLastCaResponseImport

      public Instant getLastCaResponseImport()
      The instant when the last CA (Certificate Authority) response was imported for this certificate. If this is null, no CA response has been imported yet. If this is null and lastCsrExport is not null, it indicates that the CSR was exported, therefore a CSR process has been initiated, but no CA response has been received yet.
    • isAutoRenew

      public boolean isAutoRenew()
      Whether the certificate is set to be automatically renewed or not.
    • getRenewedBy

      public CertificateEntity getRenewedBy()
      The certificate that is the renewal of this certificate. If this is null, this certificate has not been renewed yet. If this is not null, this certificate has been renewed by the certificate referenced by this field.
    • setId

      public void setId(Long id)
    • setLockingVersion

      public void setLockingVersion(int lockingVersion)
    • setCertificateData

      public void setCertificateData(byte[] certificateData)
    • setFingerprint

      public void setFingerprint(String fingerprint)
    • setValidFrom

      public void setValidFrom(Instant validFrom)
    • setValidUntil

      public void setValidUntil(Instant validUntil)
    • setIssuer

      public void setIssuer(String issuer)
    • setSubject

      public void setSubject(String subject)
    • setSerialNumber

      public void setSerialNumber(String serialNumber)
    • setCertificateType

      public void setCertificateType(ECertificateType certificateType)
    • setCertificateSource

      public void setCertificateSource(ECertificateSource certificateSource)
    • setKeyAlgorithm

      public void setKeyAlgorithm(String keyAlgorithm)
    • setKeySize

      public void setKeySize(int keySize)
    • setKeyPair

      public void setKeyPair(KeyPairEntity keyPair)
    • setKeyStore

      public void setKeyStore(KeyStoreEntity keyStore)
    • setUsages

      public void setUsages(Set<CertificateUsageEntity> usages)
    • setCsrData

      public void setCsrData(byte[] csrData)
      The CSR (Certificate Signing Request) data for this certificate. This is stored as a byte array in the database.
    • setLastCsrExport

      public void setLastCsrExport(Instant lastCsrExport)
      The instant when the CSR (Certificate Signing Request) was last exported. If this is null, the CSR has never been exported and therefore no CSR process has been initiated for this certificate.
    • setLastCaResponseImport

      public void setLastCaResponseImport(Instant lastCaResponseImport)
      The instant when the last CA (Certificate Authority) response was imported for this certificate. If this is null, no CA response has been imported yet. If this is null and lastCsrExport is not null, it indicates that the CSR was exported, therefore a CSR process has been initiated, but no CA response has been received yet.
    • setAutoRenew

      public void setAutoRenew(boolean autoRenew)
      Whether the certificate is set to be automatically renewed or not.
    • setRenewedBy

      public void setRenewedBy(CertificateEntity renewedBy)
      The certificate that is the renewal of this certificate. If this is null, this certificate has not been renewed yet. If this is not null, this certificate has been renewed by the certificate referenced by this field.
    • toString

      public String toString()
      Overrides:
      toString in class Object