public static DERObjectIdentifier decodeOIDDERObjectIdentifier(byte[] oid) throws IOException {
ByteArrayInputStream bIn = new ByteArrayInputStream(oid);
DERInputStream dIn = new DERInputStream(bIn);
return (DERObjectIdentifier) dIn.readObject();
}
public static byte[] encodeGeneralName(String name) throws IOException {
return encodeGeneralName(new X509Name(name));
}