Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →
class method
OpenSSL::OCSP::Response.new
(?::String der) -> ::OpenSSL::OCSP::Response
OpenSSL::OCSP::Response.new → response
OpenSSL::OCSP::Response.new(response_der) → response
ext/openssl/ossl_ocsp.c
View on GitHub ↗
static VALUE
ossl_ocspres_initialize(int argc, VALUE *argv, VALUE self)
{
VALUE arg;
OCSP_RESPONSE *res_new;
const unsigned char *p;
rb_scan_args(argc, argv, "01", &arg);
ossl_want_uninitialized(self, &ossl_ocsp_response_type);
if (NIL_P(arg)) {
res_new = OCSP_RESPONSE_new();
if (!res_new)
ossl_raise(eOCSPError, "OCSP_RESPONSE_new");
}
else {
arg = ossl_to_der_if_possible(arg);
StringValue(arg);
p = (unsigned char *)RSTRING_PTR(arg);
res_new = d2i_OCSP_RESPONSE(NULL, &p, rb_len2long(RSTRING_LEN(arg)));
if (!res_new)
ossl_raise(eOCSPError, "d2i_OCSP_RESPONSE");
}
RTYPEDDATA_DATA(self) = res_new;
return self;
}
Creates a new OpenSSL::OCSP::Response. The response may be created empty or from a response_der string.