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 either tag or tagging are set then :CONTEXT_SPECIFIC
is used as the default. For possible values please cf. ASN1
.
int = OpenSSL::ASN1::Integer.new(42) zero_tagged_int = OpenSSL::ASN1::Integer.new(42, 0, :IMPLICIT) private_explicit_zero_tagged_int = OpenSSL::ASN1::Integer.new(42, 0, :EXPLICIT, :PRIVATE)
request - optional raw request, either in PEM or DER format.
Creates a new OpenSSL::OCSP::Request
. The request may be created empty or from a request_der string.
Creates a new OpenSSL::OCSP::Response
. The response may be created empty or from a response_der string.
Creates a new BasicResponse
. If der_string is given, decodes der_string as DER.
Creates a new SingleResponse
from der_string.
Creates a new OpenSSL::OCSP::CertificateId
for the given subject and issuer X509
certificates. The digest is a digest algorithm that is used to compute the hash values. This defaults to SHA-1.
If only one argument is given, decodes it as DER representation of a certificate ID.
Because PKey
is an abstract class, actually calling this method explicitly will raise a NotImplementedError
.
Either generates a DH
instance from scratch or by reading already existing DH
parameters from string. Note that when reading a DH
instance from data that was encoded from a DH
instance by using DH#to_pem
or DH#to_der
the result will not contain a public/private key pair yet. This needs to be generated using DH#generate_key!
first.
size is an integer representing the desired key size. Keys smaller than 1024 bits should be considered insecure.
generator is a small number > 1, typically 2 or 5.
string contains the DER or PEM encoded key.
DH.new # -> dh DH.new(1024) # -> dh DH.new(1024, 5) # -> dh #Reading DH parameters dh = DH.new(File.read('parameters.pem')) # -> dh, but no public/private key yet dh.generate_key! # -> dh with public and private key
Creates a new DSA
instance by reading an existing key from string.
size is an integer representing the desired key size.
string contains a DER or PEM encoded key.
pass is a string that contains an optional password.
DSA.new -> dsa DSA.new(1024) -> dsa DSA.new(File.read('dsa.pem')) -> dsa DSA.new(File.read('dsa.pem'), 'mypassword') -> dsa
Creates a new EC
object from given arguments.
Generates or loads an RSA
keypair. If an integer key_size is given it represents the desired key size. Keys less than 1024 bits should be considered insecure.
A key can instead be loaded from an encoded_key which must be PEM or DER encoded. A pass_phrase can be used to decrypt the key. If none is given OpenSSL
will prompt for the pass phrase.
OpenSSL::PKey::RSA.new 2048 OpenSSL::PKey::RSA.new File.read 'rsa.pem' OpenSSL::PKey::RSA.new File.read('rsa.pem'), 'my pass phrase'
Creates a new X509::Store
.
Create a new Alias
that points to an anchor
Create a new Psych::Nodes::Document
object.
version
is a list indicating the YAML version. tags_directives
is a list of tag directive declarations implicit
is a flag indicating whether the document will be implicitly started.
This creates a YAML document object that represents a YAML 1.1 document with one tag directive, and has an implicit start:
Psych::Nodes::Document.new( [1,1], [["!", "tag:tenderlovemaking.com,2009:"]], true )
See also Psych::Handler#start_document
Create a new Psych::Nodes::Mapping
object.
anchor
is the anchor associated with the map or nil
. tag
is the tag associated with the map or nil
. implicit
is a boolean indicating whether or not the map was implicitly started. style
is an integer indicating the mapping style.
See also Psych::Handler#start_mapping
Create a new Psych::Nodes::Node
Create a new Psych::Nodes::Scalar
object.
value
is the string value of the scalar anchor
is an associated anchor or nil tag
is an associated tag or nil plain
is a boolean value quoted
is a boolean value style
is an integer idicating the string style
See also Psych::Handler#scalar
Create a new object representing a YAML sequence.
anchor
is the anchor associated with the sequence or nil. tag
is the tag associated with the sequence or nil. implicit
a boolean indicating whether or not the sequence was implicitly started. style
is an integer indicating the list style.