new

OpenSSL::ASN1::Primitive.new( value [, tag, tagging, tag_class ]) => Primitive Class Public methods value: is mandatory. tag: optional, may be specified for tagged values. If no tag is specified, the UNIVERSAL tag corresponding to the Primitive sub-class is used by default. tagging: may be used as an encoding hint to encode a value either explicitly or implicitly, see ASN1 for possible values. tag_class: if tag and tagging are nil then this is set to :UNIVERSAL by default. If e

to_der

asn1.to_der => DER-encoded String Instance Public methods See OpenSSL::ASN1::ASN1Data#to_der for details. *

decode

OpenSSL::ASN1.decode(der) â ASN1Data Class Public methods Decodes a BER- or DER-encoded value and creates an ASN1Data instance. der may be a String or any object that features a #to_der method transforming it into a BER-/DER-encoded String. Example der = File.binread('asn1data') asn1 = OpenSSL::ASN1.decode(der)

decode_all

OpenSSL::ASN1.decode_all(der) â Array of ASN1Data Class Public methods Similar to decode with the difference that decode expects one distinct value represented in der. decode_all on the contrary decodes a sequence of sequential BER/DER values lined up in der and returns them as an array. Example ders = File.binread('asn1data_seq') asn1_ary = OpenSSL::ASN1.decode_all(ders)

traverse

OpenSSL::ASN1.traverse(asn1) â nil Class Public methods If a block is given, it prints out each of the elements encountered. Block parameters are (in that order): depth: The recursion depth, plus one with each constructed value being encountered (Number) offset: Current byte offset (Number) header length: Combined length in bytes of the Tag and Length headers. (Number) length: The overall remaining length of the entire data (Number) constructed: Whether this value is cons

generate_prime

BN.generate_prime(bits, [, safe [, add [, rem]]]) => bn Class Public methods Parameters bits - integer safe - boolean add - BN rem - BN

new

BN.new => aBNBN.new(bn) => aBNBN.new(string) => aBNBN.new(string, 0 | 2 | 10 | 16) => aBN Class Public methods

/

bn1 / bn2 => [result, remainder] Instance Public methods

==

==(p1) Instance Public methods Alias for: eql?

===

===(p1) Instance Public methods Alias for: eql?