End of Life Ruby 3.2 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
instance method
OpenSSL::Timestamp::Request#to_der
request.to_der → DER-encoded string
ext/openssl/ossl_ts.c
View on GitHub ↗
static VALUE
ossl_ts_req_to_der(VALUE self)
{
TS_REQ *req;
TS_MSG_IMPRINT *mi;
X509_ALGOR *algo;
ASN1_OCTET_STRING *hashed_msg;
GetTSRequest(self, req);
mi = TS_REQ_get_msg_imprint(req);
algo = TS_MSG_IMPRINT_get_algo(mi);
if (OBJ_obj2nid(algo->algorithm) == NID_undef)
ossl_raise(eTimestampError, "Message imprint missing algorithm");
hashed_msg = TS_MSG_IMPRINT_get_msg(mi);
if (!hashed_msg->length)
ossl_raise(eTimestampError, "Message imprint missing hashed message");
return asn1_to_der((void *)req, (int (*)(void *, unsigned char **))i2d_TS_REQ);
}
DER-encodes this Request.