Class TrustAnchorVerifier
java.lang.Object
eu.europa.esig.dss.spi.validation.TrustAnchorVerifier
This class is used to verify whether a given certificate token is trusted at the control time
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic TrustAnchorVerifier
Creates a default instance of TrustAnchorVerifier, with pre-configured constraints.static TrustAnchorVerifier
Creates an empty instance of TrustAnchorVerifier.Gets trusted certificate source, when presentboolean
Gets whether untrusted certificate chains of revocation data should be acceptedboolean
Gets whether untrusted certificate chains of timestamps should be acceptedboolean
isTrustedAtTime
(CertificateToken certificateToken, Date controlTime) This method verifies whether thecertificateToken
is trusted atcontrolTime
boolean
isTrustedAtTime
(CertificateToken certificateToken, Date controlTime, Context context) This method verifies whether thecertificateToken
is trusted atcontrolTime
boolean
isTrustedCertificateChain
(List<CertificateToken> certChain, Date controlTime) Verifies whether the certificate chain contains a trust anchorboolean
isTrustedCertificateChain
(List<CertificateToken> certChain, Date controlTime, Context context) Verifies whether the certificate chain contains a trust anchorboolean
Defines whether sunset date shall be considered during trust anchor validationvoid
setAcceptRevocationUntrustedCertificateChains
(boolean acceptRevocationUntrustedCertificateChains) Sets whether untrusted certificate chains of revocation data should be accepted Default: TRUE (only revocation data created with trusted CAs are considered as valid, untrusted revocation data is ignored)void
setAcceptTimestampUntrustedCertificateChains
(boolean acceptTimestampUntrustedCertificateChains) Sets whether untrusted certificate chains of timestamps should be accepted Default: TRUE (only timestamps created with trusted CAs are considered as valid, untrusted timestamps are ignored)void
setTrustedCertificateSource
(CertificateSource trustedCertificateSource) Sets a trusted certificate source in order to provide information about the available trust anchors.void
setUseSunsetDate
(boolean useSunsetDate) Sets whether a trust anchor's sunset date shall be taken into account when checking a trust anchor Default : TRUE (sunset date is used for a trust anchor determination, when applicable)
-
Constructor Details
-
TrustAnchorVerifier
protected TrustAnchorVerifier()Default constructor
-
-
Method Details
-
createEmptyTrustAnchorVerifier
Creates an empty instance of TrustAnchorVerifier. All constraints should be configured manually.- Returns:
TrustAnchorVerifier
-
createDefaultTrustAnchorVerifier
Creates a default instance of TrustAnchorVerifier, with pre-configured constraints.- Returns:
TrustAnchorVerifier
-
isAcceptTimestampUntrustedCertificateChains
public boolean isAcceptTimestampUntrustedCertificateChains()Gets whether untrusted certificate chains of timestamps should be accepted- Returns:
- whether only trusted timestamps are considered as valid
-
setAcceptTimestampUntrustedCertificateChains
public void setAcceptTimestampUntrustedCertificateChains(boolean acceptTimestampUntrustedCertificateChains) Sets whether untrusted certificate chains of timestamps should be accepted Default: TRUE (only timestamps created with trusted CAs are considered as valid, untrusted timestamps are ignored)- Parameters:
acceptTimestampUntrustedCertificateChains
- whether only trusted timestamps are considered as valid
-
isAcceptRevocationUntrustedCertificateChains
public boolean isAcceptRevocationUntrustedCertificateChains()Gets whether untrusted certificate chains of revocation data should be accepted- Returns:
- whether only trusted revocation data are considered as valid
-
setAcceptRevocationUntrustedCertificateChains
public void setAcceptRevocationUntrustedCertificateChains(boolean acceptRevocationUntrustedCertificateChains) Sets whether untrusted certificate chains of revocation data should be accepted Default: TRUE (only revocation data created with trusted CAs are considered as valid, untrusted revocation data is ignored)- Parameters:
acceptRevocationUntrustedCertificateChains
- whether only trusted timestamps are considered as valid
-
getTrustedCertificateSource
Gets trusted certificate source, when present- Returns:
CertificateSource
-
setTrustedCertificateSource
Sets a trusted certificate source in order to provide information about the available trust anchors. Note : This method is used internally during aeu.europa.esig.dss.validation.SignatureValidationContext
initialization, in order to provide the same trusted source as the one used within aeu.europa.esig.dss.validation.CertificateVerifier
.- Parameters:
trustedCertificateSource
-CertificateSource
-
isUseSunsetDate
public boolean isUseSunsetDate()Defines whether sunset date shall be considered during trust anchor validation- Returns:
- whether a trust anchor's sunset date shall be taken into account
-
setUseSunsetDate
public void setUseSunsetDate(boolean useSunsetDate) Sets whether a trust anchor's sunset date shall be taken into account when checking a trust anchor Default : TRUE (sunset date is used for a trust anchor determination, when applicable)- Parameters:
useSunsetDate
- whether a trust anchor's sunset date shall be taken into account
-
isTrustedAtTime
This method verifies whether thecertificateToken
is trusted atcontrolTime
- Parameters:
certificateToken
-CertificateToken
to checkcontrolTime
-Date
the validation time- Returns:
- TRUE if the certificate is trusted at the given time, FALSE otherwise
-
isTrustedAtTime
public boolean isTrustedAtTime(CertificateToken certificateToken, Date controlTime, Context context) This method verifies whether thecertificateToken
is trusted atcontrolTime
- Parameters:
certificateToken
-CertificateToken
to checkcontrolTime
-Date
the validation timecontext
-Context
- Returns:
- TRUE if the certificate is trusted at the given time, FALSE otherwise
-
isTrustedCertificateChain
Verifies whether the certificate chain contains a trust anchor- Parameters:
certChain
- a list ofCertificateToken
s representing a certificate chain to be verifiedcontrolTime
-Date
validation time- Returns:
- TRUE if the certificate chain is trusted, FALSE otherwise
-
isTrustedCertificateChain
public boolean isTrustedCertificateChain(List<CertificateToken> certChain, Date controlTime, Context context) Verifies whether the certificate chain contains a trust anchor- Parameters:
certChain
- a list ofCertificateToken
s representing a certificate chain to be verifiedcontrolTime
-Date
validation timecontext
-Context
- Returns:
- TRUE if the certificate chain is trusted, FALSE otherwise
-