Top Description Fields Constructors Methods
org.bouncycastle.x509

public Class PKIXCertPathReviewer

extends CertPathValidatorUtilities
Class Inheritance
Imports
java.io.ByteArrayInputStream, .IOException, java.math.BigInteger, java.net.HttpURLConnection, .InetAddress, .URL, java.security.GeneralSecurityException, .PublicKey, .SignatureException, java.security.cert.CertPath, .CertPathValidatorException, .Certificate, .CertificateExpiredException, .CertificateFactory, .CertificateNotYetValidException, .PKIXCertPathChecker, .PKIXParameters, .PolicyNode, .TrustAnchor, .X509CRL, .X509CRLEntry, .X509CertSelector, .X509Certificate, java.util.ArrayList, .Collection, .Date, .Enumeration, .HashMap, .HashSet, .Iterator, .List, .Map, .Set, .Vector, javax.security.auth.x500.X500Principal, org.bouncycastle.asn1.ASN1Encodable, .ASN1Enumerated, .ASN1IA5String, .ASN1InputStream, .ASN1Integer, .ASN1ObjectIdentifier, .ASN1OctetString, .ASN1Primitive, .ASN1Sequence, .ASN1TaggedObject, .DEROctetString, org.bouncycastle.asn1.x509.AccessDescription, .AlgorithmIdentifier, .AuthorityInformationAccess, .AuthorityKeyIdentifier, .BasicConstraints, .CRLDistPoint, .DistributionPoint, .DistributionPointName, .Extension, .GeneralName, .GeneralNames, .GeneralSubtree, .IssuingDistributionPoint, .NameConstraints, .PolicyInformation, org.bouncycastle.asn1.x509.qualified.Iso4217CurrencyCode, .MonetaryValue, .QCStatement, org.bouncycastle.i18n.ErrorBundle, .LocaleString, org.bouncycastle.i18n.filter.TrustedInput, .UntrustedInput, .UntrustedUrlInput, org.bouncycastle.jce.provider.AnnotatedException, .PKIXNameConstraintValidator, .PKIXNameConstraintValidatorException, .PKIXPolicyNode, org.bouncycastle.util.Integers, .Objects

Deprecated

use org.bouncycastle.pkix.jcajce.PKIXCertPathReviewer in the bcpkix package

PKIXCertPathReviewer
Validation of X.509 Certificate Paths. Tries to find as much errors in the Path as possible.

Field Summary

Modifier and TypeField and Description
private static final String
protected CertPath
protected List<E>
private static final String
protected Date
protected List<E>[]
private boolean
protected int
n

protected List<E>[]
protected PKIXParameters
protected PolicyNode
private static final String
private static final String
protected PublicKey
protected TrustAnchor
protected Date
Inherited from org.bouncycastle.x509.CertPathValidatorUtilities:
ANY_POLICYBASIC_CONSTRAINTSCERTIFICATE_POLICIESCRL_NUMBERCRL_SIGNcrlReasonsDELTA_CRL_INDICATORINHIBIT_ANY_POLICYISSUING_DISTRIBUTION_POINTKEY_CERT_SIGNKEY_USAGENAME_CONSTRAINTSPOLICY_CONSTRAINTSPOLICY_MAPPINGSSUBJECT_ALTERNATIVE_NAME

Constructor Summary

AccessConstructor and Description
public
PKIXCertPathReviewer(CertPath
the CertPath to validate
certPath
,
PKIXParameters
the PKIXParameters to use
params
)

Creates a PKIXCertPathReviewer and initializes it with the given CertPath and PKIXParameters params

public
PKIXCertPathReviewer()

Creates an empty PKIXCertPathReviewer.

Method Summary

Modifier and TypeMethod and Description
protected void
protected void
addError(ErrorBundle msg, int index)

protected void
protected void
addNotification(ErrorBundle msg, int index)

private void
protected void
checkCRLs(PKIXParameters paramsPKIX, X509Certificate cert, Date validDate, X509Certificate sign, PublicKey workingPublicKey, Vector<E> crlDistPointUrls, int index)

private void
private void
private void
protected void
checkRevocation(PKIXParameters paramsPKIX, X509Certificate cert, Date validDate, X509Certificate sign, PublicKey workingPublicKey, Vector<E> crlDistPointUrls, Vector<E> ocspUrls, int index)

private void
protected void
public CertPath

Returns:

the CertPath that was validated
getCertPath
()

public int

Returns:

