Package eu.europa.esig.dss.spi.x509
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:
- Serialized Form
-
Constructor Summary
Constructors Constructor Description CertificateValidity(CertificateToken certificateToken)This constructor create an object containing all information concerning the validity of a candidate for the signing certificate.CertificateValidity(CertificateIdentifier certificateIdentifier)This constructor create an object containing all information concerning the validity of a candidate for the signing certificate which is based only on theCertificateIdentifier.CertificateValidity(PublicKey publicKey)This constructor create an object containing all information concerning the validity of a candidate for the signing certificate which is based only on thePublicKey. -
Method Summary
Modifier and Type Method Description CertificateTokengetCertificateToken()PublicKeygetPublicKey()If thecertificateTokenis not null then the associatedPublicKeywill be returned otherwise the providedpublicKeyis returned.CertificateIdentifiergetSignerInfo()Returns the associatedCertificateIdentifierNOTE: can return nullbooleanisDigestEqual()booleanisDigestPresent()booleanisDistinguishedNameEqual()Gets if the distinguished name equalsbooleanisIssuerSerialPresent()Indicates if the IssuerSerial (issuerAndSerialNumber) is present in the signature.booleanisResponderIdMatch()Gets if the Responder Id matchesbooleanisResponderIdPresent()Gets if the ResponderId is presentbooleanisSerialNumberEqual()Indicates if the SerialNumber equalsbooleanisSignerIdMatch()booleanisValid()This method returnstrueif the certificate digest or IssuerSerial/issuerAndSerialNumber match or the certificate is signed.voidsetDigestEqual(boolean digestEqual)voidsetDigestPresent(boolean digestPresent)voidsetDistinguishedNameEqual(boolean distinguishedNameEqual)Sets if the distinguished name equalsvoidsetIssuerSerialPresent(boolean issuerSerialPresent)Sets if the IssuerSerial is presentvoidsetResponderIdMatch(boolean responderIdMatch)Sets if the ResponderId matchesvoidsetResponderIdPresent(boolean responderIdPresent)Sets if the ResponderId is presentvoidsetSerialNumberEqual(boolean serialNumberEqual)Sets if the serial number matchesvoidsetSignerIdMatch(boolean signerIdMatch)
-
Constructor Details
-
CertificateValidity
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
This constructor create an object containing all information concerning the validity of a candidate for the signing certificate which is based only on thePublicKey. To be used in case of a non AdES signature.- Parameters:
publicKey- thePublicKeyassociated to the signing certificate.
-
CertificateValidity
This constructor create an object containing all information concerning the validity of a candidate for the signing certificate which is based only on theCertificateIdentifier. To be used in case of a non AdES signature.- Parameters:
certificateIdentifier- theCertificateIdentifierassociated to the signing certificate
-
-
Method Details
-
getPublicKey
If thecertificateTokenis not null then the associatedPublicKeywill be returned otherwise the providedpublicKeyis returned. NOTE: can return null- Returns:
- the public key associated with this instance.
-
getSignerInfo
Returns the associatedCertificateIdentifierNOTE: can return null- Returns:
CertificateIdentifier
-
getCertificateToken
-
isSignerIdMatch
public boolean isSignerIdMatch() -
setSignerIdMatch
public void setSignerIdMatch(boolean signerIdMatch) -
isDigestPresent
public boolean isDigestPresent() -
setDigestPresent
public void setDigestPresent(boolean digestPresent) -
isDigestEqual
public boolean isDigestEqual() -
setDigestEqual
public void setDigestEqual(boolean digestEqual) -
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 returnstrueif the certificate digest or IssuerSerial/issuerAndSerialNumber match or the certificate is signed.- Returns:
trueif the certificate digest matches.
-