End of Life Ruby 3.2 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
instance method
OpenSSL::OCSP::BasicResponse#find_response
basic_response.find_response(certificate_id) → SingleResponse | nil
ext/openssl/ossl_ocsp.c
View on GitHub ↗
static VALUE
ossl_ocspbres_find_response(VALUE self, VALUE target)
{
OCSP_BASICRESP *bs;
OCSP_SINGLERESP *sres, *sres_new;
OCSP_CERTID *id;
int n;
GetOCSPCertId(target, id);
GetOCSPBasicRes(self, bs);
if ((n = OCSP_resp_find(bs, id, -1)) == -1)
return Qnil;
sres = OCSP_resp_get0(bs, n);
sres_new = ASN1_item_dup(ASN1_ITEM_rptr(OCSP_SINGLERESP), sres);
if (!sres_new)
ossl_raise(eOCSPError, "ASN1_item_dup");
return ossl_ocspsres_new(sres_new);
}
Returns a SingleResponse whose CertId matches with certificate_id, or nil if this BasicResponse does not contain it.
See also
#copy_nonce
#initialize_copy
#add_status
#responses
also in
4.1 · 4.0 · 3.4 · 3.3 · 3.1 · 3.0