public final class PKIXValidator extends Validator
Note that the validate() implementation tries to use a PKIX validator if that appears possible and a PKIX builder otherwise. This increases performance and currently also leads to better exception messages in case of failures.
PKIXValidator objects are immutable once they have been created.
Please DO NOT add methods that can change the state of an instance once
it has been created.
| 限定符和类型 | 字段和说明 |
|---|---|
private static boolean |
ALLOW_NON_CA_ANCHOR
System or security property that if set (or set to "true"), allows trust
anchor certificates to be used if they do not have the proper CA
extensions.
|
private int |
certPathLength |
private static boolean |
checkTLSRevocation
Flag indicating whether to enable revocation check for the PKIX trust
manager.
|
private CertificateFactory |
factory |
private PKIXBuilderParameters |
parameterTemplate |
private boolean |
plugin |
private Set<X509Certificate> |
trustedCerts |
private Map<X500Principal,List<PublicKey>> |
trustedSubjects |
private static boolean |
TRY_VALIDATOR |
CHAIN0, endEntityChecker, TYPE_PKIX, TYPE_SIMPLE, validationDate, VAR_CODE_SIGNING, VAR_GENERIC, VAR_JCE_SIGNING, VAR_PLUGIN_CODE_SIGNING, VAR_TLS_CLIENT, VAR_TLS_SERVER, VAR_TSA_SERVER, variant| 构造器和说明 |
|---|
PKIXValidator(String variant,
Collection<X509Certificate> trustedCerts) |
PKIXValidator(String variant,
PKIXBuilderParameters params) |
| 限定符和类型 | 方法和说明 |
|---|---|
private static void |
addResponses(PKIXBuilderParameters pkixParams,
X509Certificate[] chain,
List<byte[]> responseList)
For OCSP Stapling, add responses that came in during the handshake
into a
PKIXRevocationChecker so we can evaluate them. |
private static boolean |
allowNonCaAnchor() |
private X509Certificate[] |
doBuild(X509Certificate[] chain,
Collection<X509Certificate> otherCerts,
PKIXBuilderParameters params) |
private X509Certificate[] |
doValidate(X509Certificate[] chain,
PKIXBuilderParameters params) |
(专用程序包) X509Certificate[] |
engineValidate(X509Certificate[] chain,
Collection<X509Certificate> otherCerts,
List<byte[]> responseList,
AlgorithmConstraints constraints,
Object parameter) |
int |
getCertPathLength()
Returns the length of the last certification path that is validated by
CertPathValidator.
|
PKIXBuilderParameters |
getParameters()
Return the PKIX parameters used by this instance.
|
Collection<X509Certificate> |
getTrustedCertificates()
Returns an immutable Collection of the X509Certificates this instance
uses as trust anchors.
|
private boolean |
isSignatureValid(List<PublicKey> keys,
X509Certificate sub) |
private void |
setDate(PKIXBuilderParameters params)
Set the check date (for debugging).
|
private void |
setDefaultParameters(String variant)
Set J2SE global default PKIX parameters.
|
private static X509Certificate[] |
toArray(CertPath path,
TrustAnchor anchor) |
private static void |
verifyTrustAnchor(X509Certificate trustedCert)
Verify that a trust anchor certificate is a CA certificate.
|
getInstance, getInstance, getInstance, setValidationDate, validate, validate, validate, validateprivate static final boolean checkTLSRevocation
private static final boolean TRY_VALIDATOR
private static final boolean ALLOW_NON_CA_ANCHOR
private final Set<X509Certificate> trustedCerts
private final PKIXBuilderParameters parameterTemplate
private int certPathLength
private final Map<X500Principal,List<PublicKey>> trustedSubjects
private final CertificateFactory factory
private final boolean plugin
PKIXValidator(String variant, Collection<X509Certificate> trustedCerts)
PKIXValidator(String variant, PKIXBuilderParameters params)
private static boolean allowNonCaAnchor()
public Collection<X509Certificate> getTrustedCertificates()
ValidatorgetTrustedCertificates 在类中 Validatorpublic int getCertPathLength()
private void setDefaultParameters(String variant)
public PKIXBuilderParameters getParameters()
X509Certificate[] engineValidate(X509Certificate[] chain, Collection<X509Certificate> otherCerts, List<byte[]> responseList, AlgorithmConstraints constraints, Object parameter) throws CertificateException
engineValidate 在类中 ValidatorCertificateExceptionprivate boolean isSignatureValid(List<PublicKey> keys, X509Certificate sub)
private static X509Certificate[] toArray(CertPath path, TrustAnchor anchor) throws CertificateException
private void setDate(PKIXBuilderParameters params)
private X509Certificate[] doValidate(X509Certificate[] chain, PKIXBuilderParameters params) throws CertificateException
private static void verifyTrustAnchor(X509Certificate trustedCert) throws ValidatorException
private X509Certificate[] doBuild(X509Certificate[] chain, Collection<X509Certificate> otherCerts, PKIXBuilderParameters params) throws CertificateException
private static void addResponses(PKIXBuilderParameters pkixParams, X509Certificate[] chain, List<byte[]> responseList)
PKIXRevocationChecker so we can evaluate them.pkixParams - the pkixParameters object that will be used in
path validation.chain - the chain of certificates to verifyresponseList - a List of zero or more byte arrays, each
one being a DER-encoded OCSP response (per RFC 6960). Entries
in the List must match the order of the certificates in the
chain parameter.Copyright © 2023. All rights reserved.