Results for: "tally"

This module provides instance methods for a digest implementation object to calculate message digest values.

No documentation available

exception to wait for writing. see IO.select.

Provides classes and methods to request, create and validate RFC3161-compliant timestamps. Request may be used to either create requests from scratch or to parse existing requests that again can be used to request timestamps from a timestamp server, e.g. via the net/http. The resulting timestamp response may be parsed using Response.

Please note that Response is read-only and immutable. To create a Response, an instance of Factory as well as a valid Request are needed.

Create a Response:

#Assumes ts.p12 is a PKCS#12-compatible file with a private key
#and a certificate that has an extended key usage of 'timeStamping'
p12 = OpenSSL::PKCS12.new(File.open('ts.p12', 'rb'), 'pwd')
md = OpenSSL::Digest.new('SHA1')
hash = md.digest(data) #some binary data to be timestamped
req = OpenSSL::Timestamp::Request.new
req.algorithm = 'SHA1'
req.message_imprint = hash
req.policy_id = "1.2.3.4.5"
req.nonce = 42
fac = OpenSSL::Timestamp::Factory.new
fac.gen_time = Time.now
fac.serial_number = 1
timestamp = fac.create_timestamp(p12.key, p12.certificate, req)

Verify a timestamp response:

#Assume we have a timestamp token in a file called ts.der
ts = OpenSSL::Timestamp::Response.new(File.open('ts.der', 'rb')
#Assume we have the Request for this token in a file called req.der
req = OpenSSL::Timestamp::Request.new(File.open('req.der', 'rb')
# Assume the associated root CA certificate is contained in a
# DER-encoded file named root.cer
root = OpenSSL::X509::Certificate.new(File.open('root.cer', 'rb')
# get the necessary intermediate certificates, available in
# DER-encoded form in inter1.cer and inter2.cer
inter1 = OpenSSL::X509::Certificate.new(File.open('inter1.cer', 'rb')
inter2 = OpenSSL::X509::Certificate.new(File.open('inter2.cer', 'rb')
ts.verify(req, root, inter1, inter2) -> ts or raises an exception if validation fails

Socket::Constants provides socket-related constants. All possible socket constants are listed in the documentation but they may not all be present on your platform.

If the underlying platform doesn’t define a constant the corresponding Ruby constant is not defined.

No documentation available

Mixin for holding meta-information.

Acceptable argument classes. Now contains DecimalInteger, OctalInteger and DecimalNumeric. See Acceptable argument classes (in source code).

Mixin methods for local and remote Gem::Command options.

No documentation available

The top-level class representing any ASN.1 object. When parsed by ASN1.decode, tagged values are always represented by an instance of ASN1Data.

The role of 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.

Example of a parsed implicitly tagged value

An implicitly 1-tagged INTEGER value will be parsed as an ASN1Data with

This implies that a subsequent decoding step is required to completely decode implicitly tagged values.

Example of a parsed explicitly tagged value

An explicitly 1-tagged INTEGER value will be parsed as an ASN1Data with

Example - Decoding an implicitly tagged INTEGER

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

Example - Decoding an explicitly tagged INTEGER

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
No documentation available

Generic exception class of the Timestamp module.

This class represents a YAML Alias. It points to an anchor.

A Psych::Nodes::Alias is a terminal node and may have no children.

This class represents a YAML Scalar.

This node type is a terminal node and should not have any children.

No documentation available

TimeStamp struct

Dummy session storage class.

Implements session storage place holder. No actual storage will be done.

Raised when encoding is invalid.

No documentation available

Net::IMAP::BodyTypeAttachment represents attachment body structures of messages.

Fields:

media_type

Returns the content media type name.

subtype

Returns nil.

param

Returns a hash that represents parameters.

multipart?

Returns false.

Error raised when data is in the incorrect format.

Switch that can omit argument.

A Resolv::LOC::Alt

A header for a tar file

Search took: 5ms  ·  Total Results: 1166