the size of the CertPath
getCertPathSize
()

private X509CRL
getCRL(String location)

protected Vector<E>
public List<E>[]

Returns:

the Array of Lists which contain the error messages
getErrors
()

Returns an Array of Lists which contains a List of global error messages and a List of error messages for each certificate in the path.

public List<E>

Returns:

List of error messages for the certificate
getErrors
(int
the index of the certificate in the CertPath
index
)

Returns an List of error messages for the certificate at the given index in the CertPath.

public List<E>[]

Returns:

the Array of Lists which contain the notification messages
getNotifications
()

Returns an Array of Lists which contains a List of global notification messages and a List of botification messages for each certificate in the path.

public List<E>

Returns:

List of notification messages for the certificate
getNotifications
(int
the index of the certificate in the CertPath
index
)

Returns an List of notification messages for the certificate at the given index in the CertPath.

protected Vector<E>
public PolicyNode

Returns:

the valid policy tree, null if no valid policy exists.
getPolicyTree
()

public PublicKey

Returns:

the PublicKey if the last certificate in the CertPath
getSubjectPublicKey
()

public TrustAnchor

Returns:

the TrustAnchor for the CertPath, null if no valid TrustAnchor was found.
getTrustAnchor
()

protected Collection<E>
getTrustAnchors(X509Certificate cert, Set<E> trustanchors)

public void
init(CertPath
the CertPath to validate
certPath
,
PKIXParameters
the PKIXParameters to use
params
)

Initializes the PKIXCertPathReviewer with the given CertPath and PKIXParameters params

private String
IPtoString(byte[] ip)

public boolean

Returns:

if the CertPath is valid
isValidCertPath
()

private boolean
Inherited from org.bouncycastle.x509.CertPathValidatorUtilities:
findCertificatesfindCertificatesfindCertificatesgetAlgorithmIdentifiergetCertStatusgetEncodedIssuerPrincipalgetExtensionValuegetIssuerPrincipalgetNextWorkingKeygetQualifierSetgetSubjectPrincipalgetValidityDateisAnyPolicyisIndirectCRLisSelfIssuedprepareNextCertB1prepareNextCertB2processCertD1iprocessCertD1iiremovePolicyNodeverifyX509Certificate

Field Detail

AUTH_INFO_ACCESSback to summary
private static final String AUTH_INFO_ACCESS
certPathback to summary
protected CertPath certPath
certsback to summary
protected List<E> certs
CRL_DIST_POINTSback to summary
private static final String CRL_DIST_POINTS
currentDateback to summary
protected Date currentDate
errorsback to summary
protected List<E>[] errors
initializedback to summary
private boolean initialized
nback to summary
protected int n
notificationsback to summary
protected List<E>[] notifications
pkixParamsback to summary
protected PKIXParameters pkixParams
policyTreeback to summary
protected PolicyNode policyTree
QC_STATEMENTback to summary
private static final String QC_STATEMENT
RESOURCE_NAMEback to summary
private static final String RESOURCE_NAME
subjectPublicKeyback to summary
protected PublicKey subjectPublicKey
trustAnchorback to summary
protected TrustAnchor trustAnchor
validDateback to summary
protected Date validDate

Constructor Detail

PKIXCertPathReviewerback to summary
public PKIXCertPathReviewer(CertPath certPath, PKIXParameters params) throws CertPathReviewerException

Creates a PKIXCertPathReviewer and initializes it with the given CertPath and PKIXParameters params

Parameters
certPath:CertPath

the CertPath to validate

params:PKIXParameters

the PKIXParameters to use

Exceptions
CertPathReviewerException:
if the certPath is empty
PKIXCertPathReviewerback to summary
public PKIXCertPathReviewer()

Creates an empty PKIXCertPathReviewer. Don't forget to call init() to initialize the object.

Method Detail

