U:RDoc::NormalClass[iI" ASN1Data:ETI"OpenSSL::ASN1::ASN1Data;TI" Object;To:RDoc::Markup::Document: @parts[o;;[o:RDoc::Markup::Paragraph;[I"GThe top-level class representing any ASN.1 object. When parsed by ;TI"FASN1.decode, tagged values are always represented by an instance ;TI"of ASN1Data.;To:RDoc::Markup::BlankLineS:RDoc::Markup::Heading: leveli: textI"3The role of ASN1Data for parsing tagged values;T@o; ;[ I"FWhen encoding an ASN.1 type it is inherently clear what original ;TI"Gtype (e.g. INTEGER, OCTET STRING etc.) this value has, regardless ;TI"of its tagging. ;TI"JBut opposed to the time an ASN.1 type is to be encoded, when parsing ;TI"Athem it is not possible to deduce the "real type" of tagged ;TI"Jvalues. This is why tagged values are generally parsed into ASN1Data ;TI"Ginstances, but with a different outcome for implicit and explicit ;TI" tagging.;T@S; ; i; I"0Example of a parsed implicitly tagged value;T@o; ;[I"?An implicitly 1-tagged INTEGER value will be parsed as an ;TI"ASN1Data with;To:RDoc::Markup::List: @type: BULLET: @items[o:RDoc::Markup::ListItem: @label0;[o; ;[I"+tag+ equal to 1;To;;0;[o; ;[I"-+tag_class+ equal to +:CONTEXT_SPECIFIC+;To;;0;[o; ;[I"?+value+ equal to a +String+ that carries the raw encoding ;TI"of the INTEGER.;To; ;[I"AThis implies that a subsequent decoding step is required to ;TI"0completely decode implicitly tagged values.;T@S; ; i; I"0Example of a parsed explicitly tagged value;T@o; ;[I"?An explicitly 1-tagged INTEGER value will be parsed as an ;TI"ASN1Data with;To;;;;[o;;0;[o; ;[I"+tag+ equal to 1;To;;0;[o; ;[I"-+tag_class+ equal to +:CONTEXT_SPECIFIC+;To;;0;[o; ;[ I"=+value+ equal to an +Array+ with one single element, an ;TI"@instance of OpenSSL::ASN1::Integer, i.e. the inner element ;TI"Gis the non-tagged primitive value, and the tagging is represented ;TI"in the outer ASN1Data;T@S; ; i; I"4Example - Decoding an implicitly tagged INTEGER;To:RDoc::Markup::Verbatim;[I"Kint = OpenSSL::ASN1::Integer.new(1, 0, :IMPLICIT) # implicit 0-tagged ;TI"0seq = OpenSSL::ASN1::Sequence.new( [int] ) ;TI"der = seq.to_der ;TI"&asn1 = OpenSSL::ASN1.decode(der) ;TI"6# pp asn1 => #]> ;TI"raw_int = asn1.value[0] ;TI"H# manually rewrite tag and tag class to make it an UNIVERSAL value ;TI"*raw_int.tag = OpenSSL::ASN1::INTEGER ;TI"$raw_int.tag_class = :UNIVERSAL ;TI"*int2 = OpenSSL::ASN1.decode(raw_int) ;TI"puts int2.value # => 1 ;T: @format0S; ; i; I"4Example - Decoding an explicitly tagged INTEGER;To;;[I"Kint = OpenSSL::ASN1::Integer.new(1, 0, :EXPLICIT) # explicit 0-tagged ;TI"0seq = OpenSSL::ASN1::Sequence.new( [int] ) ;TI"der = seq.to_der ;TI"&asn1 = OpenSSL::ASN1.decode(der) ;TI"6# pp asn1 => #]>]> ;TI"#int2 = asn1.value[0].value[0] ;TI"puts int2.value # => 1;T;0: @fileI"ext/openssl/ossl_asn1.c;T:0@omit_headings_from_table_of_contents_below0;0;0[ [ I"infinite_length;TI"RW;T: publicFI"ext/openssl/ossl_asn1.c;T[ I"tag;TI"RW;T;F@Š[ I"tag_class;TI"RW;T;F@Š[ I" value;TI"RW;T;F@Š[[[[I" class;T[[;[[I"new;T@Š[:protected[[: private[[I" instance;T[[;[[I" to_der;T@Š[;[[;[[[U:RDoc::Context::Section[i0o;;[;0;0[@…I"OpenSSL::ASN1;TcRDoc::NormalModule