Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →
class method
OpenSSL::OCSP::SingleResponse.new
(::String der) -> ::OpenSSL::OCSP::SingleResponse
OpenSSL::OCSP::SingleResponse.new(der_string) → SingleResponse
ext/openssl/ossl_ocsp.c
View on GitHub ↗
static VALUE
ossl_ocspsres_initialize(VALUE self, VALUE arg)
{
OCSP_SINGLERESP *sres_new;
const unsigned char *p;
ossl_want_uninitialized(self, &ossl_ocsp_singleresp_type);
arg = ossl_to_der_if_possible(arg);
StringValue(arg);
p = (unsigned char*)RSTRING_PTR(arg);
sres_new = d2i_OCSP_SINGLERESP(NULL, &p, rb_len2long(RSTRING_LEN(arg)));
if (!sres_new)
ossl_raise(eOCSPError, "d2i_OCSP_SINGLERESP");
RTYPEDDATA_DATA(self) = sres_new;
return self;
}
Creates a new SingleResponse from der_string.