public String getSigAlgOID() { if (sigAlgId == null) { return null; } ObjectIdentifier oid = sigAlgId.getOID(); return oid.toString(); }
public String toString() { String s = "ObjectId: " + extensionId.toString(); if (critical) { s += " Criticality=true\n"; } else { s += " Criticality=false\n"; } return (s); }
public int hashCode() { int h = 0; if (extensionValue != null) { byte[] val = extensionValue; int len = val.length; while (len > 0) { h += len * val[--len]; } } h = h * hashMagic + extensionId.hashCode(); h = h * hashMagic + (critical ? 1231 : 1237); return h; }
public byte[] getExtensionValue(String oid) { if (extensions == null) { return null; } try { String extAlias = OIDMap.getName(new ObjectIdentifier(oid)); Extension crlExt = null; if (extAlias == null) { ObjectIdentifier findOID = new ObjectIdentifier(oid); Extension ex = null; ObjectIdentifier inCertOID; for (Enumeration<Extension> e = extensions.getElements(); e.hasMoreElements(); ) { ex = e.nextElement(); inCertOID = ex.getExtensionId(); if (inCertOID.equals((Object) findOID)) { crlExt = ex; break; } } } else { crlExt = extensions.get(extAlias); } if (crlExt == null) { return null; } byte[] extData = crlExt.getExtensionValue(); if (extData == null) { return null; } DerOutputStream out = new DerOutputStream(); out.putOctetString(extData); return out.toByteArray(); } catch (Exception e) { return null; } }
public boolean equals(Object other) { if (this == other) { return true; } if (!(other instanceof Extension)) { return false; } Extension otherExt = (Extension) other; if (critical != otherExt.critical) { return false; } if (!extensionId.equals((Object) otherExt.extensionId)) { return false; } return Arrays.equals(extensionValue, otherExt.extensionValue); }
public String getId() { return extensionId.toString(); }