Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →
class method
OpenSSL::Timestamp::Response.new
(::File | ::String response_der) -> ::OpenSSL::Timestamp::Response
OpenSSL::Timestamp::Response.new(file) → response
OpenSSL::Timestamp::Response.new(string) → response
ext/openssl/ossl_ts.c
View on GitHub ↗
static VALUE
ossl_ts_resp_initialize(VALUE self, VALUE der)
{
TS_RESP *resp;
BIO *in;
ossl_want_uninitialized(self, &ossl_ts_resp_type);
der = ossl_to_der_if_possible(der);
in = ossl_obj2bio(&der);
resp = d2i_TS_RESP_bio(in, NULL);
BIO_free(in);
if (!resp) {
ossl_raise(eTimestampError,
"Error when decoding the timestamp response");
}
RTYPEDDATA_DATA(self) = resp;
return self;
}