method
value
v2_1_10 -
Show latest stable
-
0 notes -
Class: Attribute
- 1_8_6_287
- 1_8_7_72
- 1_8_7_330
- 1_9_1_378 (0)
- 1_9_2_180 (0)
- 1_9_3_125 (0)
- 1_9_3_392 (0)
- 2_1_10 (0)
- 2_2_9 (0)
- 2_4_6 (0)
- 2_5_5 (0)
- 2_6_3 (0)
- What's this?
value()
public
Hide source
static VALUE ossl_x509attr_get_value(VALUE self) { X509_ATTRIBUTE *attr; VALUE str, asn1; long length; unsigned char *p; GetX509Attr(self, attr); if(attr->value.ptr == NULL) return Qnil; if(OSSL_X509ATTR_IS_SINGLE(attr)){ length = i2d_ASN1_TYPE(attr->value.single, NULL); str = rb_str_new(0, length); p = (unsigned char *)RSTRING_PTR(str); i2d_ASN1_TYPE(attr->value.single, &p); ossl_str_adjust(str, p); } else{ length = i2d_ASN1_SET_OF_ASN1_TYPE(attr->value.set, (unsigned char **) NULL, i2d_ASN1_TYPE, V_ASN1_SET, V_ASN1_UNIVERSAL, 0); str = rb_str_new(0, length); p = (unsigned char *)RSTRING_PTR(str); i2d_ASN1_SET_OF_ASN1_TYPE(attr->value.set, &p, i2d_ASN1_TYPE, V_ASN1_SET, V_ASN1_UNIVERSAL, 0); ossl_str_adjust(str, p); } asn1 = rb_funcall(mASN1, rb_intern("decode"), 1, str); return asn1; }