Method: OpenSSL::ASN1.decode
- Defined in:
- ossl_asn1.c
.OpenSSL::ASN1.decode(der) ⇒ ASN1Data
981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 |
# File 'ossl_asn1.c', line 981
static VALUE
ossl_asn1_decode(VALUE self, VALUE obj)
{
VALUE ret;
unsigned char *p;
VALUE tmp;
long len, read = 0, offset = 0;
obj = ossl_to_der_if_possible(obj);
tmp = rb_str_new4(StringValue(obj));
p = (unsigned char *)RSTRING_PTR(tmp);
len = RSTRING_LEN(tmp);
ret = ossl_asn1_decode0(&p, len, &offset, 0, 0, &read);
RB_GC_GUARD(tmp);
int_ossl_decode_sanity_check(len, read, offset);
return ret;
}
|