protected static void addAdditionalStoresFromCRLDistributionPoint(
     CRLDistPoint crldp, ExtendedPKIXParameters pkixParams) throws AnnotatedException {
   if (crldp != null) {
     DistributionPoint dps[] = null;
     try {
       dps = crldp.getDistributionPoints();
     } catch (Exception e) {
       throw new AnnotatedException("Distribution points could not be read.", e);
     }
     for (int i = 0; i < dps.length; i++) {
       DistributionPointName dpn = dps[i].getDistributionPoint();
       // look for URIs in fullName
       if (dpn != null) {
         if (dpn.getType() == DistributionPointName.FULL_NAME) {
           GeneralName[] genNames = GeneralNames.getInstance(dpn.getName()).getNames();
           // look for an URI
           for (int j = 0; j < genNames.length; j++) {
             if (genNames[j].getTagNo() == GeneralName.uniformResourceIdentifier) {
               String location = DERIA5String.getInstance(genNames[j].getName()).getString();
               CertPathValidatorUtilities.addAdditionalStoreFromLocation(location, pkixParams);
             }
           }
         }
       }
     }
   }
 }
Пример #2
0
 public static LogotypeReference getInstance(ASN1Sequence seq) {
   ASN1Sequence refStructHashSeq = null;
   ASN1Sequence refStructURISeq = null;
   if (seq.size() != 2) {
     throw new IllegalArgumentException("size of sequence must be 2 not " + seq.size());
   }
   refStructHashSeq = ASN1Sequence.getInstance(seq.getObjectAt(0));
   refStructURISeq = ASN1Sequence.getInstance(seq.getObjectAt(1));
   DigestInfo[] refStructHash = null;
   DERIA5String[] refStructURI = null;
   {
     Vector<DigestInfo> v = new Vector<DigestInfo>();
     for (int i = 0; i < refStructHashSeq.size(); i++) {
       DigestInfo di = DigestInfo.getInstance(refStructHashSeq.getObjectAt(i));
       v.add(di);
     }
     refStructHash = v.toArray(new DigestInfo[refStructHashSeq.size()]);
   }
   {
     Vector<DERIA5String> v = new Vector<DERIA5String>();
     for (int i = 0; i < refStructURISeq.size(); i++) {
       DERIA5String di = DERIA5String.getInstance(refStructURISeq.getObjectAt(i));
       v.add(di);
     }
     refStructHash = v.toArray(new DigestInfo[refStructURISeq.size()]);
   }
   return new LogotypeReference(refStructHash, refStructURI);
 }