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 -
Method Summary
Modifier and TypeMethodDescriptionvoidaddUsage(CertificateUsageEntity usage) Adds a usage to the certificate.byte[]byte[]The CSR (Certificate Signing Request) data for this certificate.getId()intThe instant when the last CA (Certificate Authority) response was imported for this certificate.The instant when the CSR (Certificate Signing Request) was last exported.intThe certificate that is the renewal of this certificate.de.xima.cmn.time.DateTimeRangeThe date time range of the certificate's validity.booleanWhether 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) voidvoidvoidsetKeyAlgorithm(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) toString()Methods inherited from class AbstractAuditableEntity
getCreatedAt, getUpdatedAt, setCreatedAt, setUpdatedAt
-
Constructor Details
-
CertificateEntity
public CertificateEntity()
-
-
Method Details
-
addUsage
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
-
getLockingVersion
public int getLockingVersion() -
getCertificateData
public byte[] getCertificateData() -
getFingerprint
-
getValidFrom
-
getValidUntil
-
getIssuer
-
getSubject
-
getSerialNumber
-
getCertificateType
-
getCertificateSource
-
getKeyAlgorithm
-
getKeySize
public int getKeySize() -
getKeyPair
-
getKeyStore
-
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
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
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
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
-
setLockingVersion
public void setLockingVersion(int lockingVersion) -
setCertificateData
public void setCertificateData(byte[] certificateData) -
setFingerprint
-
setValidFrom
-
setValidUntil
-
setIssuer
-
setSubject
-
setSerialNumber
-
setCertificateType
-
setCertificateSource
-
setKeyAlgorithm
-
setKeySize
public void setKeySize(int keySize) -
setKeyPair
-
setKeyStore
-
setUsages
-
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
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
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
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. -
toString
-