Skip to content

Commit ecc1a05

Browse files
committed
allow for X509::Certificate to be converted to a Java certificate
1 parent 9482dd8 commit ecc1a05

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/main/java/org/jruby/ext/openssl/X509Cert.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -737,4 +737,13 @@ private static GeneralName[] extRealNames(final X509Extension extension) throws
737737
return GeneralNames.getInstance( value ).getNames();
738738
}
739739

740+
@Override
741+
public Object toJava(Class target) {
742+
if ( target.isAssignableFrom(X509Certificate.class) ) {
743+
if ( target == X509AuxCertificate.class ) return getAuxCert();
744+
return cert;
745+
}
746+
return super.toJava(target);
747+
}
748+
740749
}// X509Cert

0 commit comments

Comments
 (0)