Package org.bouncycastle.jce.provider
Class RFC3280CertPathUtilities
java.lang.Object
org.bouncycastle.jce.provider.RFC3280CertPathUtilities
public class RFC3280CertPathUtilities extends Object
-
Field Summary
Fields Modifier and Type Field Description static StringANY_POLICYstatic StringAUTHORITY_KEY_IDENTIFIERstatic StringBASIC_CONSTRAINTSstatic StringCERTIFICATE_POLICIESstatic StringCRL_DISTRIBUTION_POINTSstatic StringCRL_NUMBERprotected static intCRL_SIGNprotected static String[]crlReasonsstatic StringDELTA_CRL_INDICATORstatic StringFRESHEST_CRLstatic StringINHIBIT_ANY_POLICYstatic StringISSUING_DISTRIBUTION_POINTprotected static intKEY_CERT_SIGNstatic StringKEY_USAGEstatic StringNAME_CONSTRAINTSstatic StringPOLICY_CONSTRAINTSstatic StringPOLICY_MAPPINGSstatic StringSUBJECT_ALTERNATIVE_NAME -
Constructor Summary
Constructors Constructor Description RFC3280CertPathUtilities() -
Method Summary
Modifier and Type Method Description protected static voidcheckCRLs(ExtendedPKIXParameters paramsPKIX, X509Certificate cert, Date validDate, X509Certificate sign, PublicKey workingPublicKey, List certPathCerts)Checks a certificate if it is revoked.protected static PKIXPolicyNodeprepareCertB(CertPath certPath, int index, List[] policyNodes, PKIXPolicyNode validPolicyTree, int policyMapping)protected static voidprepareNextCertA(CertPath certPath, int index)protected static voidprepareNextCertG(CertPath certPath, int index, PKIXNameConstraintValidator nameConstraintValidator)protected static intprepareNextCertH1(CertPath certPath, int index, int explicitPolicy)protected static intprepareNextCertH2(CertPath certPath, int index, int policyMapping)protected static intprepareNextCertH3(CertPath certPath, int index, int inhibitAnyPolicy)protected static intprepareNextCertI1(CertPath certPath, int index, int explicitPolicy)protected static intprepareNextCertI2(CertPath certPath, int index, int policyMapping)protected static intprepareNextCertJ(CertPath certPath, int index, int inhibitAnyPolicy)protected static voidprepareNextCertK(CertPath certPath, int index)protected static intprepareNextCertL(CertPath certPath, int index, int maxPathLength)protected static intprepareNextCertM(CertPath certPath, int index, int maxPathLength)protected static voidprepareNextCertN(CertPath certPath, int index)protected static voidprepareNextCertO(CertPath certPath, int index, Set criticalExtensions, List pathCheckers)protected static voidprocessCertA(CertPath certPath, ExtendedPKIXParameters paramsPKIX, int index, PublicKey workingPublicKey, boolean verificationAlreadyPerformed, X500Principal workingIssuerName, X509Certificate sign)protected static voidprocessCertBC(CertPath certPath, int index, PKIXNameConstraintValidator nameConstraintValidator)protected static PKIXPolicyNodeprocessCertD(CertPath certPath, int index, Set acceptablePolicies, PKIXPolicyNode validPolicyTree, List[] policyNodes, int inhibitAnyPolicy)protected static PKIXPolicyNodeprocessCertE(CertPath certPath, int index, PKIXPolicyNode validPolicyTree)protected static voidprocessCertF(CertPath certPath, int index, PKIXPolicyNode validPolicyTree, int explicitPolicy)protected static SetprocessCRLA1i(Date currentDate, ExtendedPKIXParameters paramsPKIX, X509Certificate cert, X509CRL crl)protected static Set[]processCRLA1ii(Date currentDate, ExtendedPKIXParameters paramsPKIX, X509Certificate cert, X509CRL crl)protected static voidprocessCRLB1(DistributionPoint dp, Object cert, X509CRL crl)If the DP includes cRLIssuer, then verify that the issuer field in the complete CRL matches cRLIssuer in the DP and that the complete CRL contains an issuing distribution point extension with the indirectCRL boolean asserted.protected static voidprocessCRLB2(DistributionPoint dp, Object cert, X509CRL crl)If the complete CRL includes an issuing distribution point (IDP) CRL extension check the following:protected static voidprocessCRLC(X509CRL deltaCRL, X509CRL completeCRL, ExtendedPKIXParameters pkixParams)If use-deltas is set, verify the issuer and scope of the delta CRL.protected static org.bouncycastle.jce.provider.ReasonsMaskprocessCRLD(X509CRL crl, DistributionPoint dp)protected static SetprocessCRLF(X509CRL crl, Object cert, X509Certificate defaultCRLSignCert, PublicKey defaultCRLSignKey, ExtendedPKIXParameters paramsPKIX, List certPathCerts)Obtain and validate the certification path for the complete CRL issuer.protected static PublicKeyprocessCRLG(X509CRL crl, Set keys)protected static X509CRLprocessCRLH(Set deltacrls, PublicKey key)protected static voidprocessCRLI(Date validDate, X509CRL deltacrl, Object cert, org.bouncycastle.jce.provider.CertStatus certStatus, ExtendedPKIXParameters pkixParams)protected static voidprocessCRLJ(Date validDate, X509CRL completecrl, Object cert, org.bouncycastle.jce.provider.CertStatus certStatus)protected static intwrapupCertA(int explicitPolicy, X509Certificate cert)protected static intwrapupCertB(CertPath certPath, int index, int explicitPolicy)protected static voidwrapupCertF(CertPath certPath, int index, List pathCheckers, Set criticalExtensions)protected static PKIXPolicyNodewrapupCertG(CertPath certPath, ExtendedPKIXParameters paramsPKIX, Set userInitialPolicySet, int index, List[] policyNodes, PKIXPolicyNode validPolicyTree, Set acceptablePolicies)
-
Field Details
-
CERTIFICATE_POLICIES
-
POLICY_MAPPINGS
-
INHIBIT_ANY_POLICY
-
ISSUING_DISTRIBUTION_POINT
-
FRESHEST_CRL
-
DELTA_CRL_INDICATOR
-
POLICY_CONSTRAINTS
-
BASIC_CONSTRAINTS
-
CRL_DISTRIBUTION_POINTS
-
SUBJECT_ALTERNATIVE_NAME
-
NAME_CONSTRAINTS
-
AUTHORITY_KEY_IDENTIFIER
-
KEY_USAGE
-
CRL_NUMBER
-
ANY_POLICY
- See Also:
- Constant Field Values
-
KEY_CERT_SIGN
protected static final int KEY_CERT_SIGN- See Also:
- Constant Field Values
-
CRL_SIGN
protected static final int CRL_SIGN- See Also:
- Constant Field Values
-
crlReasons
-
-
Constructor Details
-
RFC3280CertPathUtilities
public RFC3280CertPathUtilities()
-
-
Method Details
-
processCRLB2
protected static void processCRLB2(DistributionPoint dp, Object cert, X509CRL crl) throws AnnotatedExceptionIf the complete CRL includes an issuing distribution point (IDP) CRL extension check the following: (i) If the distribution point name is present in the IDP CRL extension and the distribution field is present in the DP, then verify that one of the names in the IDP matches one of the names in the DP. If the distribution point name is present in the IDP CRL extension and the distribution field is omitted from the DP, then verify that one of the names in the IDP matches one of the names in the cRLIssuer field of the DP. (ii) If the onlyContainsUserCerts boolean is asserted in the IDP CRL extension, verify that the certificate does not include the basic constraints extension with the cA boolean asserted. (iii) If the onlyContainsCACerts boolean is asserted in the IDP CRL extension, verify that the certificate includes the basic constraints extension with the cA boolean asserted. (iv) Verify that the onlyContainsAttributeCerts boolean is not asserted.- Parameters:
dp- The distribution point.cert- The certificate.crl- The CRL.- Throws:
AnnotatedException- if one of the conditions is not met or an error occurs.
-
processCRLB1
protected static void processCRLB1(DistributionPoint dp, Object cert, X509CRL crl) throws AnnotatedExceptionIf the DP includes cRLIssuer, then verify that the issuer field in the complete CRL matches cRLIssuer in the DP and that the complete CRL contains an issuing distribution point extension with the indirectCRL boolean asserted. Otherwise, verify that the CRL issuer matches the certificate issuer.- Parameters:
dp- The distribution point.cert- The certificate ot attribute certificate.crl- The CRL forcert.- Throws:
AnnotatedException- if one of the above conditions does not apply or an error occurs.
-
processCRLD
protected static org.bouncycastle.jce.provider.ReasonsMask processCRLD(X509CRL crl, DistributionPoint dp) throws AnnotatedException- Throws:
AnnotatedException
-
processCRLF
protected static Set processCRLF(X509CRL crl, Object cert, X509Certificate defaultCRLSignCert, PublicKey defaultCRLSignKey, ExtendedPKIXParameters paramsPKIX, List certPathCerts) throws AnnotatedExceptionObtain and validate the certification path for the complete CRL issuer. If a key usage extension is present in the CRL issuer's certificate, verify that the cRLSign bit is set.- Parameters:
crl- CRL which contains revocation information for the certificatecert.cert- The attribute certificate or certificate to check if it is revoked.defaultCRLSignCert- The issuer certificate of the certificatecert.defaultCRLSignKey- The public key of the issuer certificatedefaultCRLSignCert.paramsPKIX- paramsPKIX PKIX parameters.certPathCerts- The certificates on the certification path.- Returns:
- A
Setwith all keys of possible CRL issuer certificates. - Throws:
AnnotatedException- if the CRL is not valid or the status cannot be checked or some error occurs.
-
processCRLG
- Throws:
AnnotatedException
-
processCRLH
- Throws:
AnnotatedException
-
processCRLA1i
protected static Set processCRLA1i(Date currentDate, ExtendedPKIXParameters paramsPKIX, X509Certificate cert, X509CRL crl) throws AnnotatedException- Throws:
AnnotatedException
-
processCRLA1ii
protected static Set[] processCRLA1ii(Date currentDate, ExtendedPKIXParameters paramsPKIX, X509Certificate cert, X509CRL crl) throws AnnotatedException- Throws:
AnnotatedException
-
processCRLC
protected static void processCRLC(X509CRL deltaCRL, X509CRL completeCRL, ExtendedPKIXParameters pkixParams) throws AnnotatedExceptionIf use-deltas is set, verify the issuer and scope of the delta CRL.- Parameters:
deltaCRL- The delta CRL.completeCRL- The complete CRL.pkixParams- The PKIX paramaters.- Throws:
AnnotatedException- if an exception occurs.
-
processCRLI
protected static void processCRLI(Date validDate, X509CRL deltacrl, Object cert, org.bouncycastle.jce.provider.CertStatus certStatus, ExtendedPKIXParameters pkixParams) throws AnnotatedException- Throws:
AnnotatedException
-
processCRLJ
protected static void processCRLJ(Date validDate, X509CRL completecrl, Object cert, org.bouncycastle.jce.provider.CertStatus certStatus) throws AnnotatedException- Throws:
AnnotatedException
-
prepareCertB
protected static PKIXPolicyNode prepareCertB(CertPath certPath, int index, List[] policyNodes, PKIXPolicyNode validPolicyTree, int policyMapping) throws CertPathValidatorException- Throws:
CertPathValidatorException
-
prepareNextCertA
protected static void prepareNextCertA(CertPath certPath, int index) throws CertPathValidatorException- Throws:
CertPathValidatorException
-
processCertF
protected static void processCertF(CertPath certPath, int index, PKIXPolicyNode validPolicyTree, int explicitPolicy) throws CertPathValidatorException- Throws:
CertPathValidatorException
-
processCertE
protected static PKIXPolicyNode processCertE(CertPath certPath, int index, PKIXPolicyNode validPolicyTree) throws CertPathValidatorException- Throws:
CertPathValidatorException
-
processCertBC
protected static void processCertBC(CertPath certPath, int index, PKIXNameConstraintValidator nameConstraintValidator) throws CertPathValidatorException- Throws:
CertPathValidatorException
-
processCertD
protected static PKIXPolicyNode processCertD(CertPath certPath, int index, Set acceptablePolicies, PKIXPolicyNode validPolicyTree, List[] policyNodes, int inhibitAnyPolicy) throws CertPathValidatorException- Throws:
CertPathValidatorException
-
processCertA
protected static void processCertA(CertPath certPath, ExtendedPKIXParameters paramsPKIX, int index, PublicKey workingPublicKey, boolean verificationAlreadyPerformed, X500Principal workingIssuerName, X509Certificate sign) throws ExtCertPathValidatorException- Throws:
ExtCertPathValidatorException
-
prepareNextCertI1
protected static int prepareNextCertI1(CertPath certPath, int index, int explicitPolicy) throws CertPathValidatorException- Throws:
CertPathValidatorException
-
prepareNextCertI2
protected static int prepareNextCertI2(CertPath certPath, int index, int policyMapping) throws CertPathValidatorException- Throws:
CertPathValidatorException
-
prepareNextCertG
protected static void prepareNextCertG(CertPath certPath, int index, PKIXNameConstraintValidator nameConstraintValidator) throws CertPathValidatorException- Throws:
CertPathValidatorException
-
checkCRLs
protected static void checkCRLs(ExtendedPKIXParameters paramsPKIX, X509Certificate cert, Date validDate, X509Certificate sign, PublicKey workingPublicKey, List certPathCerts) throws AnnotatedExceptionChecks a certificate if it is revoked.- Parameters:
paramsPKIX- PKIX parameters.cert- Certificate to check if it is revoked.validDate- The date when the certificate revocation status should be checked.sign- The issuer certificate of the certificatecert.workingPublicKey- The public key of the issuer certificatesign.certPathCerts- The certificates of the certification path.- Throws:
AnnotatedException- if the certificate is revoked or the status cannot be checked or some error occurs.
-
prepareNextCertJ
protected static int prepareNextCertJ(CertPath certPath, int index, int inhibitAnyPolicy) throws CertPathValidatorException- Throws:
CertPathValidatorException
-
prepareNextCertK
protected static void prepareNextCertK(CertPath certPath, int index) throws CertPathValidatorException- Throws:
CertPathValidatorException
-
prepareNextCertL
protected static int prepareNextCertL(CertPath certPath, int index, int maxPathLength) throws CertPathValidatorException- Throws:
CertPathValidatorException
-
prepareNextCertM
protected static int prepareNextCertM(CertPath certPath, int index, int maxPathLength) throws CertPathValidatorException- Throws:
CertPathValidatorException
-
prepareNextCertN
protected static void prepareNextCertN(CertPath certPath, int index) throws CertPathValidatorException- Throws:
CertPathValidatorException
-
prepareNextCertO
protected static void prepareNextCertO(CertPath certPath, int index, Set criticalExtensions, List pathCheckers) throws CertPathValidatorException- Throws:
CertPathValidatorException
-
prepareNextCertH1
-
prepareNextCertH2
-
prepareNextCertH3
-
wrapupCertA
-
wrapupCertB
protected static int wrapupCertB(CertPath certPath, int index, int explicitPolicy) throws CertPathValidatorException- Throws:
CertPathValidatorException
-
wrapupCertF
protected static void wrapupCertF(CertPath certPath, int index, List pathCheckers, Set criticalExtensions) throws CertPathValidatorException- Throws:
CertPathValidatorException
-
wrapupCertG
protected static PKIXPolicyNode wrapupCertG(CertPath certPath, ExtendedPKIXParameters paramsPKIX, Set userInitialPolicySet, int index, List[] policyNodes, PKIXPolicyNode validPolicyTree, Set acceptablePolicies) throws CertPathValidatorException- Throws:
CertPathValidatorException
-