Class: OpenSSL::X509::Revoked (Ruby 2.3.2)
Description: Class : OpenSSL::X509::Revoked - Ruby 2.3.2

- Home
- Core 2.3.2
- Std-lib 2.3.2
- Downloads

Support for the Ruby 2.3 series has ended. See here for reference.

### Home Classes Methods

### In Files

- openssl/ossl_ssl_session.c

### Parent

Object

### Methods

- ::new
- #add_extension
- #extensions
- #extensions=
- #serial
- #serial=
- #time
- #time=

### Class/Module Index

Quicksearch

- Integer
- OpenSSL::ASN1
- OpenSSL::ASN1::ASN1Data
- OpenSSL::ASN1::ASN1Error
- OpenSSL::ASN1::Constructive
- OpenSSL::ASN1::ObjectId
- OpenSSL::ASN1::Primitive
- OpenSSL::BN
- OpenSSL::BNError
- OpenSSL::Buffering
- OpenSSL::Cipher
- OpenSSL::Cipher::Cipher
- OpenSSL::Cipher::CipherError
- OpenSSL::Config
- OpenSSL::ConfigError
- OpenSSL::Digest
- OpenSSL::Digest::DigestError
- OpenSSL::Engine
- OpenSSL::Engine::EngineError
- OpenSSL::ExtConfig
- OpenSSL::HMAC
- OpenSSL::HMACError
- OpenSSL::Netscape
- OpenSSL::Netscape::SPKI
- OpenSSL::Netscape::SPKIError
- OpenSSL::OCSP
- OpenSSL::OCSP::BasicResponse
- OpenSSL::OCSP::CertificateId
- OpenSSL::OCSP::OCSPError
- OpenSSL::OCSP::Request
- OpenSSL::OCSP::Response
- OpenSSL::OpenSSLError
- OpenSSL::PKCS12
- OpenSSL::PKCS12::PKCS12Error
- OpenSSL::PKCS5
- OpenSSL::PKCS5::PKCS5Error
- OpenSSL::PKCS7
- OpenSSL::PKCS7::PKCS7Error
- OpenSSL::PKCS7::RecipientInfo
- OpenSSL::PKCS7::SignerInfo
- OpenSSL::PKey
- OpenSSL::PKey::DH
- OpenSSL::PKey::DHError
- OpenSSL::PKey::DSA
- OpenSSL::PKey::DSAError
- OpenSSL::PKey::EC
- OpenSSL::PKey::EC::Group
- OpenSSL::PKey::EC::Group::Error
- OpenSSL::PKey::EC::Point
- OpenSSL::PKey::EC::Point::Error
- OpenSSL::PKey::ECError
- OpenSSL::PKey::PKey
- OpenSSL::PKey::PKeyError
- OpenSSL::PKey::RSA
- OpenSSL::PKey::RSAError
- OpenSSL::Random
- OpenSSL::Random::RandomError
- OpenSSL::SSL
- OpenSSL::SSL::SSLContext
- OpenSSL::SSL::SSLContext::ExtConfig
- OpenSSL::SSL::SSLError
- OpenSSL::SSL::SSLErrorWaitReadable
- OpenSSL::SSL::SSLErrorWaitWritable
- OpenSSL::SSL::SSLServer
- OpenSSL::SSL::SSLSocket
- OpenSSL::SSL::SSLSocket::ExtConfig
- OpenSSL::SSL::Session
- OpenSSL::SSL::Session::SessionError
- OpenSSL::SSL::SocketForwarder
- OpenSSL::X509
- OpenSSL::X509::Attribute
- OpenSSL::X509::AttributeError
- OpenSSL::X509::CRL
- OpenSSL::X509::CRLError
- OpenSSL::X509::Certificate
- OpenSSL::X509::CertificateError
- OpenSSL::X509::Extension
- OpenSSL::X509::ExtensionError
- OpenSSL::X509::ExtensionFactory
- OpenSSL::X509::Name
- OpenSSL::X509::Name::RFC2253DN
- OpenSSL::X509::NameError
- OpenSSL::X509::Request
- OpenSSL::X509::RequestError
- OpenSSL::X509::Revoked
- OpenSSL::X509::RevokedError
- OpenSSL::X509::Store
- OpenSSL::X509::StoreContext
- OpenSSL::X509::StoreError
- unknown

