if /foo #{bar}/ then end
^^^^^^^^^^^^
Returns the string that is used to insert a space between the tokens in a JSON
string.
Sets space to the string that is used to insert a space between the tokens in a JSON
string.
This integer returns the current depth of data structure nesting.
This sets the maximum level of data structure nesting in the generated JSON
to the integer depth, max_nesting
= 0 if no maximum should be checked.
Generates a valid JSON
document from object obj
and returns the result. If no valid JSON
document can be created this method raises a GeneratorError
exception.
Returns the generator of the group.
See the OpenSSL
documentation for EC_GROUP_get0_generator()
Returns the concatenated string from strings
.
Generates a private and public key unless a private key already exists. If this DH
instance was generated from public DH parameters (e.g. by encoding the result of DH#public_key
), then this method needs to be called first in order to generate the per-session keys before performing the actual key exchange.
Deprecated in version 3.0. This method is incompatible with OpenSSL
3.0.0 or later.
See also OpenSSL::PKey.generate_key
.
Example:
# DEPRECATED USAGE: This will not work on OpenSSL 3.0 or later dh0 = OpenSSL::PKey::DH.new(2048) dh = dh0.public_key # #public_key only copies the DH parameters (contrary to the name) dh.generate_key! puts dh.private? # => true puts dh0.pub_key == dh.pub_key #=> false # With OpenSSL::PKey.generate_key dh0 = OpenSSL::PKey::DH.new(2048) dh = OpenSSL::PKey.generate_key(dh0) puts dh0.pub_key == dh.pub_key #=> false
See the OpenSSL
documentation for EC_KEY_get0_private_key()
See the OpenSSL
documentation for EC_KEY_set_private_key()
Generates a new random private and public key.
See also the OpenSSL
documentation for EC_KEY_generate_key()
ec = OpenSSL::PKey::EC.new("prime256v1") p ec.private_key # => nil ec.generate_key! p ec.private_key # => #<OpenSSL::BN XXXXXX>
Returns whether this EC
instance has a private key. The private key (BN
) can be retrieved with EC#private_key
.