Sets p, q, g to the DH
instance.
Sets pub_key and priv_key for the DH
instance. priv_key may be nil
.
Encodes this DSA
to its DER encoding.
Sets p, q, g to the DSA
instance.
Sets pub_key and priv_key for the DSA
instance. priv_key may be nil
.
Obtains a list of all predefined curves by the OpenSSL
. Curve names are returned as sn.
See the OpenSSL
documentation for EC_get_builtin_curves().
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>
See the OpenSSL
documentation for i2d_ECPrivateKey_bio()
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>
Outputs this keypair in DER encoding.
Encrypt string with the public key. padding defaults to PKCS1_PADDING. The encrypted string output can be decrypted using private_decrypt
.
Decrypt string, which has been encrypted with the private key, with the public key. padding defaults to PKCS1_PADDING.
Encrypt string with the private key. padding defaults to PKCS1_PADDING. The encrypted string output can be decrypted using public_decrypt
.
Decrypt string, which has been encrypted with the public key, with the private key. padding defaults to PKCS1_PADDING.
Verifies data using the Probabilistic Signature Scheme (RSA-PSS).
The return value is true
if the signature is valid, false
otherwise. RSAError
will be raised if an error occurs.
See sign_pss
for the signing operation and an example code.
A String containing the message digest algorithm name.
A String. The data to be signed.
The length in octets of the salt. Two special values are reserved: :digest
means the digest length, and :auto
means automatically determining the length based on the signature.
The hash algorithm used in MGF1.
Sets n, e, d for the RSA
instance.
General callback for OpenSSL
verify
Adds path as the hash dir to be looked up by the store.
Adds the OpenSSL::X509::Certificate
cert to the certificate store.