Gestionnaire de fichiers - Editer - /opt/cpanel/ea-ruby24/root/usr/share/ri/system/OpenSSL/ASN1/cdesc-ASN1.ri
Arrière
U:RDoc::NormalModule[iI" ASN1:ETI"OpenSSL::ASN1;T0o:RDoc::Markup::Document:@parts[o;;[-o:RDoc::Markup::Paragraph;[I"EAbstract Syntax Notation One (or ASN.1) is a notation syntax to ;TI"Jdescribe data structures and is defined in ITU-T X.680. ASN.1 itself ;TI"Ldoes not mandate any encoding or parsing rules, but usually ASN.1 data ;TI"Lstructures are encoded using the Distinguished Encoding Rules (DER) or ;TI"Mless often the Basic Encoding Rules (BER) described in ITU-T X.690. DER ;TI"Land BER encodings are binary Tag-Length-Value (TLV) encodings that are ;TI"Kquite concise compared to other popular data description formats such ;TI"as XML, JSON etc. ;TI"JASN.1 data structures are very common in cryptographic applications, ;TI"He.g. X.509 public key certificates or certificate revocation lists ;TI"M(CRLs) are all defined in ASN.1 and DER-encoded. ASN.1, DER and BER are ;TI"2the building blocks of applied cryptography. ;TI"JThe ASN1 module provides the necessary classes that allow generation ;TI"Iof ASN.1 data structures and the methods to encode them using a DER ;TI"Kencoding. The decode method allows parsing arbitrary BER-/DER-encoded ;TI"Ldata to a Ruby object that can then be modified and re-encoded at will.;To:RDoc::Markup::BlankLine S:RDoc::Markup::Heading: leveli: textI"ASN.1 class hierarchy;T@o; ;[I"OThe base class representing ASN.1 structures is ASN1Data. ASN1Data offers ;TI"Kattributes to read and set the +tag+, the +tag_class+ and finally the ;TI"I+value+ of a particular ASN.1 item. Upon parsing, any tagged values ;TI"N(implicit or explicit) will be represented by ASN1Data instances because ;TI"Ltheir "real type" can only be determined using out-of-band information ;TI"Ifrom the ASN.1 type declaration. Since this information is normally ;TI"Fknown when encoding a type, all sub-classes of ASN1Data offer an ;TI"Madditional attribute +tagging+ that allows to encode a value implicitly ;TI"/(+:IMPLICIT+) or explicitly (+:EXPLICIT+).;T@S;;i; I"Constructive;T@o; ;[I"BConstructive is, as its name implies, the base class for all ;TI"Gconstructed encodings, i.e. those that consist of several values, ;TI"Bopposed to "primitive" encodings with just one single value. ;TI"LPrimitive values that are encoded with "infinite length" are typically ;TI"Jconstructed (their values come in multiple chunks) and are therefore ;TI"Lrepresented by instances of Constructive. The value of an Constructive ;TI"is always an Array.;T@S;;i ; I"!ASN1::Set and ASN1::Sequence;T@o; ;[I"MThe most common constructive encodings are SETs and SEQUENCEs, which is ;TI"Hwhy there are two sub-classes of Constructive representing each of ;TI" them.;T@S;;i; I"Primitive;T@o; ;[I"@This is the super class of all primitive values. Primitive ;TI"Gitself is not used when parsing ASN.1 data, all values are either ;TI"Einstances of a corresponding sub-class of Primitive or they are ;TI"Minstances of ASN1Data if the value was tagged implicitly or explicitly. ;TI"GPlease cf. Primitive documentation for details on sub-classes and ;TI"Ctheir respective mappings of ASN.1 data types to Ruby objects.;T@S;;i; I""Possible values for +tagging+;T@o; ;[ I"HWhen constructing an ASN1Data object the ASN.1 type definition may ;TI"Lrequire certain elements to be either implicitly or explicitly tagged. ;TI"JThis can be achieved by setting the +tagging+ attribute manually for ;TI"Fsub-classes of ASN1Data. Use the symbol +:IMPLICIT+ for implicit ;TI"Ftagging and +:EXPLICIT+ if the element requires explicit tagging.;T@S;;i; I"$Possible values for +tag_class+;T@o; ;[I"KIt is possible to create arbitrary ASN1Data objects that also support ;TI"Ma PRIVATE or APPLICATION tag class. Possible values for the +tag_class+ ;TI"attribute are:;To:RDoc::Markup::List: @type:BULLET:@items[ o:RDoc::Markup::ListItem:@label0;[o; ;[I"3+:UNIVERSAL+ (the default for untagged values);To;;0;[o; ;[I"8+:CONTEXT_SPECIFIC+ (the default for tagged values);To;;0;[o; ;[I"+:APPLICATION+;To;;0;[o; ;[I"+:PRIVATE+;T@S;;i; I"Tag constants;T@o; ;[I"8There is a constant defined for each universal tag:;To;;;;[o;;0;[o; ;[I"OpenSSL::ASN1::EOC (0);To;;0;[o; ;[I"OpenSSL::ASN1::BOOLEAN (1);To;;0;[o; ;[I"OpenSSL::ASN1::INTEGER (2);To;;0;[o; ;[I""OpenSSL::ASN1::BIT_STRING (3);To;;0;[o; ;[I"$OpenSSL::ASN1::OCTET_STRING (4);To;;0;[o; ;[I"OpenSSL::ASN1::NULL (5);To;;0;[o; ;[I"OpenSSL::ASN1::OBJECT (6);To;;0;[o; ;[I"#OpenSSL::ASN1::ENUMERATED (10);To;;0;[o; ;[I"#OpenSSL::ASN1::UTF8STRING (12);To;;0;[o; ;[I"!OpenSSL::ASN1::SEQUENCE (16);To;;0;[o; ;[I"OpenSSL::ASN1::SET (17);To;;0;[o; ;[I"&OpenSSL::ASN1::NUMERICSTRING (18);To;;0;[o; ;[I"(OpenSSL::ASN1::PRINTABLESTRING (19);To;;0;[o; ;[I""OpenSSL::ASN1::T61STRING (20);To;;0;[o; ;[I"'OpenSSL::ASN1::VIDEOTEXSTRING (21);To;;0;[o; ;[I""OpenSSL::ASN1::IA5STRING (22);To;;0;[o; ;[I" OpenSSL::ASN1::UTCTIME (23);To;;0;[o; ;[I"(OpenSSL::ASN1::GENERALIZEDTIME (24);To;;0;[o; ;[I"&OpenSSL::ASN1::GRAPHICSTRING (25);To;;0;[o; ;[I"$OpenSSL::ASN1::ISO64STRING (26);To;;0;[o; ;[I"&OpenSSL::ASN1::GENERALSTRING (27);To;;0;[o; ;[I"(OpenSSL::ASN1::UNIVERSALSTRING (28);To;;0;[o; ;[I""OpenSSL::ASN1::BMPSTRING (30);T@S;;i; I" UNIVERSAL_TAG_NAME constant;T@o; ;[I"JAn Array that stores the name of a given tag number. These names are ;TI"Lthe same as the name of the tag constant that is additionally defined, ;TI"Ke.g. UNIVERSAL_TAG_NAME[2] = "INTEGER" and OpenSSL::ASN1::INTEGER = 2.;T@S;;i; I"Example usage;T@S;;i; I",Decoding and viewing a DER-encoded file;To:RDoc::Markup::Verbatim;[ I"require 'openssl' ;TI"require 'pp' ;TI"$der = File.binread('data.der') ;TI"&asn1 = OpenSSL::ASN1.decode(der) ;TI"pp der ;T:@format0S;;i; I"4Creating an ASN.1 structure and DER-encoding it;To;;[I"require 'openssl' ;TI"-version = OpenSSL::ASN1::Integer.new(1) ;TI"># Explicitly 0-tagged implies context-specific tag class ;TI"Qserial = OpenSSL::ASN1::Integer.new(12345, 0, :EXPLICIT, :CONTEXT_SPECIFIC) ;TI"9name = OpenSSL::ASN1::PrintableString.new('Data 1') ;TI"Isequence = OpenSSL::ASN1::Sequence.new( [ version, serial, name ] ) ;TI"der = sequence.to_der;T;0: @fileI"ext/openssl/ossl_asn1.c;T:0@omit_headings_from_table_of_contents_below0;0;0[ [U:RDoc::Constant[i I"UNIVERSAL_TAG_NAME;TI"&OpenSSL::ASN1::UNIVERSAL_TAG_NAME;T00o;;[o; ;[I"0Array storing tag names at the tag's index.;T;@;0@@cRDoc::NormalModule0[ [[I" class;T[[:public[[I"decode;TI"ext/openssl/ossl_asn1.c;T[I"decode_all;T@[I" traverse;T@[:protected[ [:private[ [I" instance;T[[;[ [;[ [;[ [ [U:RDoc::Context::Section[i 0o;;[ ;0;0[I"ext/openssl/ossl.c;TI"OpenSSL;F@
| ver. 1.4 |
Github
|
.
| PHP 8.0.30 | Génération de la page: 0.05 |
proxy
|
phpinfo
|
Réglages