Class CertificateViewModel

    • Constructor Detail

      • 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 Detail

      • 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.
      • 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.
      • 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").
      • 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.
      • isHasPrivateKey

        public boolean isHasPrivateKey()
        Whether the certificate has a private key in the database or not.
      • 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.
      • isCanBeRenewedAutomatically

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

        public int hashCode()
        Overrides:
        hashCode in class Object