The top-level class representing any ASN.1 object. When parsed by ASN1.decode
, tagged values are always represented by an instance of ASN1Data
.
ASN1Data
for parsing tagged values When encoding an ASN.1 type it is inherently clear what original type (e.g. INTEGER, OCTET STRING etc.) this value has, regardless of its tagging. But opposed to the time an ASN.1 type is to be encoded, when parsing them it is not possible to deduce the “real type” of tagged values. This is why tagged values are generally parsed into ASN1Data
instances, but with a different outcome for implicit and explicit tagging.
An implicitly 1-tagged INTEGER value will be parsed as an ASN1Data
with
tag equal to 1
tag_class equal to :CONTEXT_SPECIFIC
value equal to a String
that carries the raw encoding of the INTEGER.
This implies that a subsequent decoding step is required to completely decode implicitly tagged values.
An explicitly 1-tagged INTEGER value will be parsed as an ASN1Data
with
tag equal to 1
tag_class equal to :CONTEXT_SPECIFIC
value equal to an Array
with one single element, an instance of OpenSSL::ASN1::Integer
, i.e. the inner element is the non-tagged primitive value, and the tagging is represented in the outer ASN1Data
int = OpenSSL::ASN1::Integer.new(1, 0, :IMPLICIT) # implicit 0-tagged seq = OpenSSL::ASN1::Sequence.new( [int] ) der = seq.to_der asn1 = OpenSSL::ASN1.decode(der) # pp asn1 => #<OpenSSL::ASN1::Sequence:0x87326e0 # @indefinite_length=false, # @tag=16, # @tag_class=:UNIVERSAL, # @tagging=nil, # @value= # [#<OpenSSL::ASN1::ASN1Data:0x87326f4 # @indefinite_length=false, # @tag=0, # @tag_class=:CONTEXT_SPECIFIC, # @value="\x01">]> raw_int = asn1.value[0] # manually rewrite tag and tag class to make it an UNIVERSAL value raw_int.tag = OpenSSL::ASN1::INTEGER raw_int.tag_class = :UNIVERSAL int2 = OpenSSL::ASN1.decode(raw_int) puts int2.value # => 1
int = OpenSSL::ASN1::Integer.new(1, 0, :EXPLICIT) # explicit 0-tagged seq = OpenSSL::ASN1::Sequence.new( [int] ) der = seq.to_der asn1 = OpenSSL::ASN1.decode(der) # pp asn1 => #<OpenSSL::ASN1::Sequence:0x87326e0 # @indefinite_length=false, # @tag=16, # @tag_class=:UNIVERSAL, # @tagging=nil, # @value= # [#<OpenSSL::ASN1::ASN1Data:0x87326f4 # @indefinite_length=false, # @tag=0, # @tag_class=:CONTEXT_SPECIFIC, # @value= # [#<OpenSSL::ASN1::Integer:0x85bf308 # @indefinite_length=false, # @tag=2, # @tag_class=:UNIVERSAL # @tagging=nil, # @value=1>]>]> int2 = asn1.value[0].value[0] puts int2.value # => 1
An OpenSSL::OCSP::CertificateId
identifies a certificate to the CA so that a status check can be performed.
This represents a YAML Document
. This node must be a child of Psych::Nodes::Stream
. A Psych::Nodes::Document
must have one child, and that child may be one of the following:
Represents a YAML stream. This is the root node for any YAML parse tree. This node must have one or more child nodes. The only valid child node for a Psych::Nodes::Stream
node is Psych::Nodes::Document
.
YAMLTree
builds a YAML ast given a Ruby object. For example:
builder = Psych::Visitors::YAMLTree.new builder << { :foo => 'bar' } builder.tree # => #<Psych::Nodes::Stream .. }
Default formatter for log messages.
Raised when the data length recorded in the gzip file footer is not equivalent to the length of the actual uncompressed data.
In-memory session storage class.
Implements session storage as a global in-memory hash. Session
data will only persist for as long as the Ruby interpreter instance does.
Net::IMAP::BodyTypeMessage
represents MESSAGE/RFC822 body structures of messages.
Returns a Net::IMAP::Envelope giving the envelope structure.
Returns an object giving the body structure.
And Net::IMAP::BodyTypeMessage
has all methods of Net::IMAP::BodyTypeText
.
Net::IMAP::BodyTypeMultipart
represents multipart body structures of messages.
Returns the content media type name as defined in [MIME-IMB].
Returns the content subtype name as defined in [MIME-IMB].
Returns multiple parts.
Returns a hash that represents parameters as defined in [MIME-IMB].
Returns a Net::IMAP::ContentDisposition object giving the content disposition.
Returns a string or an array of strings giving the body language value as defined in [LANGUAGE-TAGS].
Returns extension data.
Returns true.
Error
raised when a response from the server is non-parseable.
Switch
that takes no arguments.
Switch
that takes an argument.
Switch
that takes an argument, which does not begin with ‘-’.