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

pack-priv Class BasicChecker

extends PKIXCertPathChecker
Class Inheritance
Imports
java.math.BigInteger, java.util.Collection, .Date, .Set, java.security.GeneralSecurityException, .KeyFactory, .PublicKey, .SignatureException, java.security.cert.Certificate, .CertificateExpiredException, .CertificateNotYetValidException, .CertPathValidatorException, .CertPathValidatorException.BasicReason, .X509Certificate, .PKIXCertPathChecker, .PKIXReason, .TrustAnchor, java.security.interfaces.DSAParams, .DSAPublicKey, java.security.spec.DSAPublicKeySpec, javax.security.auth.x500.X500Principal, sun.security.x509.X500Name, sun.security.util.Debug

BasicChecker is a PKIXCertPathChecker that checks the basic information on a PKIX certificate, namely the signature, validity, and subject/issuer name chaining.
Author
Yassir Elley
Since
1.4

Field Summary

Modifier and TypeField and Description
private final X500Principal
private final Date
private static final Debug
private PublicKey
private X500Principal
private final boolean
private final String
private final PublicKey

Constructor Summary

AccessConstructor and Description
pack-priv
BasicChecker(TrustAnchor
the anchor selected to validate the target certificate
anchor
,
Date
the time for which the validity of the certificate should be determined
date
,
String
the name of the signature provider
sigProvider
,
boolean
true if only signature checking is to be done; if false, all checks are done
sigOnly
)

Constructor that initializes the input parameters.

Method Summary

Modifier and TypeMethod and Description
public void
check(Certificate
the Certificate
cert
,
Collection<String>
a Collection of the unresolved critical extensions
unresolvedCritExts
)

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

Performs the signature, validity, and subject/issuer name chaining checks on the certificate using its internal state.

pack-priv PublicKey

Returns:

PublicKey the last public key processed
getPublicKey
()

return the public key associated with the last certificate processed

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.

public void
init(boolean forward)

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

Implements java.security.cert.CertPathChecker.init.

Initializes the internal state of the checker from parameters specified in the constructor.

public boolean
pack-priv static PublicKey

Returns:

new public key having value and parameters
makeInheritedParamsKey
(PublicKey
key from which to obtain key value
keyValueKey
,
PublicKey
key from which to obtain key parameters
keyParamsKey
)

Internal method to create a new key with inherited key parameters.

private void
updateState(X509Certificate currCert)

Internal method to manage state information at each iteration

private void
verifyNameChaining(X509Certificate cert)

Internal method to check that cert has a valid DN to be next in a chain

private void
verifySignature(X509Certificate
the X509Certificate
cert
)

Verifies the signature on the certificate using the previous public key.

private void
verifyValidity(X509Certificate cert)

Internal method to verify the validity on a certificate

Inherited from java.security.cert.PKIXCertPathChecker:
checkclone

Field Detail

caNameback to summary
private final X500Principal caName
dateback to summary
private final Date date
debugback to summary
private static final Debug debug
prevPubKeyback to summary
private PublicKey prevPubKey
prevSubjectback to summary
private X500Principal prevSubject
sigOnlyback to summary
private final boolean sigOnly
sigProviderback to summary
private final String sigProvider
trustedPubKeyback to summary
private final PublicKey trustedPubKey

Constructor Detail

BasicCheckerback to summary
pack-priv BasicChecker(TrustAnchor anchor, Date date, String sigProvider, boolean sigOnly)

Constructor that initializes the input parameters.

Parameters
anchor:TrustAnchor

the anchor selected to validate the target certificate

date:Date

the time for which the validity of the certificate should be determined

sigProvider:String

the name of the signature provider

sigOnly:boolean

true if only signature checking is to be done; if false, all checks are done

Method Detail

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

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

Performs the signature, validity, and subject/issuer name chaining checks on the certificate using its internal state. This method does not remove any critical extensions from the Collection.

Parameters
cert:Certificate

the Certificate

unresolvedCritExts:Collection<String>

a Collection of the unresolved critical extensions

Annotations
@Override
Exceptions
CertPathValidatorException:
if certificate does not verify
getPublicKeyback to summary
pack-priv PublicKey getPublicKey()

return the public key associated with the last certificate processed

Returns:PublicKey

PublicKey the last public key processed

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
public void init(boolean forward) throws CertPathValidatorException

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

Implements java.security.cert.CertPathChecker.init.

Initializes the internal state of the checker from parameters specified in the constructor.

Annotations
@Override
Exceptions
CertPathValidatorException:

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

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

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
makeInheritedParamsKeyback to summary
pack-priv static PublicKey makeInheritedParamsKey(PublicKey keyValueKey, PublicKey keyParamsKey) throws CertPathValidatorException

Internal method to create a new key with inherited key parameters.

Parameters
keyValueKey:PublicKey

key from which to obtain key value

keyParamsKey:PublicKey

key from which to obtain key parameters

Returns:PublicKey

new public key having value and parameters

Exceptions
CertPathValidatorException:
if keys are not appropriate types for this operation
updateStateback to summary
private void updateState(X509Certificate currCert) throws CertPathValidatorException

Internal method to manage state information at each iteration

verifyNameChainingback to summary
private void verifyNameChaining(X509Certificate cert) throws CertPathValidatorException

Internal method to check that cert has a valid DN to be next in a chain

verifySignatureback to summary
private void verifySignature(X509Certificate cert) throws CertPathValidatorException

Verifies the signature on the certificate using the previous public key.

Parameters
cert:X509Certificate

the X509Certificate

Exceptions
CertPathValidatorException:
if certificate does not verify
verifyValidityback to summary
private void verifyValidity(X509Certificate cert) throws CertPathValidatorException

Internal method to verify the validity on a certificate