⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.133
Server IP:
185.119.109.197
Server:
Linux managedhosting.chostar.me 5.15.0-160-generic #170-Ubuntu SMP Wed Oct 1 10:06:56 UTC 2025 x86_64
Server Software:
Apache
PHP Version:
8.1.33
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
usr
/
share
/
ri
/
3.0.0
/
system
/
OpenSSL
/
ASN1
/
ASN1Data
/
View File Name :
cdesc-ASN1Data.ri
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::BlankLine S: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"indefinite_length;TI"RW;T:publicFI"ext/openssl/ossl_asn1.c;T[ I"infinite_length;T@‰;F@Š[ I"tag;T@‰;F@Š[ I"tag_class;T@‰;F@Š[ I" value;T@‰;F@Š[ [ [[I" class;T[[;[[I"new;T@Š[:protected[ [:private[ [I" instance;T[[;[[I"to_der;T@Š[;[ [;[ [ [U:RDoc::Context::Section[i 0o;;[ ;0;0[@…I"OpenSSL::ASN1;TcRDoc::NormalModule