Extended maintenance of Ruby versions 1.8.7 and 1.9.2 ended on July 31, 2014. Read more

In Files

  • openssl/ossl_hmac.c

Parent

Class/Module Index [+]

Quicksearch

OpenSSL::OCSP::CertificateId

Public Class Methods

new(p1, p2) click to toggle source
 
               static VALUE
ossl_ocspcid_initialize(VALUE self, VALUE subject, VALUE issuer)
{
    OCSP_CERTID *id, *newid;
    X509 *x509s, *x509i;

    x509s = GetX509CertPtr(subject); /* NO NEED TO DUP */
    x509i = GetX509CertPtr(issuer); /* NO NEED TO DUP */
    if(!(newid = OCSP_cert_to_id(NULL, x509s, x509i)))
        ossl_raise(eOCSPError, NULL);
    GetOCSPCertId(self, id);
    OCSP_CERTID_free(id);
    RDATA(self)->data = newid;

    return self;
}
            

Public Instance Methods

cmp(p1) click to toggle source
 
               static VALUE
ossl_ocspcid_cmp(VALUE self, VALUE other)
{
    OCSP_CERTID *id, *id2;
    int result;

    GetOCSPCertId(self, id);
    SafeGetOCSPCertId(other, id2);
    result = OCSP_id_cmp(id, id2);

    return (result == 0) ? Qtrue : Qfalse;
}
            
cmp_issuer(p1) click to toggle source
 
               static VALUE
ossl_ocspcid_cmp_issuer(VALUE self, VALUE other)
{
    OCSP_CERTID *id, *id2;
    int result;

    GetOCSPCertId(self, id);
    SafeGetOCSPCertId(other, id2);
    result = OCSP_id_issuer_cmp(id, id2);

    return (result == 0) ? Qtrue : Qfalse;
}
            
serial() click to toggle source
 
               static VALUE
ossl_ocspcid_get_serial(VALUE self)
{
    OCSP_CERTID *id;

    GetOCSPCertId(self, id);

    return asn1integer_to_num(id->serialNumber);
}