APIdia Launch Partner
Top Inners Fields Constructors Methods
sun.security.provider.certpath

pack-priv Class RevocationChecker

extends PKIXRevocationChecker
Class Inheritance
Imports
java.io.IOException, java.math.BigInteger, java.net.URI, .URISyntaxException, java.security.InvalidAlgorithmParameterException, .NoSuchAlgorithmException, .PublicKey, .Security, java.security.cert.CertPathValidatorException.BasicReason, .Extension, java.security.cert.*, java.util.*, javax.security.auth.x500.X500Principal, sun.security.x509.*, sun.security.util.Debug, .KnownOIDs

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static enum
private static class
private static class

Field Summary

Modifier and TypeField and Description
private static final boolean[]
private TrustAnchor
private int
private List<CertStore>
private static final boolean[]
private boolean
private boolean
private static final Debug
private static final int
private OCSPResponse.IssuerInfo
private final boolean
private static final long
private RevocationChecker.Mode
private List<Extension>
private Map<X509Certificate, byte[]>
private boolean
private PKIX.ValidatorParams
private PublicKey
private X509Certificate
private URI
private RevocationChecker.RevocationProperties
private boolean
private final LinkedList<CertPathValidatorException>

Constructor Summary

AccessConstructor and Description
pack-priv
pack-priv

Method Summary

Modifier and TypeMethod and Description
private void
buildToNewKey(X509Certificate
the X509Certificate to be checked
currCert
,
PublicKey
the PublicKey of the certificate whose key cannot be used to vouch for the CRL and should be ignored
prevKey
,
Set<X509Certificate>
a Set of X509Certificates> whose revocation status depends on the establishment of this path.
stackedCerts
)

Tries to find a CertPath that establishes a key that can be used to verify the revocation status of a given certificate.

pack-priv static boolean

Returns:

a boolean specifying if the cert is allowed to vouch for the validity of a CRL
certCanSignCrl
(X509Certificate
an X509Certificate to check
cert
)

Checks that a cert can be used to verify a CRL.

public void
check(Certificate cert, Collection<String> unresolvedCritExts)

Implements abstract java.security.cert.PKIXCertPathChecker.check.

Performs the check(s) on the specified certificate using its internal state and removes any critical extensions that it processes from the specified collection of OID strings that represent the unresolved critical extensions.

private void
check(X509Certificate xcert, Collection<String> unresolvedCritExts, PublicKey pubKey, boolean crlSignFlag)

private void
private void
checkCRLs(X509Certificate cert, Collection<String> unresolvedCritExts, Set<X509Certificate> stackedCerts, PublicKey pubKey, boolean signFlag)

private void
checkCRLs(X509Certificate cert, PublicKey prevKey, X509Certificate prevCert, boolean signFlag, boolean allowSeparateKey, Set<X509Certificate> stackedCerts, Set<TrustAnchor> anchors)

private void
checkOCSP(X509Certificate cert, Collection<String> unresolvedCritExts)

private static X509Certificate
private static X509Certificate
getResponderCert(String subject, Set<TrustAnchor> anchors, List<CertStore> stores)

private static X509Certificate
getResponderCert(String issuer, String serial, Set<TrustAnchor> anchors, List<CertStore> stores)

private static X509Certificate
private static RevocationChecker.RevocationProperties
public List<CertPathValidatorException>
getSoftFailExceptions()

Implements abstract java.security.cert.PKIXRevocationChecker.getSoftFailExceptions.

Returns a list containing the exceptions that are ignored by the revocation checker when the SOFT_FAIL option is set.

public Set<String>
getSupportedExtensions()

Implements abstract java.security.cert.PKIXCertPathChecker.getSupportedExtensions.

Returns an immutable Set of X.509 certificate extensions that this PKIXCertPathChecker supports (i.e. recognizes, is able to process), or null if no extensions are supported.

pack-priv void
public void
init(boolean forward)

Implements abstract java.security.cert.PKIXCertPathChecker.init.

Implements java.security.cert.CertPathChecker.init.

Initializes the internal state of this PKIXCertPathChecker.

pack-priv static boolean
public boolean
private boolean
private static String
private static URI
toURI(String uriString)

private void
private Collection<X509CRL>

Returns:

