Class FixedBCPKIXCertPathReviewer
- java.lang.Object
-
- org.bouncycastle.x509.PKIXCertPathReviewer
-
- eu.emi.security.authn.x509.helpers.pkipath.bc.FixedBCPKIXCertPathReviewer
-
public class FixedBCPKIXCertPathReviewer extends org.bouncycastle.x509.PKIXCertPathReviewerPKIXCertPathReviewer
Validation of X.509 Certificate Paths. Tries to find as much errors in the Path as possible. Copy note: unfortunately a lot of code can not be inherited, as too many methods are private + are very long :-(
-
-
Field Summary
Fields Modifier and Type Field Description protected static java.lang.StringANY_POLICYprotected static java.lang.StringAUTHORITY_KEY_IDENTIFIERprotected static java.lang.StringBASIC_CONSTRAINTSprotected static java.lang.StringCERTIFICATE_POLICIESprotected static java.lang.StringCRL_DISTRIBUTION_POINTSprotected static java.lang.StringCRL_NUMBERprotected static intCRL_SIGNprotected static org.bouncycastle.x509.PKIXCRLUtilCRL_UTILprotected static java.lang.String[]crlReasonsprotected static java.lang.StringDELTA_CRL_INDICATORprotected static java.lang.StringFRESHEST_CRLprotected static java.lang.StringINHIBIT_ANY_POLICYprotected static java.lang.StringISSUING_DISTRIBUTION_POINTprotected static intKEY_CERT_SIGNprotected static java.lang.StringKEY_USAGEprotected static java.lang.StringNAME_CONSTRAINTSprotected ExtPKIXParameters2pkixParamsprotected static java.lang.StringPOLICY_CONSTRAINTSprotected static java.lang.StringPOLICY_MAPPINGSstatic java.lang.StringRESOURCE_NAMEprotected static java.lang.StringSUBJECT_ALTERNATIVE_NAME
-
Constructor Summary
Constructors Constructor Description FixedBCPKIXCertPathReviewer(java.security.cert.CertPath certPath, ExtPKIXParameters2 params)Creates a PKIXCertPathReviewer and initializes it with the givenCertPathandPKIXParametersparams
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddError(SimpleValidationErrorException msg, int index)protected voidcheckRevocation(ExtPKIXParameters2 paramsPKIX, java.security.cert.X509Certificate cert, java.util.Date validDate, java.security.cert.X509Certificate sign, java.security.PublicKey workingPublicKey)protected voiddoChecks()protected static java.util.CollectionfindCertificates(org.bouncycastle.jcajce.PKIXCertStoreSelector arg0, java.util.List arg1)protected static java.util.CollectionfindCertificates(org.bouncycastle.x509.X509AttributeCertStoreSelector arg0, java.util.List arg1)protected static java.util.CollectionfindCertificates(org.bouncycastle.x509.X509CertStoreSelector arg0, java.util.List arg1)protected static org.bouncycastle.asn1.x509.AlgorithmIdentifiergetAlgorithmIdentifier(java.security.PublicKey arg0)protected static voidgetCertStatus(java.util.Date arg0, java.security.cert.X509CRL arg1, java.lang.Object arg2, org.bouncycastle.x509.CertStatus arg3)protected java.util.VectorgetCRLDistUrls(org.bouncycastle.asn1.x509.CRLDistPoint crlDistPoints)protected static javax.security.auth.x500.X500PrincipalgetEncodedIssuerPrincipal(java.lang.Object arg0)protected static org.bouncycastle.asn1.ASN1PrimitivegetExtensionValue(java.security.cert.X509Extension arg0, java.lang.String arg1)protected static javax.security.auth.x500.X500PrincipalgetIssuerPrincipal(java.security.cert.X509CRL arg0)protected static java.security.PublicKeygetNextWorkingKey(java.util.List arg0, int arg1)protected static java.util.SetgetQualifierSet(org.bouncycastle.asn1.ASN1Sequence arg0)protected static javax.security.auth.x500.X500PrincipalgetSubjectPrincipal(java.security.cert.X509Certificate arg0)protected static java.util.DategetValidDate(java.security.cert.PKIXParameters arg0)voidinit(java.security.cert.CertPath certPath, ExtPKIXParameters2 params)Initializes the PKIXCertPathReviewer with the givenCertPathandPKIXParametersparamsprotected static booleanisAnyPolicy(java.util.Set arg0)protected static booleanisSelfIssued(java.security.cert.X509Certificate arg0)protected static voidprepareNextCertB1(int arg0, java.util.List[] arg1, java.lang.String arg2, java.util.Map arg3, java.security.cert.X509Certificate arg4)protected static org.bouncycastle.jce.provider.PKIXPolicyNodeprepareNextCertB2(int arg0, java.util.List[] arg1, java.lang.String arg2, org.bouncycastle.jce.provider.PKIXPolicyNode arg3)protected static booleanprocessCertD1i(int arg0, java.util.List[] arg1, org.bouncycastle.asn1.ASN1ObjectIdentifier arg2, java.util.Set arg3)protected static voidprocessCertD1ii(int arg0, java.util.List[] arg1, org.bouncycastle.asn1.ASN1ObjectIdentifier arg2, java.util.Set arg3)protected static org.bouncycastle.jce.provider.PKIXPolicyNoderemovePolicyNode(org.bouncycastle.jce.provider.PKIXPolicyNode arg0, java.util.List[] arg1, org.bouncycastle.jce.provider.PKIXPolicyNode arg2)protected static voidverifyX509Certificate(java.security.cert.X509Certificate arg0, java.security.PublicKey arg1, java.lang.String arg2)-
Methods inherited from class org.bouncycastle.x509.PKIXCertPathReviewer
addError, addError, addNotification, addNotification, checkCRLs, checkRevocation, getCertPath, getCertPathSize, getErrors, getErrors, getNotifications, getNotifications, getOCSPUrls, getPolicyTree, getSubjectPublicKey, getTrustAnchor, getTrustAnchors, init, isValidCertPath
-
-
-
-
Field Detail
-
RESOURCE_NAME
public static final java.lang.String RESOURCE_NAME
- See Also:
- Constant Field Values
-
pkixParams
protected ExtPKIXParameters2 pkixParams
-
CRL_UTIL
protected static final org.bouncycastle.x509.PKIXCRLUtil CRL_UTIL
-
CERTIFICATE_POLICIES
protected static final java.lang.String CERTIFICATE_POLICIES
-
BASIC_CONSTRAINTS
protected static final java.lang.String BASIC_CONSTRAINTS
-
POLICY_MAPPINGS
protected static final java.lang.String POLICY_MAPPINGS
-
SUBJECT_ALTERNATIVE_NAME
protected static final java.lang.String SUBJECT_ALTERNATIVE_NAME
-
NAME_CONSTRAINTS
protected static final java.lang.String NAME_CONSTRAINTS
-
KEY_USAGE
protected static final java.lang.String KEY_USAGE
-
INHIBIT_ANY_POLICY
protected static final java.lang.String INHIBIT_ANY_POLICY
-
ISSUING_DISTRIBUTION_POINT
protected static final java.lang.String ISSUING_DISTRIBUTION_POINT
-
DELTA_CRL_INDICATOR
protected static final java.lang.String DELTA_CRL_INDICATOR
-
POLICY_CONSTRAINTS
protected static final java.lang.String POLICY_CONSTRAINTS
-
FRESHEST_CRL
protected static final java.lang.String FRESHEST_CRL
-
CRL_DISTRIBUTION_POINTS
protected static final java.lang.String CRL_DISTRIBUTION_POINTS
-
AUTHORITY_KEY_IDENTIFIER
protected static final java.lang.String AUTHORITY_KEY_IDENTIFIER
-
ANY_POLICY
protected static final java.lang.String ANY_POLICY
- See Also:
- Constant Field Values
-
CRL_NUMBER
protected static final java.lang.String CRL_NUMBER
-
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
protected static final java.lang.String[] crlReasons
-
-
Constructor Detail
-
FixedBCPKIXCertPathReviewer
public FixedBCPKIXCertPathReviewer(java.security.cert.CertPath certPath, ExtPKIXParameters2 params) throws org.bouncycastle.x509.CertPathReviewerExceptionCreates a PKIXCertPathReviewer and initializes it with the givenCertPathandPKIXParametersparams- Parameters:
certPath- theCertPathto validateparams- thePKIXParametersto use- Throws:
org.bouncycastle.x509.CertPathReviewerException- if the certPath is empty
-
-
Method Detail
-
init
public void init(java.security.cert.CertPath certPath, ExtPKIXParameters2 params) throws org.bouncycastle.x509.CertPathReviewerExceptionInitializes the PKIXCertPathReviewer with the givenCertPathandPKIXParametersparams- Parameters:
certPath- theCertPathto validateparams- thePKIXParametersto use- Throws:
org.bouncycastle.x509.CertPathReviewerException- if the certPath is emptyjava.lang.IllegalStateException- if thePKIXCertPathRevieweris already initialized
-
addError
protected void addError(SimpleValidationErrorException msg, int index)
-
doChecks
protected void doChecks()
- Overrides:
doChecksin classorg.bouncycastle.x509.PKIXCertPathReviewer
-
checkRevocation
protected void checkRevocation(ExtPKIXParameters2 paramsPKIX, java.security.cert.X509Certificate cert, java.util.Date validDate, java.security.cert.X509Certificate sign, java.security.PublicKey workingPublicKey) throws SimpleValidationErrorException
- Throws:
SimpleValidationErrorException
-
getCRLDistUrls
protected java.util.Vector getCRLDistUrls(org.bouncycastle.asn1.x509.CRLDistPoint crlDistPoints)
- Overrides:
getCRLDistUrlsin classorg.bouncycastle.x509.PKIXCertPathReviewer
-
getEncodedIssuerPrincipal
protected static javax.security.auth.x500.X500Principal getEncodedIssuerPrincipal(java.lang.Object arg0)
-
getValidDate
protected static java.util.Date getValidDate(java.security.cert.PKIXParameters arg0)
-
getSubjectPrincipal
protected static javax.security.auth.x500.X500Principal getSubjectPrincipal(java.security.cert.X509Certificate arg0)
-
isSelfIssued
protected static boolean isSelfIssued(java.security.cert.X509Certificate arg0)
-
getExtensionValue
protected static org.bouncycastle.asn1.ASN1Primitive getExtensionValue(java.security.cert.X509Extension arg0, java.lang.String arg1) throws org.bouncycastle.jce.provider.AnnotatedException- Throws:
org.bouncycastle.jce.provider.AnnotatedException
-
getIssuerPrincipal
protected static javax.security.auth.x500.X500Principal getIssuerPrincipal(java.security.cert.X509CRL arg0)
-
getAlgorithmIdentifier
protected static org.bouncycastle.asn1.x509.AlgorithmIdentifier getAlgorithmIdentifier(java.security.PublicKey arg0) throws java.security.cert.CertPathValidatorException- Throws:
java.security.cert.CertPathValidatorException
-
getQualifierSet
protected static final java.util.Set getQualifierSet(org.bouncycastle.asn1.ASN1Sequence arg0) throws java.security.cert.CertPathValidatorException- Throws:
java.security.cert.CertPathValidatorException
-
removePolicyNode
protected static org.bouncycastle.jce.provider.PKIXPolicyNode removePolicyNode(org.bouncycastle.jce.provider.PKIXPolicyNode arg0, java.util.List[] arg1, org.bouncycastle.jce.provider.PKIXPolicyNode arg2)
-
processCertD1i
protected static boolean processCertD1i(int arg0, java.util.List[] arg1, org.bouncycastle.asn1.ASN1ObjectIdentifier arg2, java.util.Set arg3)
-
processCertD1ii
protected static void processCertD1ii(int arg0, java.util.List[] arg1, org.bouncycastle.asn1.ASN1ObjectIdentifier arg2, java.util.Set arg3)
-
prepareNextCertB1
protected static void prepareNextCertB1(int arg0, java.util.List[] arg1, java.lang.String arg2, java.util.Map arg3, java.security.cert.X509Certificate arg4) throws org.bouncycastle.jce.provider.AnnotatedException, java.security.cert.CertPathValidatorException- Throws:
org.bouncycastle.jce.provider.AnnotatedExceptionjava.security.cert.CertPathValidatorException
-
prepareNextCertB2
protected static org.bouncycastle.jce.provider.PKIXPolicyNode prepareNextCertB2(int arg0, java.util.List[] arg1, java.lang.String arg2, org.bouncycastle.jce.provider.PKIXPolicyNode arg3)
-
isAnyPolicy
protected static boolean isAnyPolicy(java.util.Set arg0)
-
findCertificates
protected static java.util.Collection findCertificates(org.bouncycastle.x509.X509CertStoreSelector arg0, java.util.List arg1) throws org.bouncycastle.jce.provider.AnnotatedException- Throws:
org.bouncycastle.jce.provider.AnnotatedException
-
findCertificates
protected static java.util.Collection findCertificates(org.bouncycastle.jcajce.PKIXCertStoreSelector arg0, java.util.List arg1) throws org.bouncycastle.jce.provider.AnnotatedException- Throws:
org.bouncycastle.jce.provider.AnnotatedException
-
findCertificates
protected static java.util.Collection findCertificates(org.bouncycastle.x509.X509AttributeCertStoreSelector arg0, java.util.List arg1) throws org.bouncycastle.jce.provider.AnnotatedException- Throws:
org.bouncycastle.jce.provider.AnnotatedException
-
getCertStatus
protected static void getCertStatus(java.util.Date arg0, java.security.cert.X509CRL arg1, java.lang.Object arg2, org.bouncycastle.x509.CertStatus arg3) throws org.bouncycastle.jce.provider.AnnotatedException- Throws:
org.bouncycastle.jce.provider.AnnotatedException
-
getNextWorkingKey
protected static java.security.PublicKey getNextWorkingKey(java.util.List arg0, int arg1) throws java.security.cert.CertPathValidatorException- Throws:
java.security.cert.CertPathValidatorException
-
verifyX509Certificate
protected static void verifyX509Certificate(java.security.cert.X509Certificate arg0, java.security.PublicKey arg1, java.lang.String arg2) throws java.security.GeneralSecurityException- Throws:
java.security.GeneralSecurityException
-
-