Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →
class method
OpenSSL::PKCS7.read_smime
(::String) -> instance
PKCS7.read_smime(string) => pkcs7
ext/openssl/ossl_pkcs7.c
View on GitHub ↗
static VALUE
ossl_pkcs7_s_read_smime(VALUE klass, VALUE arg)
{
BIO *in, *out;
PKCS7 *pkcs7;
VALUE ret, data;
ret = ossl_pkcs7_alloc(klass);
in = ossl_obj2bio(&arg);
out = NULL;
pkcs7 = SMIME_read_PKCS7(in, &out);
BIO_free(in);
if (!pkcs7)
ossl_raise(ePKCS7Error, "Could not parse the PKCS7");
if (!pkcs7->d.ptr) {
PKCS7_free(pkcs7);
ossl_raise(ePKCS7Error, "No content in PKCS7");
}
RTYPEDDATA_DATA(ret) = pkcs7;
data = out ? ossl_membio2str(out) : Qnil;
ossl_pkcs7_set_data(ret, data);
ossl_pkcs7_set_err_string(ret, Qnil);
return ret;
}
No documentation available