⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.25
Server IP:
109.199.105.153
Server:
Linux connect.inboxifs.com 5.15.0-152-generic #162-Ubuntu SMP Wed Jul 23 09:48:42 UTC 2025 x86_64
Server Software:
Apache
PHP Version:
8.2.29
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 => #<OpenSSL::ASN1::Sequence:0x87326e0 ;TI".# @indefinite_length=false, ;TI"# @tag=16, ;TI"+# @tag_class=:UNIVERSAL, ;TI""# @tagging=nil, ;TI"# @value= ;TI";# [#<OpenSSL::ASN1::ASN1Data:0x87326f4 ;TI"3# @indefinite_length=false, ;TI"!# @tag=0, ;TI"7# @tag_class=:CONTEXT_SPECIFIC, ;TI"*# @value="\x01">]> ;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 => #<OpenSSL::ASN1::Sequence:0x87326e0 ;TI".# @indefinite_length=false, ;TI"# @tag=16, ;TI"+# @tag_class=:UNIVERSAL, ;TI""# @tagging=nil, ;TI"# @value= ;TI";# [#<OpenSSL::ASN1::ASN1Data:0x87326f4 ;TI"3# @indefinite_length=false, ;TI"!# @tag=0, ;TI"7# @tag_class=:CONTEXT_SPECIFIC, ;TI"!# @value= ;TI"?# [#<OpenSSL::ASN1::Integer:0x85bf308 ;TI"8# @indefinite_length=false, ;TI"&# @tag=2, ;TI"4# @tag_class=:UNIVERSAL ;TI",# @tagging=nil, ;TI",# @value=1>]>]> ;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