Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →
instance method
OpenSSL::X509::Extension#value=
(::String | ::OpenSSL::ASN1::_ToDer data) -> ::String
value=(p1)
ext/openssl/ossl_x509ext.c
View on GitHub ↗
static VALUE
ossl_x509ext_set_value(VALUE self, VALUE data)
{
X509_EXTENSION *ext;
ASN1_OCTET_STRING *asn1s;
GetX509Ext(self, ext);
data = ossl_to_der_if_possible(data);
StringValue(data);
asn1s = ASN1_OCTET_STRING_new();
if (!asn1s)
ossl_raise(eX509ExtError, "ASN1_OCTET_STRING_new");
if (!ASN1_OCTET_STRING_set(asn1s, (unsigned char *)RSTRING_PTR(data),
RSTRING_LENINT(data))) {
ASN1_OCTET_STRING_free(asn1s);
ossl_raise(eX509ExtError, "ASN1_OCTET_STRING_set");
}
if (!X509_EXTENSION_set_data(ext, asn1s)) {
ASN1_OCTET_STRING_free(asn1s);
ossl_raise(eX509ExtError, "X509_EXTENSION_set_data");
}
ASN1_OCTET_STRING_free(asn1s);
return data;
}
No documentation available