Class CertificateValidity

java.lang.Object
eu.europa.esig.dss.spi.x509.CertificateValidity
All Implemented Interfaces:
Serializable

public class CertificateValidity extends Object implements Serializable
This class stores the information about the validity of the signing certificate.
See Also:
  • Constructor Details

    • CertificateValidity

      public CertificateValidity(CertificateToken certificateToken)
      This constructor create an object containing all information concerning the validity of a candidate for the signing certificate.
      Parameters:
      certificateToken - the candidate for the signing certificate
    • CertificateValidity

      public CertificateValidity(PublicKey publicKey)
      This constructor creates an object containing all information concerning the validity of a candidate for the signing certificate which is based only on the PublicKey. To be used in case of a non AdES signature.
      Parameters:
      publicKey - the PublicKey associated to the signing certificate.
    • CertificateValidity

      public CertificateValidity(SignerIdentifier signerIdentifier)
      This constructor create an object containing all information concerning the validity of a candidate for the signing certificate which is based only on the CertificateIdentifier. To be used in case of a non AdES signature.
      Parameters:
      signerIdentifier - the CertificateIdentifier associated to the signing certificate
  • Method Details

    • getPublicKey

      public PublicKey getPublicKey()
      If the certificateToken is not null then the associated PublicKey will be returned otherwise the provided publicKey is returned. NOTE: can return null
      Returns:
      the public key associated with this instance.
    • getSignerInfo

      public SignerIdentifier getSignerInfo()
      Returns the associated SignerIdentifier NOTE: can return null
      Returns:
      SignerIdentifier
    • getCertificateToken

      public CertificateToken getCertificateToken()
      Gets the CertificateToken
      Returns:
      CertificateToken
    • isSignerIdMatch

      public boolean isSignerIdMatch()
      Gets if CMS Signer Id matches
      Returns:
      TRUE if CMS Signer Id matches, FALSE otherwise
    • setSignerIdMatch

      public void setSignerIdMatch(boolean signerIdMatch)
      Sets if CMS Signer Id matches
      Parameters:
      signerIdMatch - if CMS Signer Id matches
    • isDigestPresent

      public boolean isDigestPresent()
      Gets if digest is present
      Returns:
      TRUE if digest is present, FALSE otherwise
    • setDigestPresent

      public void setDigestPresent(boolean digestPresent)
      Sets if digest is present
      Parameters:
      digestPresent - if digest is present
    • isDigestEqual

      public boolean isDigestEqual()
      Gets if digest is equal
      Returns:
      TRUE if digest is equal, FALSE otherwise
    • setDigestEqual

      public void setDigestEqual(boolean digestEqual)
      Sets if digest is equal
      Parameters:
      digestEqual - if digest is equal
    • isIssuerSerialPresent

      public boolean isIssuerSerialPresent()
      Indicates if the IssuerSerial (issuerAndSerialNumber) is present in the signature.
      Returns:
      TRUE if the IssuerSerial is present
    • setIssuerSerialPresent

      public void setIssuerSerialPresent(boolean issuerSerialPresent)
      Sets if the IssuerSerial is present
      Parameters:
      issuerSerialPresent - TRUE if the IssuerSerial is present, FALSE otherwise
    • isSerialNumberEqual

      public boolean isSerialNumberEqual()
      Indicates if the SerialNumber equals
      Returns:
      TRUE if the SerialNumber equals
    • setSerialNumberEqual

      public void setSerialNumberEqual(boolean serialNumberEqual)
      Sets if the serial number matches
      Parameters:
      serialNumberEqual - if the serial number matches
    • isDistinguishedNameEqual

      public boolean isDistinguishedNameEqual()
      Gets if the distinguished name equals
      Returns:
      TRUE if the distinguished name equals, FALSE otherwise
    • setDistinguishedNameEqual

      public void setDistinguishedNameEqual(boolean distinguishedNameEqual)
      Sets if the distinguished name equals
      Parameters:
      distinguishedNameEqual - if the distinguished name equals
    • isResponderIdPresent

      public boolean isResponderIdPresent()
      Gets if the ResponderId is present
      Returns:
      TRUE if the ResponderId is present, FALSE otherwise
    • setResponderIdPresent

      public void setResponderIdPresent(boolean responderIdPresent)
      Sets if the ResponderId is present
      Parameters:
      responderIdPresent - if the ResponderId is present
    • isResponderIdMatch

      public boolean isResponderIdMatch()
      Gets if the Responder Id matches
      Returns:
      TRUE if the Responder Id matches, FALSE otherwise
    • setResponderIdMatch

      public void setResponderIdMatch(boolean responderIdMatch)
      Sets if the ResponderId matches
      Parameters:
      responderIdMatch - if the ResponderId matches
    • isValid

      public boolean isValid()
      This method returns true if the certificate digest or IssuerSerial/issuerAndSerialNumber match or the certificate is signed.
      Returns:
      true if the certificate digest matches.