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