a collection of approved crls (or an empty collection)
verifyPossibleCRLs
(Set<X509CRL>
a set of possible CRLs to test for acceptability
crls
,
X509Certificate
the certificate whose revocation status is being checked
cert
,
PublicKey
the public key of the issuer of cert
prevKey
,
boolean
true if prevKey was trusted to sign CRLs
signFlag
,
boolean[]
the reason code mask
reasonsMask
,
Set<TrustAnchor>
a Set of TrustAnchors>
anchors
)

Internal method that verifies a set of possible_crls, and sees if each is approved, based on the cert.

private void
verifyWithSeparateSigningKey(X509Certificate
the X509Certificate to be checked
cert
,
PublicKey
the PublicKey that failed
prevKey
,
boolean
true if that key was trusted to sign CRLs
signFlag
,
Set<X509Certificate>
a Set of X509Certificates whose revocation status depends on the non-revoked status of this cert. To avoid circular dependencies, we assume they're revoked while checking the revocation status of this cert.
stackedCerts
)

We have a cert whose revocation status couldn't be verified by a CRL issued by the cert that issued the CRL.

Inherited from java.security.cert.PKIXRevocationChecker:
clonegetOcspExtensionsgetOcspRespondergetOcspResponderCertgetOcspResponsesgetOptionssetOcspExtensionssetOcspRespondersetOcspResponderCertsetOcspResponsessetOptions

Field Detail

ALL_REASONSback to summary
private static final boolean[] ALL_REASONS
anchorback to summary
private TrustAnchor anchor
certIndexback to summary
private int certIndex
certStoresback to summary
private List<CertStore> certStores
CRL_SIGN_USAGEback to summary
private static final boolean[] CRL_SIGN_USAGE
crlDPback to summary
private boolean crlDP
crlSignFlagback to summary
private boolean crlSignFlag
debugback to summary
private static final Debug debug
DEFAULT_NONCE_BYTESback to summary
private static final int DEFAULT_NONCE_BYTES
issuerInfoback to summary
private OCSPResponse.IssuerInfo issuerInfo
legacyback to summary
private final boolean legacy
MAX_CLOCK_SKEWback to summary
private static final long MAX_CLOCK_SKEW
modeback to summary
private RevocationChecker.Mode mode
ocspExtensionsback to summary
private List<Extension> ocspExtensions

Hides java.security.cert.PKIXRevocationChecker.ocspExtensions.

ocspResponsesback to summary
private Map<X509Certificate, byte[]> ocspResponses

Hides java.security.cert.PKIXRevocationChecker.ocspResponses.

onlyEEback to summary
private boolean onlyEE
paramsback to summary
private PKIX.ValidatorParams params
prevPubKeyback to summary
private PublicKey prevPubKey
responderCertback to summary
private X509Certificate responderCert
responderURIback to summary
private URI responderURI
rpback to summary
private RevocationChecker.RevocationProperties rp
softFailback to summary
private boolean softFail
softFailExceptionsback to summary
private final LinkedList<CertPathValidatorException> softFailExceptions

Constructor Detail

RevocationCheckerback to summary
pack-priv RevocationChecker()
RevocationCheckerback to summary
pack-priv RevocationChecker(TrustAnchor anchor, PKIX.ValidatorParams params) throws CertPathValidatorException

Method Detail

buildToNewKeyback to summary
private void buildToNewKey(X509Certificate currCert, PublicKey prevKey, Set<X509Certificate> stackedCerts) throws CertPathValidatorException

Tries to find a CertPath that establishes a key that can be used to verify the revocation status of a given certificate. Ignores keys that have previously been tried. Throws a CertPathValidatorException if no such key could be found.

Parameters
currCert:X509Certificate

the X509Certificate to be checked

prevKey:PublicKey

the PublicKey of the certificate whose key cannot be used to vouch for the CRL and should be ignored

stackedCerts:Set<X509Certificate>

a Set of X509Certificates> whose revocation status depends on the establishment of this path.

Exceptions
CertPathValidatorException:
on failure
certCanSignCrlback to summary
pack-priv static boolean certCanSignCrl(X509Certificate cert)

Checks that a cert can be used to verify a CRL.

Parameters
cert:X509Certificate

an X509Certificate to check

Returns:boolean

