Class CertificateViewModel

java.lang.Object
de.xima.fc.certificate.gui.internal.administration.CertificateViewModel
All Implemented Interfaces:
IKeystoreEntryViewModel, Serializable

public final class CertificateViewModel extends Object implements IKeystoreEntryViewModel
Locale specific view model for certificates.
Since:
8.5.0
Author:
XIMA Media GmbH
See Also:
  • Constructor Details

    • CertificateViewModel

      public CertificateViewModel(int originalDtoHashCode, CertificateInfoDTO certificateInfoDto, Long id, de.xima.cmn.time.DateTimeRange validity, Instant createdAt, Instant updatedAt, X501DistinguishedName issuer, X501DistinguishedName subject, String serialNumber, String keyAlgorithm, Integer keySize, boolean hasCsr, Instant lastCsrExport, Instant lastCaResponseImport, List<KeystoreEntryUsageViewModel> usages, boolean hasPrivateKey, KeystoreViewModel keystore, List<KeyStoreEntryIssueDetailModel> issues, List<EKeystoreEntryTrait> traits, EViewStatus status, List<EViewKeystoreEntryUsageType> usageTypes, boolean canBeRenewedAutomatically)
      Creates a new CertificateViewModel instance.
      Parameters:
      originalDtoHashCode - The original hash code of the certificate view model. This is used to detect changes in the view model.
      certificateInfoDto - The underlying certificate info DTO.
      id - The (database) id of the certificate.
      validity - The date time range of the certificate's validity.
      createdAt - The date when the certificate was created.
      updatedAt - The date when the certificate was last updated.
      issuer - The issuer of the certificate in the form of a distinguished name (e.g. "CN=CA, OU=IT, O=XIMA").
      subject - The subject of the certificate in the form of a distinguished name (e.g. "CN=John Doe, OU=IT, O=XIMA").
      serialNumber - The serial number of the certificate.
      keyAlgorithm - The key algorithm of the certificate.
      keySize - The key size of the certificate.
      hasCsr - Whether the certificate has a CSR (Certificate Signing Request) or not. This is only applicable for certificates that are created by formcycle and signed by the formcycle CA.
      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.
      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.
      usages - A list of the usages of the certificate sorted by their localized display name.
      hasPrivateKey - Whether the certificate has a private key in the database or not.
      keystore - The keystore that contains the certificate.
      issues - The issues with the certificate.
      traits - Traits to filter key store entries by in the administration view.
      status - The status of the certificate, whether there are warnings or errors.
      usageTypes - The intended usages of the certificate.
      canBeRenewedAutomatically - Whether the certificate can be renewed automatically or not.
  • Method Details

    • getIssuerDisplayName

      public String getIssuerDisplayName()
      Returns the display name of the issuer of the certificate.
      Specified by:
      getIssuerDisplayName in interface IKeystoreEntryViewModel
      Returns:
      The display name of the issuer of the certificate.
    • getLastCaResponseImportLocalDate

      public LocalDate getLastCaResponseImportLocalDate()
    • getLastCaResponseImportLocalDateTime

      public LocalDateTime getLastCaResponseImportLocalDateTime()
    • getLastCsrExportLocalDate

      public LocalDate getLastCsrExportLocalDate()
    • getLastCsrExportLocalDateTime

      public LocalDateTime getLastCsrExportLocalDateTime()
    • isAutoRenew

      public boolean isAutoRenew()
      Returns whether the certificate is set to auto-renew or not.
      Returns:
      true if the certificate is set to auto-renew, false otherwise.
    • setAutoRenew

      public void setAutoRenew(boolean autoRenew)
      Sets whether the certificate is set to auto-renew or not.
      Parameters:
      autoRenew - true to set the certificate to auto-renew, false otherwise.
    • getStateDescription

      public String getStateDescription(Locale locale)
      Returns the description of the state of the certificate.
      Specified by:
      getStateDescription in interface IKeystoreEntryViewModel
      Parameters:
      locale - The locale to use for the description.
      Returns:
      The description of the state of the certificate.
    • getSubjectDisplayName

      public String getSubjectDisplayName()
      Returns the display name of the subject of the certificate.
      Specified by:
      getSubjectDisplayName in interface IKeystoreEntryViewModel
      Returns:
      The display name of the subject of the certificate.
    • getType

      public EViewKeystoreEntryType getType()
      Description copied from interface: IKeystoreEntryViewModel
      Gets the type of the keystore entry.
      Specified by:
      getType in interface IKeystoreEntryViewModel
      Returns:
      The type of the keystore entry.
    • getTypeDisplayName

      public String getTypeDisplayName(Locale locale)
      Description copied from interface: IKeystoreEntryViewModel
      Returns the localized display name of the type of the keystore entry.
      Specified by:
      getTypeDisplayName in interface IKeystoreEntryViewModel
      Parameters:
      locale - The locale to use for the display name.
      Returns:
      The localized display name of the type of the keystore entry.
    • isDeletable

      public boolean isDeletable()
      Description copied from interface: IKeystoreEntryViewModel
      Returns whether this keystore entry is deletable or not.
      Specified by:
      isDeletable in interface IKeystoreEntryViewModel
      Returns:
      Whether this keystore entry is deletable or not.
    • isDownloadable

      public boolean isDownloadable()
      Description copied from interface: IKeystoreEntryViewModel
      Returns whether this keystore entry is downloadable or not.
      Specified by:
      isDownloadable in interface IKeystoreEntryViewModel
      Returns:
      Whether this keystore entry is downloadable or not.
    • isHasChanged

      public boolean isHasChanged()
    • getOriginalDtoHashCode

      public int getOriginalDtoHashCode()
      The original hash code of the certificate view model. This is used to detect changes in the view model.
    • getCertificateInfoDto

      public CertificateInfoDTO getCertificateInfoDto()
      The underlying certificate info DTO.
    • getId

      public Long getId()
      The (database) id of the certificate.
    • getValidity

      public de.xima.cmn.time.DateTimeRange getValidity()
      The date time range of the certificate's validity.
      Specified by:
      getValidity in interface IKeystoreEntryViewModel
      Returns:
      The validity of the keystore entry.
    • getCreatedAt

      public Instant getCreatedAt()
      The date when the certificate was created.
      Specified by:
      getCreatedAt in interface IKeystoreEntryViewModel
      Returns:
      The instant when this keystore entry was created.
    • getUpdatedAt

      public Instant getUpdatedAt()
      The date when the certificate was last updated.
      Specified by:
      getUpdatedAt in interface IKeystoreEntryViewModel
      Returns:
      The instant when this keystore entry was last updated.
    • getIssuer

      public X501DistinguishedName getIssuer()
      The issuer of the certificate in the form of a distinguished name (e.g. "CN=CA, OU=IT, O=XIMA").
    • getSubject

      public X501DistinguishedName getSubject()
      The subject of the certificate in the form of a distinguished name (e.g. "CN=John Doe, OU=IT, O=XIMA").
    • getSerialNumber

      public String getSerialNumber()
      The serial number of the certificate.
      Specified by:
      getSerialNumber in interface IKeystoreEntryViewModel
      Returns:
      The serial number of the keystore entry if the keystore entry is a certificate or null otherwise.
      See Also:
    • getKeyAlgorithm

      public String getKeyAlgorithm()
      The key algorithm of the certificate.
    • getKeySize

      public Integer getKeySize()
      The key size of the certificate.
    • isHasCsr

      public boolean isHasCsr()
      Whether the certificate has a CSR (Certificate Signing Request) or not. This is only applicable for certificates that are created by formcycle and signed by the formcycle CA.
    • 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.
    • getUsages

      public List<KeystoreEntryUsageViewModel> getUsages()
      A list of the usages of the certificate sorted by their localized display name.
      Specified by:
      getUsages in interface IKeystoreEntryViewModel
    • isHasPrivateKey

      public boolean isHasPrivateKey()
      Whether the certificate has a private key in the database or not.
    • getKeystore

      public KeystoreViewModel getKeystore()
      The keystore that contains the certificate.
      Specified by:
      getKeystore in interface IKeystoreEntryViewModel
      Returns:
      The keystore that contains this keystore entry.
    • getIssues

      public List<KeyStoreEntryIssueDetailModel> getIssues()
      The issues with the certificate.
      Specified by:
      getIssues in interface IKeystoreEntryViewModel
      Returns:
      The issues with the keystore entry.
    • getTraits

      public List<EKeystoreEntryTrait> getTraits()
      Traits to filter key store entries by in the administration view.
      Specified by:
      getTraits in interface IKeystoreEntryViewModel
      Returns:
      The traits of the keystore entry.
    • getStatus

      public EViewStatus getStatus()
      The status of the certificate, whether there are warnings or errors.
      Specified by:
      getStatus in interface IKeystoreEntryViewModel
      Returns:
      The status of this keystore entry.
    • getUsageTypes

      public List<EViewKeystoreEntryUsageType> getUsageTypes()
      The intended usages of the certificate.
    • isCanBeRenewedAutomatically

      public boolean isCanBeRenewedAutomatically()
      Whether the certificate can be renewed automatically or not.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object