addErrorback to summary
protected void addError(ErrorBundle msg)
addErrorback to summary
protected void addError(ErrorBundle msg, int index)
addNotificationback to summary
protected void addNotification(ErrorBundle msg)
addNotificationback to summary
protected void addNotification(ErrorBundle msg, int index)
checkCriticalExtensionsback to summary
private void checkCriticalExtensions()
checkCRLsback to summary
protected void checkCRLs(PKIXParameters paramsPKIX, X509Certificate cert, Date validDate, X509Certificate sign, PublicKey workingPublicKey, Vector<E> crlDistPointUrls, int index) throws CertPathReviewerException
checkNameConstraintsback to summary
private void checkNameConstraints()
checkPathLengthback to summary
private void checkPathLength()
checkPolicyback to summary
private void checkPolicy()
checkRevocationback to summary
protected void checkRevocation(PKIXParameters paramsPKIX, X509Certificate cert, Date validDate, X509Certificate sign, PublicKey workingPublicKey, Vector<E> crlDistPointUrls, Vector<E> ocspUrls, int index) throws CertPathReviewerException
checkSignaturesback to summary
private void checkSignatures()
doChecksback to summary
protected void doChecks()
getCertPathback to summary
public CertPath getCertPath()
Returns:CertPath

the CertPath that was validated

getCertPathSizeback to summary
public int getCertPathSize()
Returns:int

the size of the CertPath

getCRLback to summary
private X509CRL getCRL(String location) throws CertPathReviewerException
getCRLDistUrlsback to summary
protected Vector<E> getCRLDistUrls(CRLDistPoint crlDistPoints)
getErrorsback to summary
public List<E>[] getErrors()

Returns an Array of Lists which contains a List of global error messages and a List of error messages for each certificate in the path. The global error List is at index 0. The error lists for each certificate at index 1 to n. The error messages are of type.

Returns:List<E>[]

the Array of Lists which contain the error messages

Exceptions
IllegalStateException:
if the PKIXCertPathReviewer was not initialized
getErrorsback to summary
public List<E> getErrors(int index)

Returns an List of error messages for the certificate at the given index in the CertPath. If index == -1 then the list of global errors is returned with errors not specific to a certificate.

Parameters
index:int

the index of the certificate in the CertPath

Returns:List<E>

List of error messages for the certificate

Exceptions
IllegalStateException:
if the PKIXCertPathReviewer was not initialized
getNotificationsback to summary
public List<E>[] getNotifications()

Returns an Array of Lists which contains a List of global notification messages and a List of botification messages for each certificate in the path. The global notificatio List is at index 0. The notification lists for each certificate at index 1 to n. The error messages are of type.

Returns:List<E>[]

the Array of Lists which contain the notification messages

Exceptions
IllegalStateException:
if the PKIXCertPathReviewer was not initialized
getNotificationsback to summary
public List<E> getNotifications(int index)

Returns an List of notification messages for the certificate at the given index in the CertPath. If index == -1 then the list of global notifications is returned with notifications not specific to a certificate.

Parameters
index:int

the index of the certificate in the CertPath

Returns:List<E>

List of notification messages for the certificate

Exceptions
IllegalStateException:
if the PKIXCertPathReviewer was not initialized
getOCSPUrlsback to summary
protected Vector<E> getOCSPUrls(AuthorityInformationAccess authInfoAccess)
getPolicyTreeback to summary
public PolicyNode getPolicyTree()
Returns:PolicyNode

the valid policy tree, null if no valid policy exists.

Exceptions
IllegalStateException:
if the PKIXCertPathReviewer was not initialized
getSubjectPublicKeyback to summary
public PublicKey getSubjectPublicKey()
Returns:PublicKey

the PublicKey if the last certificate in the CertPath

Exceptions
IllegalStateException:
if the PKIXCertPathReviewer was not initialized
getTrustAnchorback to summary
public TrustAnchor getTrustAnchor()
Returns:TrustAnchor

the TrustAnchor for the CertPath, null if no valid TrustAnchor was found.

Exceptions
IllegalStateException:
if the PKIXCertPathReviewer was not initialized
getTrustAnchorsback to summary
protected Collection<E> getTrustAnchors(X509Certificate cert, Set<E> trustanchors) throws CertPathReviewerException
initback to summary
public void init(CertPath certPath, PKIXParameters params) throws CertPathReviewerException

Initializes the PKIXCertPathReviewer with the given CertPath and PKIXParameters params

Parameters
certPath:CertPath

the CertPath to validate

params:PKIXParameters

the PKIXParameters to use

Exceptions
CertPathReviewerException:
if the certPath is empty
IllegalStateException:
if the PKIXCertPathReviewer is already initialized
IPtoStringback to summary
private String IPtoString(byte[] ip)
isValidCertPathback to summary
public boolean isValidCertPath()
Returns:boolean

if the CertPath is valid

Exceptions
IllegalStateException:
if the PKIXCertPathReviewer was not initialized
processQcStatementsback to summary
private boolean processQcStatements(X509Certificate cert, int index)