Package org.bouncycastle.x509
Class PKIXCertPathReviewer
java.lang.Object
org.bouncycastle.x509.PKIXCertPathReviewer
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.
Validation of X.509 Certificate Paths. Tries to find as much errors in the Path as possible.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final Stringprotected static final Stringprotected static final Stringprotected CertPathDeprecated.protected ListDeprecated.protected static final Stringprotected static final intprotected static final String[]protected DateDeprecated.protected static final Stringprotected List[]Deprecated.protected static final Stringprotected static final Stringprotected static final intprotected static final Stringprotected intDeprecated.protected static final Stringprotected List[]Deprecated.protected PKIXParametersDeprecated.protected static final Stringprotected static final Stringprotected PolicyNodeDeprecated.protected static final Stringprotected PublicKeyDeprecated.protected TrustAnchorDeprecated.protected DateDeprecated. -
Constructor Summary
ConstructorsConstructorDescriptionDeprecated.Creates an empty PKIXCertPathReviewer.PKIXCertPathReviewer(CertPath certPath, PKIXParameters params) Deprecated.Creates a PKIXCertPathReviewer and initializes it with the givenCertPathandPKIXParametersparams -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddError(ErrorBundle msg) Deprecated.protected voidaddError(ErrorBundle msg, int index) Deprecated.protected voidDeprecated.protected voidaddNotification(ErrorBundle msg, int index) Deprecated.protected voidcheckCRLs(PKIXParameters paramsPKIX, X509Certificate cert, Date validDate, X509Certificate sign, PublicKey workingPublicKey, Vector crlDistPointUrls, int index) Deprecated.protected voidcheckRevocation(PKIXParameters paramsPKIX, X509Certificate cert, Date validDate, X509Certificate sign, PublicKey workingPublicKey, Vector crlDistPointUrls, Vector ocspUrls, int index) Deprecated.protected voiddoChecks()Deprecated.protected static CollectionfindCertificates(PKIXCertStoreSelector certSelect, List certStores) protected static CollectionfindCertificates(X509AttributeCertStoreSelector certSelect, List certStores) protected static CollectionfindCertificates(X509CertStoreSelector certSelect, List certStores) Return a Collection of all certificates or attribute certificates found in the X509Store's that are matching the certSelect criteriums.protected static AlgorithmIdentifierDeprecated.intDeprecated.protected static voidgetCertStatus(Date validDate, X509CRL crl, Object cert, org.bouncycastle.x509.CertStatus certStatus) protected VectorgetCRLDistUrls(CRLDistPoint crlDistPoints) Deprecated.protected static X500PrincipalReturns the issuer of an attribute certificate or certificate.List[]Deprecated.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.getErrors(int index) Deprecated.Returns an List of error messages for the certificate at the given index in the CertPath.protected static ASN1PrimitivegetExtensionValue(X509Extension ext, String oid) Extract the value of the given extension, if it exists.protected static X500Principalprotected static PublicKeygetNextWorkingKey(List certs, int index) Return the next working key inheriting DSA parameters if necessary.List[]Deprecated.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.getNotifications(int index) Deprecated.Returns an List of notification messages for the certificate at the given index in the CertPath.protected VectorgetOCSPUrls(AuthorityInformationAccess authInfoAccess) Deprecated.Deprecated.protected static final SetgetQualifierSet(ASN1Sequence qualifiers) protected static X500PrincipalDeprecated.Deprecated.protected CollectiongetTrustAnchors(X509Certificate cert, Set trustanchors) Deprecated.protected static DategetValidityDate(PKIXParameters paramsPKIX, Date currentDate) voidinit(CertPath certPath, PKIXParameters params) Deprecated.Initializes the PKIXCertPathReviewer with the givenCertPathandPKIXParametersparamsprotected static booleanisAnyPolicy(Set policySet) protected static booleanisSelfIssued(X509Certificate cert) booleanDeprecated.protected static voidprepareNextCertB1(int i, List[] policyNodes, String id_p, Map m_idp, X509Certificate cert) protected static PKIXPolicyNodeprepareNextCertB2(int i, List[] policyNodes, String id_p, PKIXPolicyNode validPolicyTree) protected static booleanprocessCertD1i(int index, List[] policyNodes, ASN1ObjectIdentifier pOid, Set pq) protected static voidprocessCertD1ii(int index, List[] policyNodes, ASN1ObjectIdentifier _poid, Set _pq) protected static PKIXPolicyNoderemovePolicyNode(PKIXPolicyNode validPolicyTree, List[] policyNodes, PKIXPolicyNode _node) protected static voidverifyX509Certificate(X509Certificate cert, PublicKey publicKey, String sigProvider)
-
Field Details
-
certPath
Deprecated. -
pkixParams
Deprecated. -
currentDate
Deprecated. -
validDate
Deprecated. -
certs
Deprecated. -
n
protected int nDeprecated. -
notifications
Deprecated. -
errors
Deprecated. -
trustAnchor
Deprecated. -
subjectPublicKey
Deprecated. -
policyTree
Deprecated. -
CERTIFICATE_POLICIES
-
BASIC_CONSTRAINTS
-
POLICY_MAPPINGS
-
SUBJECT_ALTERNATIVE_NAME
-
NAME_CONSTRAINTS
-
KEY_USAGE
-
INHIBIT_ANY_POLICY
-
ISSUING_DISTRIBUTION_POINT
-
DELTA_CRL_INDICATOR
-
POLICY_CONSTRAINTS
-
CRL_NUMBER
-
ANY_POLICY
- See Also:
-
KEY_CERT_SIGN
protected static final int KEY_CERT_SIGN- See Also:
-
CRL_SIGN
protected static final int CRL_SIGN- See Also:
-
crlReasons
-
-
Constructor Details
-
PKIXCertPathReviewer
public PKIXCertPathReviewer(CertPath certPath, PKIXParameters params) throws CertPathReviewerException Deprecated.Creates a PKIXCertPathReviewer and initializes it with the givenCertPathandPKIXParametersparams- Parameters:
certPath- theCertPathto validateparams- thePKIXParametersto use- Throws:
CertPathReviewerException- if the certPath is empty
-
PKIXCertPathReviewer
public PKIXCertPathReviewer()Deprecated.Creates an empty PKIXCertPathReviewer. Don't forget to call init() to initialize the object.
-
-
Method Details
-
init
Deprecated.Initializes the PKIXCertPathReviewer with the givenCertPathandPKIXParametersparams- Parameters:
certPath- theCertPathto validateparams- thePKIXParametersto use- Throws:
CertPathReviewerException- if the certPath is emptyIllegalStateException- if thePKIXCertPathRevieweris already initialized
-
getCertPath
Deprecated.- Returns:
- the CertPath that was validated
-
getCertPathSize
public int getCertPathSize()Deprecated.- Returns:
- the size of the CertPath
-
getErrors
Deprecated.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:
- the Array of Lists which contain the error messages
- Throws:
IllegalStateException- if thePKIXCertPathReviewerwas not initialized
-
getErrors
Deprecated.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- the index of the certificate in the CertPath- Returns:
- List of error messages for the certificate
- Throws:
IllegalStateException- if thePKIXCertPathReviewerwas not initialized
-
getNotifications
Deprecated.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:
- the Array of Lists which contain the notification messages
- Throws:
IllegalStateException- if thePKIXCertPathReviewerwas not initialized
-
getNotifications
Deprecated.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- the index of the certificate in the CertPath- Returns:
- List of notification messages for the certificate
- Throws:
IllegalStateException- if thePKIXCertPathReviewerwas not initialized
-
getPolicyTree
Deprecated.- Returns:
- the valid policy tree, null if no valid policy exists.
- Throws:
IllegalStateException- if thePKIXCertPathReviewerwas not initialized
-
getSubjectPublicKey
Deprecated.- Returns:
- the PublicKey if the last certificate in the CertPath
- Throws:
IllegalStateException- if thePKIXCertPathReviewerwas not initialized
-
getTrustAnchor
Deprecated.- Returns:
- the TrustAnchor for the CertPath, null if no valid TrustAnchor was found.
- Throws:
IllegalStateException- if thePKIXCertPathReviewerwas not initialized
-
isValidCertPath
public boolean isValidCertPath()Deprecated.- Returns:
- if the CertPath is valid
- Throws:
IllegalStateException- if thePKIXCertPathReviewerwas not initialized
-
addNotification
Deprecated. -
addNotification
Deprecated. -
addError
Deprecated. -
addError
Deprecated. -
doChecks
protected void doChecks()Deprecated. -
checkRevocation
protected void checkRevocation(PKIXParameters paramsPKIX, X509Certificate cert, Date validDate, X509Certificate sign, PublicKey workingPublicKey, Vector crlDistPointUrls, Vector ocspUrls, int index) throws CertPathReviewerException Deprecated.- Throws:
CertPathReviewerException
-
checkCRLs
protected void checkCRLs(PKIXParameters paramsPKIX, X509Certificate cert, Date validDate, X509Certificate sign, PublicKey workingPublicKey, Vector crlDistPointUrls, int index) throws CertPathReviewerException Deprecated.- Throws:
CertPathReviewerException
-
getCRLDistUrls
Deprecated. -
getOCSPUrls
Deprecated. -
getTrustAnchors
protected Collection getTrustAnchors(X509Certificate cert, Set trustanchors) throws CertPathReviewerException Deprecated.- Throws:
CertPathReviewerException
-
getEncodedIssuerPrincipal
Returns the issuer of an attribute certificate or certificate.- Parameters:
cert- The attribute certificate or certificate.- Returns:
- The issuer as
X500Principal.
-
getValidityDate
-
getSubjectPrincipal
-
isSelfIssued
-
getExtensionValue
protected static ASN1Primitive getExtensionValue(X509Extension ext, String oid) throws AnnotatedException Extract the value of the given extension, if it exists.- Parameters:
ext- The extension object.oid- The object identifier to obtain.- Throws:
AnnotatedException- if the extension cannot be read.
-
getIssuerPrincipal
-
getAlgorithmIdentifier
protected static AlgorithmIdentifier getAlgorithmIdentifier(PublicKey key) throws CertPathValidatorException - Throws:
CertPathValidatorException
-
getQualifierSet
protected static final Set getQualifierSet(ASN1Sequence qualifiers) throws CertPathValidatorException - Throws:
CertPathValidatorException
-
removePolicyNode
protected static PKIXPolicyNode removePolicyNode(PKIXPolicyNode validPolicyTree, List[] policyNodes, PKIXPolicyNode _node) -
processCertD1i
protected static boolean processCertD1i(int index, List[] policyNodes, ASN1ObjectIdentifier pOid, Set pq) -
processCertD1ii
protected static void processCertD1ii(int index, List[] policyNodes, ASN1ObjectIdentifier _poid, Set _pq) -
prepareNextCertB1
protected static void prepareNextCertB1(int i, List[] policyNodes, String id_p, Map m_idp, X509Certificate cert) throws AnnotatedException, CertPathValidatorException -
prepareNextCertB2
protected static PKIXPolicyNode prepareNextCertB2(int i, List[] policyNodes, String id_p, PKIXPolicyNode validPolicyTree) -
isAnyPolicy
-
findCertificates
protected static Collection findCertificates(X509CertStoreSelector certSelect, List certStores) throws AnnotatedException Return a Collection of all certificates or attribute certificates found in the X509Store's that are matching the certSelect criteriums.- Parameters:
certSelect- aSelectorobject that will be used to select the certificatescertStores- a List containing onlyX509Storeobjects. These are used to search for certificates.- Returns:
- a Collection of all found
X509CertificateorX509AttributeCertificateobjects. May be empty but nevernull. - Throws:
AnnotatedException
-
findCertificates
protected static Collection findCertificates(PKIXCertStoreSelector certSelect, List certStores) throws AnnotatedException - Throws:
AnnotatedException
-
findCertificates
protected static Collection findCertificates(X509AttributeCertStoreSelector certSelect, List certStores) throws AnnotatedException - Throws:
AnnotatedException
-
getCertStatus
protected static void getCertStatus(Date validDate, X509CRL crl, Object cert, org.bouncycastle.x509.CertStatus certStatus) throws AnnotatedException - Throws:
AnnotatedException
-
getNextWorkingKey
protected static PublicKey getNextWorkingKey(List certs, int index) throws CertPathValidatorException Return the next working key inheriting DSA parameters if necessary.This methods inherits DSA parameters from the indexed certificate or previous certificates in the certificate chain to the returned
PublicKey. The list is searched upwards, meaning the end certificate is at position 0 and previous certificates are following.If the indexed certificate does not contain a DSA key this method simply returns the public key. If the DSA key already contains DSA parameters the key is also only returned.
- Parameters:
certs- The certification path.index- The index of the certificate which contains the public key which should be extended with DSA parameters.- Returns:
- The public key of the certificate in list position
indexextended with DSA parameters if applicable. - Throws:
CertPathValidatorException- if DSA parameters cannot be inherited.
-
verifyX509Certificate
protected static void verifyX509Certificate(X509Certificate cert, PublicKey publicKey, String sigProvider) throws GeneralSecurityException - Throws:
GeneralSecurityException
-