Results for: "match"

The file name and line number of the caller of the caller of this method.

depth is how many layers up the call stack it should go.

e.g.,

def a; Gem.location_of_caller; end a #=> [“x.rb”, 2] # (it’ll vary depending on file name and line number)

def b; c; end def c; Gem.location_of_caller(2); end b #=> [“x.rb”, 6] # (it’ll vary depending on file name and line number)

Returns the latest release-version specification for the gem name.

Returns the latest release version of RubyGems.

Returns the version of the latest release-version of gem name

Glob pattern for require-able plugin suffixes.

Path to specification files of default gems.

The default signing key path

The default signing certificate chain path

Default options for gem commands for Ruby packagers.

The options here should be structured as an array of string “gem” command names as keys and a string of the default options as values.

Example:

def self.operating_system_defaults

{
    'install' => '--no-rdoc --no-ri --env-shebang',
    'update' => '--no-rdoc --no-ri --env-shebang'
}

end

Should be implemented by a extended class.

tsort_each_node is used to iterate for all nodes over a graph.

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()

Example

ec = OpenSSL::PKey::EC.new("prime256v1")
p ec.private_key # => nil
ec.generate_key!
p ec.private_key # => #<OpenSSL::BN XXXXXX>

Raises an exception if the key is invalid.

See also the man page EVP_PKEY_public_check(3).

Returns whether this EC instance has a private key. The private key (BN) can be retrieved with EC#private_key.

Generates a new random private and public key.

See also the OpenSSL documentation for EC_KEY_generate_key()

Example

ec = OpenSSL::PKey::EC.new("prime256v1")
p ec.private_key # => nil
ec.generate_key!
p ec.private_key # => #<OpenSSL::BN XXXXXX>

Encrypt string with the private key. padding defaults to PKCS1_PADDING. The encrypted string output can be decrypted using public_decrypt.

Deprecated in version 3.0. Consider using PKey::PKey#sign_raw and PKey::PKey#verify_raw, and PKey::PKey#verify_recover instead.

Decrypt string, which has been encrypted with the public key, with the private key. padding defaults to PKCS1_PADDING.

Deprecated in version 3.0. Consider using PKey::PKey#encrypt and PKey::PKey#decrypt instead.

Sets the upper bound of the supported SSL/TLS protocol version. See min_version= for the possible values.

Adds a certificate to the context. pkey must be a corresponding private key with certificate.

Multiple certificates with different public key type can be added by repeated calls of this method, and OpenSSL will choose the most appropriate certificate during the handshake.

cert=, key=, and extra_chain_cert= are old accessor methods for setting certificate and internally call this method.

Parameters

certificate

A certificate. An instance of OpenSSL::X509::Certificate.

pkey

The private key for certificate. An instance of OpenSSL::PKey::PKey.

extra_certs

Optional. An array of OpenSSL::X509::Certificate. When sending a certificate chain, the certificates specified by this are sent following certificate, in the order in the array.

Example

rsa_cert = OpenSSL::X509::Certificate.new(...)
rsa_pkey = OpenSSL::PKey.read(...)
ca_intermediate_cert = OpenSSL::X509::Certificate.new(...)
ctx.add_certificate(rsa_cert, rsa_pkey, [ca_intermediate_cert])

ecdsa_cert = ...
ecdsa_pkey = ...
another_ca_cert = ...
ctx.add_certificate(ecdsa_cert, ecdsa_pkey, [another_ca_cert])
No documentation available
No documentation available
No documentation available

Creates a new X509::Extension with passed values. See also x509v3_config(5).

Search took: 5ms  ·  Total Results: 1813