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 Summary
Constructors Constructor Description CertificateEntity()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddUsage(CertificateUsageEntity usage)Adds a usage to the certificate.byte[]getCertificateData()ECertificateSourcegetCertificateSource()ECertificateTypegetCertificateType()byte[]getCsrData()The CSR (Certificate Signing Request) data for this certificate.StringgetFingerprint()LonggetId()StringgetIssuer()StringgetKeyAlgorithm()KeyPairEntitygetKeyPair()intgetKeySize()KeyStoreEntitygetKeyStore()InstantgetLastCaResponseImport()The instant when the last CA (Certificate Authority) response was imported for this certificate.InstantgetLastCsrExport()The instant when the CSR (Certificate Signing Request) was last exported.intgetLockingVersion()CertificateEntitygetRenewedBy()The certificate that is the renewal of this certificate.StringgetSerialNumber()StringgetSubject()Set<CertificateUsageEntity>getUsages()InstantgetValidFrom()de.xima.cmn.time.DateTimeRangegetValidity()The date time range of the certificate's validity.InstantgetValidUntil()booleanisAutoRenew()Whether the certificate is set to be automatically renewed or not.protected voidonCreate()Pre persist hook to set the creation date.protected voidonUpdate()Pre update hook to set the last modification date.voidsetAutoRenew(boolean autoRenew)Whether the certificate is set to be automatically renewed or not.voidsetCertificateData(byte[] certificateData)voidsetCertificateSource(ECertificateSource certificateSource)voidsetCertificateType(ECertificateType certificateType)voidsetCsrData(byte[] csrData)The CSR (Certificate Signing Request) data for this certificate.voidsetFingerprint(String fingerprint)voidsetId(Long id)voidsetIssuer(String issuer)voidsetKeyAlgorithm(String keyAlgorithm)voidsetKeyPair(KeyPairEntity keyPair)voidsetKeySize(int keySize)voidsetKeyStore(KeyStoreEntity keyStore)voidsetLastCaResponseImport(Instant lastCaResponseImport)The instant when the last CA (Certificate Authority) response was imported for this certificate.voidsetLastCsrExport(Instant lastCsrExport)The instant when the CSR (Certificate Signing Request) was last exported.voidsetLockingVersion(int lockingVersion)voidsetRenewedBy(CertificateEntity renewedBy)The certificate that is the renewal of this certificate.voidsetSerialNumber(String serialNumber)voidsetSubject(String subject)voidsetUsages(Set<CertificateUsageEntity> usages)voidsetValidFrom(Instant validFrom)voidsetValidUntil(Instant validUntil)StringtoString()-
Methods inherited from class de.xima.fc.certificate.ms.impl.dao.entities.AbstractAuditableEntity
getCreatedAt, getUpdatedAt, setCreatedAt, setUpdatedAt
-
-
-
-
Method Detail
-
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:AbstractAuditableEntityPre persist hook to set the creation date.- Overrides:
onCreatein classAbstractAuditableEntity
-
onUpdate
protected void onUpdate()
Description copied from class:AbstractAuditableEntityPre update hook to set the last modification date.- Overrides:
onUpdatein classAbstractAuditableEntity
-
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 isnull, 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 isnull, no CA response has been imported yet. If this isnullandlastCsrExportis notnull, 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 isnull, this certificate has not been renewed yet. If this is notnull, 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 isnull, 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 isnull, no CA response has been imported yet. If this isnullandlastCsrExportis notnull, 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 isnull, this certificate has not been renewed yet. If this is notnull, this certificate has been renewed by the certificate referenced by this field.
-
-