a boolean specifying if the cert is allowed to vouch for the validity of a CRL

checkback to summary
public void check(Certificate cert, Collection<String> unresolvedCritExts) throws CertPathValidatorException

Implements abstract java.security.cert.PKIXCertPathChecker.check.

Doc from java.security.cert.PKIXCertPathChecker.check.

Performs the check(s) on the specified certificate using its internal state and removes any critical extensions that it processes from the specified collection of OID strings that represent the unresolved critical extensions. The certificates are presented in the order specified by the init method.

Annotations
@Override
Exceptions
CertPathValidatorException:
if the specified certificate does not pass the check
checkback to summary
private void check(X509Certificate xcert, Collection<String> unresolvedCritExts, PublicKey pubKey, boolean crlSignFlag) throws CertPathValidatorException
checkApprovedCRLsback to summary
private void checkApprovedCRLs(X509Certificate cert, Set<X509CRL> approvedCRLs) throws CertPathValidatorException
checkCRLsback to summary
private void checkCRLs(X509Certificate cert, Collection<String> unresolvedCritExts, Set<X509Certificate> stackedCerts, PublicKey pubKey, boolean signFlag) throws CertPathValidatorException
checkCRLsback to summary
private void checkCRLs(X509Certificate cert, PublicKey prevKey, X509Certificate prevCert, boolean signFlag, boolean allowSeparateKey, Set<X509Certificate> stackedCerts, Set<TrustAnchor> anchors) throws CertPathValidatorException
checkOCSPback to summary
private void checkOCSP(X509Certificate cert, Collection<String> unresolvedCritExts) throws CertPathValidatorException
getResponderCertback to summary
private static X509Certificate getResponderCert(RevocationChecker.RevocationProperties rp, Set<TrustAnchor> anchors, List<CertStore> stores) throws CertPathValidatorException
getResponderCertback to summary
private static X509Certificate getResponderCert(String subject, Set<TrustAnchor> anchors, List<CertStore> stores) throws CertPathValidatorException
getResponderCertback to summary
private static X509Certificate getResponderCert(String issuer, String serial, Set<TrustAnchor> anchors, List<CertStore> stores) throws CertPathValidatorException
getResponderCertback to summary
private static X509Certificate getResponderCert(X509CertSelector sel, Set<TrustAnchor> anchors, List<CertStore> stores) throws CertPathValidatorException
getRevocationPropertiesback to summary
private static RevocationChecker.RevocationProperties getRevocationProperties()
getSoftFailExceptionsback to summary
public List<CertPathValidatorException> getSoftFailExceptions()

Implements abstract java.security.cert.PKIXRevocationChecker.getSoftFailExceptions.

Doc from java.security.cert.PKIXRevocationChecker.getSoftFailExceptions.

Returns a list containing the exceptions that are ignored by the revocation checker when the SOFT_FAIL option is set. The list is cleared each time init is called. The list is ordered in ascending order according to the certificate index returned by getIndex method of each entry.

An implementation of PKIXRevocationChecker is responsible for adding the ignored exceptions to the list.

Annotations
@Override
getSupportedExtensionsback to summary
public Set<String> getSupportedExtensions()

Implements abstract java.security.cert.PKIXCertPathChecker.getSupportedExtensions.

Doc from java.security.cert.PKIXCertPathChecker.getSupportedExtensions.

Returns an immutable Set of X.509 certificate extensions that this PKIXCertPathChecker supports (i.e. recognizes, is able to process), or null if no extensions are supported.

Each element of the set is a String representing the Object Identifier (OID) of the X.509 extension that is supported. The OID is represented by a set of nonnegative integers separated by periods.

All X.509 certificate extensions that a PKIXCertPathChecker might possibly be able to process should be included in the set.

Annotations
@Override
initback to summary
pack-priv void init(TrustAnchor anchor, PKIX.ValidatorParams params) throws CertPathValidatorException
initback to summary
public void init(boolean forward) throws CertPathValidatorException

Implements abstract java.security.cert.PKIXCertPathChecker.init.

Implements java.security.cert.CertPathChecker.init.

Doc from java.security.cert.PKIXCertPathChecker.init.

Initializes the internal state of this PKIXCertPathChecker.

