Works similar to TCPServer#accept
.
See IO#close
for details.
Sets the purpose of the context. See Store#purpose=
.
Sets the time used in the verification. If not set, the current time is used.
Checks that cert signature is made with PRIVversion of this PUBLIC ‘key’
This adds a new ObjectId
to the internal tables. Where object_id
is the numerical form, short_name
is the short name, and long_name
is the long name.
Returns true
if successful. Raises an OpenSSL::ASN1::ASN1Error
if it fails.
key
- the public key to be used for verifying the SPKI
signature
Returns true
if the signature is valid, false
otherwise. To verify an SPKI
, the public key contained within the SPKI
should be used.
Verifies this request using the given certificates
and store
. certificates
is an array of OpenSSL::X509::Certificate
, store
is an OpenSSL::X509::Store
.
Verifies the signature of the response using the given certificates
and store
. This works in the similar way as OpenSSL::OCSP::Request#verify
.
To verify the String
signature
, digest
, an instance of OpenSSL::Digest
, must be provided to re-compute the message digest of the original data
, also a String
. The return value is true
if the signature is valid, false
otherwise. A PKeyError
is raised should errors occur. Any previous state of the Digest
instance is irrelevant to the validation outcome, the digest instance is reset to its initial state during the operation.
data = 'Sign me!' digest = OpenSSL::Digest::SHA256.new pkey = OpenSSL::PKey::RSA.new(2048) signature = pkey.sign(digest, data) pub_key = pkey.public_key puts pub_key.verify(digest, signature, data) # => true
Creates a new DSA
instance by generating a private/public key pair from scratch.
size
is an integer representing the desired key size.
Verifies whether the signature is valid given the message digest input. It does so by validating sig
using the public key of this DSA
instance.
digest
is a message digest of the original input data to be signed
sig
is a DSA
signature value
dsa = OpenSSL::PKey::DSA.new(2048) doc = "Sign me" digest = OpenSSL::Digest::SHA1.digest(doc) sig = dsa.syssign(digest) puts dsa.sysverify(digest, sig) # => true
Creates a new EC
instance with a new random private and public key.
Generates an RSA
keypair. size
is an integer representing the desired key size. Keys smaller than 1024 should be considered insecure. exponent
is an odd number normally 3, 17, or 65537.
Returns the time at which the session was established.
Sets start time of the session. Time
resolution is in seconds.