Rewinds to the beginning of the tar file entry
The line number in the source code where this AST’s text began.
The line number in the source code where this AST’s text ended.
Returns the original source code as an array of lines.
Note that this is an API for ruby internal use, debugging, and research. Do not use this for any other purpose. The compatibility is not guaranteed.
Initiates the SSL/TLS handshake as a client in non-blocking manner.
# emulates blocking connect begin ssl.connect_nonblock rescue IO::WaitReadable IO.select([s2]) retry rescue IO::WaitWritable IO.select(nil, [s2]) retry end
By specifying a keyword argument exception to false
, you can indicate that connect_nonblock
should not raise an IO::WaitReadable
or IO::WaitWritable
exception, but return the symbol :wait_readable
or :wait_writable
instead.
Parses the UTF-8 string representation of a distinguished name, according to RFC 2253.
See also to_utf8
for the opposite operation.
Parses the string representation of a distinguished name. Two different forms are supported:
OpenSSL format (X509_NAME_oneline()
) used by to_s
. For example: /DC=com/DC=example/CN=nobody
OpenSSL format (X509_NAME_print()
) used by to_s(OpenSSL::X509::Name::COMPAT). For example: DC=com, DC=example, CN=nobody
Neither of them is standardized and has quirks and inconsistencies in handling of escaped characters or multi-valued RDNs.
Use of this method is discouraged in new applications. See Name.parse_rfc2253
and to_utf8
for the alternative.
Returns the human readable error string corresponding to the error code retrieved by error
.
See also the man page X509_verify_cert_error_string(3).
Returns the depth of the chain. This is used in combination with error
.
See also the man page X509_STORE_CTX_get_error_depth(3).
Returns the certificate which caused the error.
See also the man page X509_STORE_CTX_get_current_cert(3).
Returns the CRL
which caused the error.
See also the man page X509_STORE_CTX_get_current_crl(3).
Signs data
using a private key pkey
. Unlike sign
, data
will not be hashed by digest
automatically.
See verify_raw
for the verification operation.
Added in version 3.0. See also the man page EVP_PKEY_sign(3).
digest
A String
that represents the message digest algorithm name, or nil
if the PKey
type requires no digest algorithm. Although this method will not hash data
with it, this parameter may still be required depending on the signature algorithm.
data
A String
. The data to be signed.
options
A Hash
that contains algorithm specific control operations to OpenSSL. See OpenSSL’s man page EVP_PKEY_CTX_ctrl_str(3) for details.
Example:
data = "Sign me!" hash = OpenSSL::Digest.digest("SHA256", data) pkey = OpenSSL::PKey.generate_key("RSA", rsa_keygen_bits: 2048) signopts = { rsa_padding_mode: "pss" } signature = pkey.sign_raw("SHA256", hash, signopts) # Creates a copy of the RSA key pkey, but without the private components pub_key = pkey.public_key puts pub_key.verify_raw("SHA256", signature, hash, signopts) # => true