End of Life Ruby 3.0 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
instance method
OpenSSL::X509::Attribute#to_der
attr.to_der => string
ext/openssl/ossl_x509attr.c
View on GitHub ↗
static VALUE
ossl_x509attr_to_der(VALUE self)
{
X509_ATTRIBUTE *attr;
VALUE str;
int len;
unsigned char *p;
GetX509Attr(self, attr);
if((len = i2d_X509_ATTRIBUTE(attr, NULL)) <= 0)
ossl_raise(eX509AttrError, NULL);
str = rb_str_new(0, len);
p = (unsigned char *)RSTRING_PTR(str);
if(i2d_X509_ATTRIBUTE(attr, &p) <= 0)
ossl_raise(eX509AttrError, NULL);
ossl_str_adjust(str, p);
return str;
}
No documentation available