static URI getResponderURI(X509CertImpl certImpl) { // Examine the certificate's AuthorityInfoAccess extension AuthorityInfoAccessExtension aia = certImpl.getAuthorityInfoAccessExtension(); if (aia == null) { return null; } List<AccessDescription> descriptions = aia.getAccessDescriptions(); for (AccessDescription description : descriptions) { if (description.getAccessMethod().equals((Object) AccessDescription.Ad_OCSP_Id)) { GeneralName generalName = description.getAccessLocation(); if (generalName.getType() == GeneralNameInterface.NAME_URI) { URIName uri = (URIName) generalName.getName(); return uri.getURI(); } } } return null; }
/** * Creates a CertStore from information included in the AccessDescription * object of a certificate's Authority Information Access Extension. */ static CertStore getInstance(AccessDescription ad) { if (!ad.getAccessMethod().equals((Object) AccessDescription.Ad_CAISSUERS_Id)) { return null; } GeneralNameInterface gn = ad.getAccessLocation().getName(); if (!(gn instanceof URIName)) { return null; } URI uri = ((URIName) gn).getURI(); try { return URICertStore.getInstance (new URICertStore.URICertStoreParameters(uri)); } catch (Exception ex) { if (debug != null) { debug.println("exception creating CertStore: " + ex); ex.printStackTrace(); } return null; } }
/** * Initialize the state. * * @param certPathCheckers the list of user-defined PKIXCertPathCheckers */ public void initState(List<PKIXCertPathChecker> certPathCheckers) throws CertPathValidatorException { subjectNamesTraversed = new HashSet<GeneralNameInterface>(); traversedCACerts = 0; /* * Populate forwardCheckers with every user-defined checker * that supports forward checking and initialize the forwardCheckers */ forwardCheckers = new ArrayList<PKIXCertPathChecker>(); for (PKIXCertPathChecker checker : certPathCheckers) { if (checker.isForwardCheckingSupported()) { checker.init(true); forwardCheckers.add(checker); } } init = true; }
static URI getResponderURI(X509CertImpl certImpl) { // Examine the certificate's AuthorityInfoAccess extension AuthorityInfoAccessExtension aia = certImpl.getAuthorityInfoAccessExtension(); if (aia == null) { return null; } List<AccessDescription> descriptions = aia.getAccessDescriptions(); for (AccessDescription description : descriptions) { if (description.getAccessMethod().equals( AccessDescription.Ad_OCSP_Id)) { GeneralName generalName = description.getAccessLocation(); if (generalName.getType() == GeneralNameInterface.NAME_URI) { URIName uri = (URIName) generalName.getName(); return uri.getURI(); } } } return null; }
/** * Creates a CertStore from information included in the AccessDescription * object of a certificate's Authority Information Access Extension. */ static CertStore getInstance(AccessDescription ad) { if (!ad.getAccessMethod().equals( AccessDescription.Ad_CAISSUERS_Id)) { return null; } GeneralNameInterface gn = ad.getAccessLocation().getName(); if (!(gn instanceof URIName)) { return null; } URI uri = ((URIName) gn).getURI(); try { return URICertStore.getInstance(new URICertStoreParameters(uri)); } catch (Exception ex) { if (debug != null) { debug.println("exception creating CertStore: " + ex); ex.printStackTrace(); } return null; } }
/** * Creates a CertStore from information included in the AccessDescription * object of a certificate's Authority Information Access Extension. */ static CertStore getInstance(AccessDescription ad) { if (!ad.getAccessMethod().equals(AccessDescription.Ad_CAISSUERS_Id)) { return null; } GeneralNameInterface gn = ad.getAccessLocation().getName(); if (!(gn instanceof URIName)) { return null; } URI uri = ((URIName) gn).getURI(); try { return URICertStore.getInstance (new URICertStore.URICertStoreParameters(uri)); } catch (Exception ex) { if (debug != null) { debug.println("exception creating CertStore: " + ex); ex.printStackTrace(); } return null; } }
/** * Initialize the state. * * @param certPathCheckers the list of user-defined PKIXCertPathCheckers */ public void initState(List<PKIXCertPathChecker> certPathCheckers) throws CertPathValidatorException { subjectNamesTraversed = new HashSet<GeneralNameInterface>(); traversedCACerts = 0; /* * Populate forwardCheckers with every user-defined checker * that supports forward checking and initialize the forwardCheckers */ forwardCheckers = new ArrayList<PKIXCertPathChecker>(); if (certPathCheckers != null) { for (PKIXCertPathChecker checker : certPathCheckers) { if (checker.isForwardCheckingSupported()) { checker.init(true); forwardCheckers.add(checker); } } } init = true; }
@Override @SuppressWarnings("unchecked") // Safe casts assuming clone() works correctly public Object clone() { try { ForwardState clonedState = (ForwardState) super.clone(); /* clone checkers, if cloneable */ clonedState.forwardCheckers = (ArrayList<PKIXCertPathChecker>) forwardCheckers.clone(); ListIterator<PKIXCertPathChecker> li = clonedState.forwardCheckers.listIterator(); while (li.hasNext()) { PKIXCertPathChecker checker = li.next(); if (checker instanceof Cloneable) { li.set((PKIXCertPathChecker)checker.clone()); } } /* * Shallow copy traversed names. There is no need to * deep copy contents, since the elements of the Set * are never modified by subsequent calls to updateState(). */ clonedState.subjectNamesTraversed = (HashSet<GeneralNameInterface>)subjectNamesTraversed.clone(); return clonedState; } catch (CloneNotSupportedException e) { throw new InternalError(e.toString(), e); } }