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.
Create a new Psych::Nodes::Stream
node with an encoding
that defaults to Psych::Nodes::Stream::UTF8
.
See also Psych::Handler#start_stream
Create a new FileStore
instance.
This constructor is used internally by CGI::Session
. The user does not generally need to call it directly.
session
is the session for which this instance is being created. The session id must only contain alphanumeric characters; automatically generated session ids observe this requirement.
option
is a hash of options for the initializer. The following options are recognised:
the directory to use for storing the FileStore
file. Defaults to Dir::tmpdir
(generally “/tmp” on Unix systems).
the prefix to add to the session id when generating the filename for this session’s FileStore
file. Defaults to “cgi_sid_”.
the prefix to add to the session id when generating the filename for this session’s FileStore
file. Defaults to the empty string.
This session’s FileStore
file will be created if it does not exist, or opened if it does.
Create a new MemoryStore
instance.
session
is the session this instance is associated with. option
is a list of initialisation options. None are currently recognized.