The forward flag specifies the order that certificates will be passed to the check method (forward or reverse). A PKIXCertPathChecker must support reverse checking and may support forward checking.

Annotations
@Override
Exceptions
CertPathValidatorException:
if this PKIXCertPathChecker is unable to check certificates in the specified order; it should never be thrown if the forward flag is false since reverse checking must be supported
isCausedByNetworkIssueback to summary
pack-priv static boolean isCausedByNetworkIssue(String type, CertStoreException cse)
isForwardCheckingSupportedback to summary
public boolean isForwardCheckingSupported()

Implements abstract java.security.cert.PKIXCertPathChecker.isForwardCheckingSupported.

Implements java.security.cert.CertPathChecker.isForwardCheckingSupported.

Doc from java.security.cert.PKIXCertPathChecker.isForwardCheckingSupported.

Indicates if forward checking is supported. Forward checking refers to the ability of the PKIXCertPathChecker to perform its checks when certificates are presented to the check method in the forward direction (from target to most-trusted CA).

Annotations
@Override
isSoftFailExceptionback to summary
private boolean isSoftFailException(CertPathValidatorException e)
stripOutSeparatorsback to summary
private static String stripOutSeparators(String value)
toURIback to summary
private static URI toURI(String uriString) throws CertPathValidatorException
updateStateback to summary
private void updateState(X509Certificate cert) throws CertPathValidatorException
verifyPossibleCRLsback to summary
private Collection<X509CRL> verifyPossibleCRLs(Set<X509CRL> crls, X509Certificate cert, PublicKey prevKey, boolean signFlag, boolean[] reasonsMask, Set<TrustAnchor> anchors)

Internal method that verifies a set of possible_crls, and sees if each is approved, based on the cert.

Parameters
crls:Set<X509CRL>

a set of possible CRLs to test for acceptability

cert:X509Certificate

the certificate whose revocation status is being checked

prevKey:PublicKey

the public key of the issuer of cert

signFlag:boolean

true if prevKey was trusted to sign CRLs

reasonsMask:boolean[]

the reason code mask

anchors:Set<TrustAnchor>

a Set of TrustAnchors>

Returns:Collection<X509CRL>

a collection of approved crls (or an empty collection)

verifyWithSeparateSigningKeyback to summary
private void verifyWithSeparateSigningKey(X509Certificate cert, PublicKey prevKey, boolean signFlag, Set<X509Certificate> stackedCerts) throws CertPathValidatorException

We have a cert whose revocation status couldn't be verified by a CRL issued by the cert that issued the CRL. See if we can find a valid CRL issued by a separate key that can verify the revocation status of this certificate.

Note that this does not provide support for indirect CRLs, only CRLs signed with a different key (but the same issuer name) as the certificate being checked.

Parameters
cert:X509Certificate

the X509Certificate to be checked

prevKey:PublicKey

the PublicKey that failed

signFlag:boolean

true if that key was trusted to sign CRLs

stackedCerts:Set<X509Certificate>

a Set of X509Certificates whose revocation status depends on the non-revoked status of this cert. To avoid circular dependencies, we assume they're revoked while checking the revocation status of this cert.

Exceptions
CertPathValidatorException:
if the cert's revocation status cannot be verified successfully with another key
sun.security.provider.certpath back to summary

private final Enum RevocationChecker.Mode

extends Enum<RevocationChecker.Mode>
Class Inheritance

Field Summary

Modifier and TypeField and Description
public static final RevocationChecker.Mode
public static final RevocationChecker.Mode
public static final RevocationChecker.Mode
public static final RevocationChecker.Mode

Constructor Summary

AccessConstructor and Description
private
Mode()

Method Summary

