コード例 #1
0
 public byte[] getExtensionValue(String oid) {
   Extension e = getExtension(new OID(oid));
   if (e != null) {
     return e.getValue().getEncoded();
   }
   return null;
 }
コード例 #2
0
 public Collection getIssuerAlternativeNames() throws CertificateParsingException {
   Extension e = getExtension(IssuerAlternativeNames.ID);
   if (e != null) {
     return ((IssuerAlternativeNames) e.getValue()).getNames();
   }
   return null;
 }
コード例 #3
0
 public int getBasicConstraints() {
   Extension e = getExtension(BasicConstraints.ID);
   if (e != null) {
     return ((BasicConstraints) e.getValue()).getPathLengthConstraint();
   }
   return -1;
 }
コード例 #4
0
 public boolean[] getKeyUsage() {
   Extension e = getExtension(KeyUsage.ID);
   if (e != null) {
     KeyUsage ku = (KeyUsage) e.getValue();
     boolean[] result = new boolean[9];
     boolean[] b = ku.getKeyUsage().toBooleanArray();
     System.arraycopy(b, 0, result, 0, b.length);
     return result;
   }
   return null;
 }
コード例 #5
0
 public List getExtendedKeyUsage() throws CertificateParsingException {
   Extension e = getExtension(ExtendedKeyUsage.ID);
   if (e != null) {
     List a = ((ExtendedKeyUsage) e.getValue()).getPurposeIds();
     List b = new ArrayList(a.size());
     for (Iterator it = a.iterator(); it.hasNext(); ) {
       b.add(it.next().toString());
     }
     return Collections.unmodifiableList(b);
   }
   return null;
 }