Package com.helger.peppol.utils
Class PeppolCAChecker
java.lang.Object
com.helger.peppol.utils.PeppolCAChecker
This is a specific helper class to check the validity of Peppol certificates
for a specific CA. This class assumes the Peppol trust model. See
PeppolCertificateChecker for predefined instances of this class.- Since:
- 9.6.0
- Author:
- Philip Helger
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncheckCertificate(X509Certificate aCert) Check if the provided certificate is a valid Peppol certificate according to the configured CA.checkCertificate(X509Certificate aCert, OffsetDateTime aCheckDT) Check if the provided certificate is a valid Peppol certificate according to the configured CA.checkCertificate(X509Certificate aCert, OffsetDateTime aCheckDT, com.helger.commons.state.ETriState eCacheRevocationCheckResult, com.helger.security.revocation.ERevocationCheckMode eCheckMode) Check if the provided certificate is a valid Peppol certificate according to the configured CA.com.helger.commons.state.EChangeRemove all elements from the this revocation check result cache.com.helger.security.certificate.TrustedCACertificatescom.helger.security.revocation.RevocationCheckResultCache
-
Constructor Details
-
PeppolCAChecker
Constructor- Parameters:
aCACerts- The trusted CA certificates to be used. May neither benullnor empty.
-
-
Method Details
-
getAllTrustedAPCertificates
@Nonnull @ReturnsMutableCopy public com.helger.security.certificate.TrustedCACertificates getAllTrustedAPCertificates()- Returns:
- A copy of the trusted CA certificates object used internally. Never
null.
-
getRevocationCache
- Returns:
- The internal revocation cache that is used. Never
null.
-
clearRevocationCache
Remove all elements from the this revocation check result cache.- Returns:
EChange.CHANGEDif at least one entry was removed
-
checkCertificate
Check if the provided certificate is a valid Peppol certificate according to the configured CA.- Parameters:
aCert- The certificate to be checked. May benull.- Returns:
EPeppolCertificateCheckResultand nevernull.
-
checkCertificate
@Nonnull public EPeppolCertificateCheckResult checkCertificate(@Nullable X509Certificate aCert, @Nullable OffsetDateTime aCheckDT) Check if the provided certificate is a valid Peppol certificate according to the configured CA.- Parameters:
aCert- The certificate to be checked. May benull.aCheckDT- The check date and time to use. May benullwhich means "now".- Returns:
EPeppolCertificateCheckResultand nevernull.
-
checkCertificate
@Nonnull public EPeppolCertificateCheckResult checkCertificate(@Nullable X509Certificate aCert, @Nullable OffsetDateTime aCheckDT, @Nonnull com.helger.commons.state.ETriState eCacheRevocationCheckResult, @Nullable com.helger.security.revocation.ERevocationCheckMode eCheckMode) Check if the provided certificate is a valid Peppol certificate according to the configured CA.- Parameters:
aCert- The certificate to be checked. May benull.aCheckDT- The check date and time to use. May benullwhich means "now".eCacheRevocationCheckResult- Define whether to cache the revocation check results or not. UseETriState.UNDEFINEDto solely use the default.eCheckMode- Possibility to override the revocation checking mode for each check. May benullto use the global state fromCertificateRevocationCheckerDefaults.getRevocationCheckMode().- Returns:
EPeppolCertificateCheckResultand nevernull.
-