Search in sources :

Example 1 with X509Extension

use of org.jruby.ext.openssl.X509Extension in project jruby-openssl by jruby.

the class X509ExtensionFactory method parseIssuerAltName.

private ASN1Encodable parseIssuerAltName(final ThreadContext context, final String valuex) throws IOException {
    if (valuex.startsWith("issuer:copy")) {
        RubyArray exts = (RubyArray) getInstanceVariable("@issuer_certificate").callMethod(context, "extensions");
        for (int i = 0; i < exts.size(); i++) {
            X509Extension ext = (X509Extension) exts.entry(i);
            final String oid = ext.getRealObjectID().getId();
            if ("2.5.29.17".equals(oid))
                return ext.getRealValue();
        }
    }
    throw new IOException("Malformed IssuerAltName: " + valuex);
}
Also used : RubyArray(org.jruby.RubyArray) X509Extension(org.jruby.ext.openssl.X509Extension) RubyString(org.jruby.RubyString) IOException(java.io.IOException)

Aggregations

IOException (java.io.IOException)1 RubyArray (org.jruby.RubyArray)1 RubyString (org.jruby.RubyString)1 X509Extension (org.jruby.ext.openssl.X509Extension)1