public class CertPathValidatorUtilitiesCanl extends Object
CertPathValidatorUtilitiesCanl
plus in some
cases fixes bugs plus produces errors in the desired format.Modifier and Type | Field and Description |
---|---|
protected static String |
ANY_POLICY |
protected static String |
AUTHORITY_KEY_IDENTIFIER |
protected static String |
BASIC_CONSTRAINTS |
protected static String |
CERTIFICATE_POLICIES |
protected static String |
CRL_DISTRIBUTION_POINTS |
protected static String |
CRL_NUMBER |
protected static int |
CRL_SIGN |
protected static eu.emi.security.authn.x509.helpers.pkipath.bc.PKIXCRLUtil |
CRL_UTIL |
protected static String[] |
crlReasons |
protected static String |
DELTA_CRL_INDICATOR |
protected static String |
FRESHEST_CRL |
protected static String |
INHIBIT_ANY_POLICY |
protected static String |
ISSUING_DISTRIBUTION_POINT |
protected static int |
KEY_CERT_SIGN |
protected static String |
KEY_USAGE |
protected static String |
NAME_CONSTRAINTS |
protected static String |
POLICY_CONSTRAINTS |
protected static String |
POLICY_MAPPINGS |
protected static String |
SUBJECT_ALTERNATIVE_NAME |
Constructor and Description |
---|
CertPathValidatorUtilitiesCanl() |
Modifier and Type | Method and Description |
---|---|
protected static Collection |
findCertificates(PKIXCertStoreSelector certSelect,
List certStores)
Return a Collection of all certificates or attribute certificates found
in the X509Store's that are matching the certSelect criteriums.
|
static Collection<?> |
findIssuerCerts(X509Certificate cert,
PKIXExtendedBuilderParameters pkixParams) |
protected static TrustAnchor |
findTrustAnchor(X509Certificate cert,
Set trustAnchors)
Search the given Set of TrustAnchor's for one that is the
issuer of the given X509 certificate.
|
protected static TrustAnchor |
findTrustAnchor(X509Certificate cert,
Set trustAnchors,
String sigProvider)
Search the given Set of TrustAnchor's for one that is the
issuer of the given X509 certificate.
|
static TrustAnchor |
findTrustAnchorPublic(X509Certificate cert,
Set<?> trustAnchors,
String sigProvider) |
protected static List<PKIXCRLStore> |
getAdditionalStoresFromCRLDistributionPoint(CRLDistPoint crldp,
PKIXExtendedBuilderParameters pkixParams) |
protected static AlgorithmIdentifier |
getAlgorithmIdentifier(PublicKey key) |
protected static void |
getCertStatus(Date validDate,
X509CRL crl,
Object cert,
eu.emi.security.authn.x509.helpers.pkipath.bc.CertStatus certStatus) |
protected static Set |
getCompleteCRLs(DistributionPoint dp,
Object cert,
Date currentDate,
PKIXExtendedParameters paramsPKIX)
As
CertPathValidatorUtilities.getCompleteCRLs(DistributionPoint, Object, Date, PKIXExtendedParameters)
but it returns also expired CRLs. |
protected static Set<?> |
getCompleteCRLs2(DistributionPoint dp,
X509Certificate cert,
Date currentDate,
PKIXExtendedParameters paramsPKIX) |
protected static void |
getCRLIssuersFromDistributionPoint(DistributionPoint dp,
Collection issuerPrincipals,
X509CRLSelector selector)
Add the CRL issuers from the cRLIssuer field of the distribution point or
from the certificate if not given to the issuer criterion of the
selector . |
protected static Set |
getDeltaCRLs(Date validityDate,
X509CRL completeCRL,
List<CertStore> certStores,
List<PKIXCRLStore> pkixCrlStores)
Fetches delta CRLs according to RFC 3280 section 5.2.4.
|
protected static Set<X509CRL> |
getDeltaCRLs2(Date currentDate,
PKIXExtendedParameters paramsPKIX,
X509CRL completeCRL)
Fetches delta CRLs according to RFC 3280 section 5.2.4.
|
protected static ASN1Primitive |
getExtensionValue(X509Extension ext,
String oid) |
protected static PublicKey |
getNextWorkingKey(List certs,
int index,
JcaJceHelper helper)
Return the next working key inheriting DSA parameters if necessary.
|
protected static Set |
getQualifierSet(ASN1Sequence qualifiers) |
static BigInteger |
getSerialNumber(Object cert) |
protected static Date |
getValidCertDateFromValidityModel(PKIXExtendedParameters paramsPKIX,
CertPath certPath,
int index) |
protected static Date |
getValidDate(PKIXExtendedParameters paramsPKIX) |
protected static boolean |
isAnyPolicy(Set policySet) |
protected static boolean |
isSelfIssued(X509Certificate cert) |
protected static void |
prepareNextCertB1(int i,
List[] policyNodes,
String id_p,
Map m_idp,
X509Certificate cert) |
protected static PKIXPolicyNode |
prepareNextCertB2(int i,
List[] policyNodes,
String id_p,
PKIXPolicyNode validPolicyTree) |
protected static boolean |
processCertD1i(int index,
List[] policyNodes,
ASN1ObjectIdentifier pOid,
Set pq) |
protected static void |
processCertD1ii(int index,
List[] policyNodes,
ASN1ObjectIdentifier _poid,
Set _pq) |
protected static PKIXPolicyNode |
removePolicyNode(PKIXPolicyNode validPolicyTree,
List[] policyNodes,
PKIXPolicyNode _node) |
protected static void |
verifyX509Certificate(X509Certificate cert,
PublicKey publicKey,
String sigProvider) |
protected static final eu.emi.security.authn.x509.helpers.pkipath.bc.PKIXCRLUtil CRL_UTIL
protected static final String CERTIFICATE_POLICIES
protected static final String BASIC_CONSTRAINTS
protected static final String POLICY_MAPPINGS
protected static final String SUBJECT_ALTERNATIVE_NAME
protected static final String NAME_CONSTRAINTS
protected static final String KEY_USAGE
protected static final String INHIBIT_ANY_POLICY
protected static final String ISSUING_DISTRIBUTION_POINT
protected static final String DELTA_CRL_INDICATOR
protected static final String POLICY_CONSTRAINTS
protected static final String FRESHEST_CRL
protected static final String CRL_DISTRIBUTION_POINTS
protected static final String AUTHORITY_KEY_IDENTIFIER
protected static final String ANY_POLICY
protected static final String CRL_NUMBER
protected static final int KEY_CERT_SIGN
protected static final int CRL_SIGN
protected static final String[] crlReasons
public static TrustAnchor findTrustAnchorPublic(X509Certificate cert, Set<?> trustAnchors, String sigProvider) throws AnnotatedException
AnnotatedException
public static Collection<?> findIssuerCerts(X509Certificate cert, PKIXExtendedBuilderParameters pkixParams) throws AnnotatedException
AnnotatedException
protected static Set<?> getCompleteCRLs2(DistributionPoint dp, X509Certificate cert, Date currentDate, PKIXExtendedParameters paramsPKIX) throws SimpleValidationErrorException
SimpleValidationErrorException
protected static Set getCompleteCRLs(DistributionPoint dp, Object cert, Date currentDate, PKIXExtendedParameters paramsPKIX) throws AnnotatedException
CertPathValidatorUtilities.getCompleteCRLs(DistributionPoint, Object, Date, PKIXExtendedParameters)
but it returns also expired CRLs.dp
- cert
- currentDate
- paramsPKIX
- Set
of X509CRL
s.AnnotatedException
protected static Set<X509CRL> getDeltaCRLs2(Date currentDate, PKIXExtendedParameters paramsPKIX, X509CRL completeCRL) throws SimpleValidationErrorException
currentDate
- The date for which the delta CRLs must be valid.paramsPKIX
- The extended PKIX parameters.completeCRL
- The complete CRL the delta CRL is for.Set
of X509CRL
s with delta CRLs.SimpleValidationErrorException
- if an exception occurs while picking the
delta CRLs.protected static ASN1Primitive getExtensionValue(X509Extension ext, String oid) throws AnnotatedException
AnnotatedException
protected static List<PKIXCRLStore> getAdditionalStoresFromCRLDistributionPoint(CRLDistPoint crldp, PKIXExtendedBuilderParameters pkixParams) throws AnnotatedException
AnnotatedException
public static BigInteger getSerialNumber(Object cert)
protected static TrustAnchor findTrustAnchor(X509Certificate cert, Set trustAnchors) throws AnnotatedException
cert
- the X509 certificatetrustAnchors
- a Set of TrustAnchor'sTrustAnchor
object if found or
null
if not.AnnotatedException
- if a TrustAnchor was found but the signature verification
on the given certificate has thrown an exception.protected static TrustAnchor findTrustAnchor(X509Certificate cert, Set trustAnchors, String sigProvider) throws AnnotatedException
cert
- the X509 certificatetrustAnchors
- a Set of TrustAnchor'ssigProvider
- the provider to use for signature verificationTrustAnchor
object if found or
null
if not.AnnotatedException
- if a TrustAnchor was found but the signature verification
on the given certificate has thrown an exception.protected static Date getValidDate(PKIXExtendedParameters paramsPKIX)
protected static boolean isSelfIssued(X509Certificate cert)
protected static AlgorithmIdentifier getAlgorithmIdentifier(PublicKey key) throws CertPathValidatorException
CertPathValidatorException
protected static final Set getQualifierSet(ASN1Sequence qualifiers) throws CertPathValidatorException
CertPathValidatorException
protected static PKIXPolicyNode removePolicyNode(PKIXPolicyNode validPolicyTree, List[] policyNodes, PKIXPolicyNode _node)
protected static boolean processCertD1i(int index, List[] policyNodes, ASN1ObjectIdentifier pOid, Set pq)
protected static void processCertD1ii(int index, List[] policyNodes, ASN1ObjectIdentifier _poid, Set _pq)
protected static void prepareNextCertB1(int i, List[] policyNodes, String id_p, Map m_idp, X509Certificate cert) throws AnnotatedException, CertPathValidatorException
protected static PKIXPolicyNode prepareNextCertB2(int i, List[] policyNodes, String id_p, PKIXPolicyNode validPolicyTree)
protected static boolean isAnyPolicy(Set policySet)
protected static Collection findCertificates(PKIXCertStoreSelector certSelect, List certStores) throws AnnotatedException
certSelect
- a Selector
object that will be used to select
the certificatescertStores
- a List containing only Store
objects. These
are used to search for certificates.X509Certificate
May be empty but never null
.AnnotatedException
- annotated exceptionprotected static void getCRLIssuersFromDistributionPoint(DistributionPoint dp, Collection issuerPrincipals, X509CRLSelector selector) throws AnnotatedException
selector
.
The issuerPrincipals
are a collection with a single
X500Name
for X509Certificate
s.
dp
- The distribution point.issuerPrincipals
- The issuers of the certificate or attribute
certificate which contains the distribution point.selector
- The CRL selector.AnnotatedException
- if an exception occurs while processing.ClassCastException
- if issuerPrincipals
does not
contain only X500Name
s.protected static void getCertStatus(Date validDate, X509CRL crl, Object cert, eu.emi.security.authn.x509.helpers.pkipath.bc.CertStatus certStatus) throws AnnotatedException
AnnotatedException
protected static Set getDeltaCRLs(Date validityDate, X509CRL completeCRL, List<CertStore> certStores, List<PKIXCRLStore> pkixCrlStores) throws AnnotatedException
validityDate
- The date for which the delta CRLs must be valid.completeCRL
- The complete CRL the delta CRL is for.certStores
- a List
of certificate storespkixCrlStores
- a List
of CRL storesSet
of X509CRL
s with delta CRLs.AnnotatedException
- if an exception occurs while picking the delta
CRLs.protected static Date getValidCertDateFromValidityModel(PKIXExtendedParameters paramsPKIX, CertPath certPath, int index) throws AnnotatedException
AnnotatedException
protected static PublicKey getNextWorkingKey(List certs, int index, JcaJceHelper helper) throws CertPathValidatorException
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.
certs
- The certification path.index
- The index of the certificate which contains the public key
which should be extended with DSA parameters.helper
- JcaJce helperindex
extended with DSA parameters if applicable.CertPathValidatorException
- if DSA parameters cannot be inherited.protected static void verifyX509Certificate(X509Certificate cert, PublicKey publicKey, String sigProvider) throws GeneralSecurityException
GeneralSecurityException
Copyright © 2012-2017 European Middleware Initiative. All Rights Reserved.