Flowdock
new(p1 = v1) public

No documentation

This method has no description. You can help the Ruby community by adding new notes.

Hide source
static VALUE
ossl_x509_initialize(int argc, VALUE *argv, VALUE self)
{
    BIO *in;
    X509 *x509, *x = DATA_PTR(self);
    VALUE arg;

    if (rb_scan_args(argc, argv, "01", &arg) == 0) {
        /* create just empty X509Cert */
        return self;
    }
    arg = ossl_to_der_if_possible(arg);
    in = ossl_obj2bio(&arg);
    x509 = PEM_read_bio_X509(in, &x, NULL, NULL);
    DATA_PTR(self) = x;
    if (!x509) {
        OSSL_BIO_reset(in);
        x509 = d2i_X509_bio(in, &x);
        DATA_PTR(self) = x;
    }
    BIO_free(in);
    if (!x509) ossl_raise(eX509CertError, NULL);

    return self;
}
Register or log in to add new notes.