public byte[] getExtensionValue(String oid) { Extension e = getExtension(new OID(oid)); if (e != null) { return e.getValue().getEncoded(); } return null; }
public Collection getIssuerAlternativeNames() throws CertificateParsingException { Extension e = getExtension(IssuerAlternativeNames.ID); if (e != null) { return ((IssuerAlternativeNames) e.getValue()).getNames(); } return null; }
public int getBasicConstraints() { Extension e = getExtension(BasicConstraints.ID); if (e != null) { return ((BasicConstraints) e.getValue()).getPathLengthConstraint(); } return -1; }
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; }
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; }