Package eu.europa.esig.dss.validation
Class CertificateValidity
java.lang.Object
eu.europa.esig.dss.validation.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(SignerInfo signerInfo)This constructor create an object containing all information concerning the validity of a candidate for the signing certificate which is based only on theSignerInfo.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.SignerInfogetSignerInfo()Returns the associatedSignerInfoNOTE: can return nullbooleanisAttributePresent()Indicates if the IssuerSerial (issuerAndSerialNumber) is present in the signature.booleanisDigestEqual()booleanisDigestPresent()booleanisDistinguishedNameEqual()booleanisSerialNumberEqual()booleanisSignerIdMatch()booleanisValid()This method returnstrueif the certificate digest or IssuerSerial/issuerAndSerialNumber match or the certificate is signed.voidsetAttributePresent(boolean attributePresent)voidsetDigestEqual(boolean digestEqual)voidsetDigestPresent(boolean digestPresent)voidsetDistinguishedNameEqual(boolean distinguishedNameEqual)voidsetSerialNumberEqual(boolean serialNumberEqual)voidsetSignerIdMatch(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 theSignerInfo. To be used in case of a non AdES signature.- Parameters:
signerInfo- theSignerInfoassociated 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 associatedSignerInfoNOTE: can return null- Returns:
SignerInfo
-
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) -
isAttributePresent
public boolean isAttributePresent()Indicates if the IssuerSerial (issuerAndSerialNumber) is present in the signature.- Returns:
-
setAttributePresent
public void setAttributePresent(boolean attributePresent) -
isSerialNumberEqual
public boolean isSerialNumberEqual() -
setSerialNumberEqual
public void setSerialNumberEqual(boolean serialNumberEqual) -
setDistinguishedNameEqual
public void setDistinguishedNameEqual(boolean distinguishedNameEqual) -
isDistinguishedNameEqual
public boolean isDistinguishedNameEqual() -
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.
-