Modifier and TypeMethod and Description
public static RevocationChecker.Mode
public static RevocationChecker.Mode[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

ONLY_CRLSback to summary
public static final RevocationChecker.Mode ONLY_CRLS
ONLY_OCSPback to summary
public static final RevocationChecker.Mode ONLY_OCSP
PREFER_CRLSback to summary
public static final RevocationChecker.Mode PREFER_CRLS
PREFER_OCSPback to summary
public static final RevocationChecker.Mode PREFER_OCSP

Constructor Detail

Modeback to summary
private Mode()

Method Detail

valueOfback to summary
public static RevocationChecker.Mode valueOf(String name)
valuesback to summary
public static RevocationChecker.Mode[] values()
sun.security.provider.certpath back to summary

private Class RevocationChecker.RejectKeySelector

extends X509CertSelector
Class Inheritance

Field Summary

Modifier and TypeField and Description
private final Set<PublicKey>

Constructor Summary

AccessConstructor and Description
pack-priv
RejectKeySelector(Set<PublicKey>
a Set of PublicKeys that should be rejected (or null if no such check should be done)
badPublicKeys
)

Creates a new RejectKeySelector.

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

true if the Certificate should be selected, false otherwise
match
(Certificate
the Certificate to be checked
cert
)

Overrides java.security.cert.X509CertSelector.match.

Implements java.security.cert.CertSelector.match.

Decides whether a Certificate should be selected.

public String

Returns:

a String describing the contents of the CertSelector
toString
()

Overrides java.security.cert.X509CertSelector.toString.

Return a printable representation of the CertSelector.

Inherited from java.security.cert.X509CertSelector:
addPathToNameaddPathToNameaddSubjectAlternativeNameaddSubjectAlternativeNameclonegetAuthorityKeyIdentifiergetBasicConstraintsgetCertificategetCertificateValidgetExtendedKeyUsagegetIssuergetIssuerAsBytesgetIssuerAsStringgetKeyUsagegetMatchAllSubjectAltNamesgetNameConstraintsgetPathToNamesgetPolicygetPrivateKeyValidgetSerialNumbergetSubjectgetSubjectAlternativeNamesgetSubjectAsBytesgetSubjectAsStringgetSubjectKeyIdentifiergetSubjectPublicKeygetSubjectPublicKeyAlgIDsetAuthorityKeyIdentifiersetBasicConstraintssetCertificatesetCertificateValidsetExtendedKeyUsagesetIssuersetIssuersetIssuersetKeyUsagesetMatchAllSubjectAltNamessetNameConstraintssetPathToNamessetPolicysetPrivateKeyValidsetSerialNumbersetSubjectsetSubjectsetSubjectsetSubjectAlternativeNamessetSubjectKeyIdentifiersetSubjectPublicKeysetSubjectPublicKeysetSubjectPublicKeyAlgID

Field Detail

badKeySetback to summary
private final Set<PublicKey> badKeySet

Constructor Detail

RejectKeySelectorback to summary
pack-priv RejectKeySelector(Set<PublicKey> badPublicKeys)

Creates a new RejectKeySelector.

Parameters
badPublicKeys:Set<PublicKey>

a Set of PublicKeys that should be rejected (or null if no such check should be done)

Method Detail

matchback to summary
public boolean match(Certificate cert)

Overrides java.security.cert.X509CertSelector.match.

Implements java.security.cert.CertSelector.match.

Decides whether a Certificate should be selected.

Parameters
cert:Certificate

the Certificate to be checked

Returns:boolean

true if the Certificate should be selected, false otherwise

Annotations
@Override
toStringback to summary
public String toString()

Overrides java.security.cert.X509CertSelector.toString.

Return a printable representation of the CertSelector.

Returns:String

a String describing the contents of the CertSelector

Annotations
@Override
sun.security.provider.certpath back to summary

private Class RevocationChecker.RevocationProperties

extends Object
Class Inheritance
  • java.lang.Object
  • sun.security.provider.certpath.RevocationChecker.RevocationProperties

Field Summary

Modifier and TypeField and Description
pack-priv boolean
pack-priv boolean
pack-priv String
pack-priv boolean
pack-priv String
pack-priv String
pack-priv String
pack-priv boolean

Constructor Summary

AccessConstructor and Description
private

Method Summary

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

crlDPEnabledback to summary
pack-priv boolean crlDPEnabled
ocspEnabledback to summary
pack-priv boolean ocspEnabled
ocspIssuerback to summary
pack-priv String ocspIssuer
ocspNonceback to summary
pack-priv boolean ocspNonce
ocspSerialback to summary
pack-priv String ocspSerial
ocspSubjectback to summary
pack-priv String ocspSubject
ocspUrlback to summary
pack-priv String ocspUrl
onlyEEback to summary
pack-priv boolean onlyEE

Constructor Detail

RevocationPropertiesback to summary
private RevocationProperties()