Method: OpenSSL::OCSP::SingleResponse#cert_status

Defined in:
ossl_ocsp.c

#cert_statusInteger

Returns the status of the certificate identified by the certid. The return value may be one of these constant:

  • V_CERTSTATUS_GOOD

  • V_CERTSTATUS_REVOKED

  • V_CERTSTATUS_UNKNOWN

When the status is V_CERTSTATUS_REVOKED, the time at which the certificate was revoked can be retrieved by #revocation_time.

Returns:


1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
# File 'ossl_ocsp.c', line 1254

static VALUE
ossl_ocspsres_get_cert_status(VALUE self)
{
    OCSP_SINGLERESP *sres;
    int status;

    GetOCSPSingleRes(self, sres);
    status = OCSP_single_get0_status(sres, NULL, NULL, NULL, NULL);
    if (status < 0)
	ossl_raise(eOCSPError, "OCSP_single_get0_status");

    return INT2NUM(status);
}