No matching classes.

# OpenSSL::X509::Revoked

### Public Class Methods

new(*args) click to toggle source

                   static VALUE
    ossl_x509revoked_initialize(int argc, VALUE *argv, VALUE self)
    {
        /* EMPTY */
        return self;
    }

### Public Instance Methods

add_extension(p1) click to toggle source

                   static VALUE
    ossl_x509revoked_add_extension(VALUE self, VALUE ext)
    {
        X509_REVOKED *rev;

        GetX509Rev(self, rev);
        if (!X509_REVOKED_add_ext(rev, GetX509ExtPtr(ext), -1)) {
            ossl_raise(eX509RevError, NULL);
        }

        return ext;
    }

extensions() click to toggle source

Gets X509v3 extensions as array of X509Ext objects

                   static VALUE
    ossl_x509revoked_get_extensions(VALUE self)
    {
        X509_REVOKED *rev;
        int count, i;
        X509_EXTENSION *ext;
        VALUE ary;

        GetX509Rev(self, rev);
        count = X509_REVOKED_get_ext_count(rev);
        if (count < 0) {
            OSSL_Debug("count < 0???");
            return rb_ary_new();
        }
        ary = rb_ary_new2(count);
        for (i=0; i<count; i++) {
            ext = X509_REVOKED_get_ext(rev, i);
            rb_ary_push(ary, ossl_x509ext_new(ext));
        }

        return ary;
    }

extensions=(p1) click to toggle source

Sets X509_EXTENSIONs

                   static VALUE
    ossl_x509revoked_set_extensions(VALUE self, VALUE ary)
    {
        X509_REVOKED *rev;
        X509_EXTENSION *ext;
        long i;
        VALUE item;

        Check_Type(ary, T_ARRAY);
        for (i=0; i<RARRAY_LEN(ary); i++) {
            OSSL_Check_Kind(RARRAY_AREF(ary, i), cX509Ext);
        }
        GetX509Rev(self, rev);
        sk_X509_EXTENSION_pop_free(rev->extensions, X509_EXTENSION_free);
        rev->extensions = NULL;
        for (i=0; i<RARRAY_LEN(ary); i++) {
            item = RARRAY_AREF(ary, i);
            ext = GetX509ExtPtr(item);
            if(!X509_REVOKED_add_ext(rev, ext, -1)) {
                ossl_raise(eX509RevError, NULL);
            }
        }

        return ary;
    }

serial() click to toggle source

                   static VALUE
    ossl_x509revoked_get_serial(VALUE self)
    {
        X509_REVOKED *rev;

        GetX509Rev(self, rev);

        return asn1integer_to_num(rev->serialNumber);
    }

serial=(p1) click to toggle source

                   static VALUE
    ossl_x509revoked_set_serial(VALUE self, VALUE num)
    {
        X509_REVOKED *rev;

        GetX509Rev(self, rev);
        rev->serialNumber = num_to_asn1integer(num, rev->serialNumber);

        return num;
    }

time() click to toggle source

                   static VALUE
    ossl_x509revoked_get_time(VALUE self)
    {
        X509_REVOKED *rev;

        GetX509Rev(self, rev);

        return asn1time_to_time(rev->revocationDate);
    }

time=(p1) click to toggle source

                   static VALUE
    ossl_x509revoked_set_time(VALUE self, VALUE time)
    {
        X509_REVOKED *rev;
        time_t sec;

        sec = time_to_time_t(time);
        GetX509Rev(self, rev);
        if (!X509_time_adj(rev->revocationDate, 0, &sec)) {
            ossl_raise(eX509RevError, NULL);
        }

        return time;
    }