arg = OpenSSLImpl.to_der_if_possible(arg);
BIO input = obj2bio(arg);
try {
p7 = org.jruby.ext.openssl.impl.PKCS7.readPEM(input);
if (p7 == null) {
input.reset();
p7 = org.jruby.ext.openssl.impl.PKCS7.fromASN1(input);
}
} catch (IOException ioe) {
throw newPKCS7Error(getRuntime(), ioe.getMessage());
} catch (PKCS7Exception pkcs7e) {