Performs a public key encryption operation using pkey
.
See decrypt
for the reverse operation.
Added in version 3.0. See also the man page EVP_PKEY_encrypt(3).
data
A String
to be encrypted.
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:
pkey = OpenSSL::PKey.generate_key("RSA", rsa_keygen_bits: 2048) data = "secret data" encrypted = pkey.encrypt(data, rsa_padding_mode: "oaep") decrypted = pkey.decrypt(data, rsa_padding_mode: "oaep") p decrypted #=> "secret data"
Returns the time at which the session was established.
Sets start time of the session. Time
resolution is in seconds.
Returns the timeout value set for the session, in seconds from the established time.
Sets how long until the session expires in seconds.
Sets the time to be used in the certificate verifications with the store. By default, if not specified, the current system time is used.
OpenSSL::X509::StoreContext#time=
can be used to change the value for a single verification operation.
See also the man page X509_VERIFY_PARAM_set_time(3).
Unpacks the SecurityBufferDesc structure into member variables. We only want to do this once per struct, so the struct is deleted after unpacking.
A list of file names contained in this gem
The dependencies of the gem for this specification
The dependencies of the gem for this specification
Does not print anything when complete as this object has taken a vow of silence.