method
decode
v1_9_1_378 -
Show latest stable
- Class:
OpenSSL::ASN1
decode(p1)public
No documentation available.
static VALUE
ossl_asn1_decode(VALUE self, VALUE obj)
{
VALUE ret, ary;
unsigned char *p;
long offset = 0;
volatile VALUE tmp;
obj = ossl_to_der_if_possible(obj);
tmp = rb_str_new4(StringValue(obj));
p = (unsigned char *)RSTRING_PTR(tmp);
ary = ossl_asn1_decode0(&p, RSTRING_LEN(tmp), &offset, 0, 1, 0);
ret = rb_ary_entry(ary, 0);
return ret;
}