public final class CertificateVerifier extends Object
Modifier and Type | Method and Description |
---|---|
static boolean |
isSelfSigned(X509Certificate cert)
Checks whether given X.509 certificate is self-signed.
|
static PKIXCertPathBuilderResult |
verifyCertificate(X509Certificate cert,
Set<X509Certificate> additionalCerts)
Attempts to build a certification chain for given certificate and to
verify it.
|
public static PKIXCertPathBuilderResult verifyCertificate(X509Certificate cert, Set<X509Certificate> additionalCerts) throws CertificateVerificationException
cert
- - certificate for validationadditionalCerts
- - set of trusted root CA certificates that will be used as
"trust anchors" and intermediate CA certificates that will be
used as part of the certification chain. All self-signed
certificates are considered to be trusted root CA
certificates. All the rest are considered to be intermediate
CA certificates.CertificateVerificationException
- - if the certification is not successful (e.g. certification
path cannot be built or some certificate in the chain is
expired or CRL checks are failed)public static boolean isSelfSigned(X509Certificate cert) throws CertificateException, NoSuchAlgorithmException, NoSuchProviderException
cert
- CertificateCertificateException
- - if the certification is not successful (e.g. certification
path cannot be built or some certificate in the chain is
expired or CRL checks are failed)NoSuchAlgorithmException
- Algorithm failureNoSuchProviderException
- No provider availableCopyright © 2016 SAPERION AG. All rights reserved.