aboutsummaryrefslogtreecommitdiffstats
path: root/test/openssl/test_pkey_rsa.rb
Commit message (Collapse)AuthorAgeFilesLines
* test/openssl/test_pkey_rsa: disable test_no_private_exp on OpenSSL 3.0ky/ssl-test-assume-ec-supportKazuki Yamaguchi2021-10-221-1/+1
| | | | | OpenSSL::PKey::RSA#set_key does not exist when built with OpenSSL 3.0, so it is not possible to create an RSA object with incomplete state.
* test/openssl/utils: remove dup_public helper methodKazuki Yamaguchi2021-10-191-14/+17
| | | | | | It uses deprecated PKey::{RSA,DSA,DH}#set_* methods, which will not work with OpenSSL 3.0. The same can easily be achieved using PKey#public_to_der regardless of the key kind.
* pkey: implement PKey#sign_raw, #verify_raw, and #verify_recoverKazuki Yamaguchi2021-05-251-26/+52
| | | | | | | | | | | | | Add a variant of PKey#sign and #verify that do not hash the data automatically. Sometimes the caller has the hashed data only, but not the plaintext to be signed. In that case, users would have to use the low-level API such as RSA#private_encrypt or #public_decrypt directly. OpenSSL 1.0.0 and later supports EVP_PKEY_sign() and EVP_PKEY_verify() which provide the same functionality as part of the EVP API. This patch adds wrappers for them.
* pkey: implement PKey#encrypt and #decryptKazuki Yamaguchi2021-05-251-0/+34
| | | | | Support public key encryption and decryption operations using the EVP API.
* pkey: implement {DH,DSA,RSA}#public_key in RubyKazuki Yamaguchi2021-04-151-19/+18
| | | | | | | | | | | The low-level API that is used to implement #public_key is deprecated in OpenSSL 3.0. It is actually very simple to implement in another way, using existing methods only, in much shorter code. Let's do it. While we are at it, the documentation is updated to recommend against using #public_key. Now that OpenSSL::PKey::PKey implements public_to_der method, there is no real use case for #public_key in newly written Ruby programs.
* pkey: allow setting algorithm-specific options in #sign and #verifyky/pkey-sign-verify-optionsKazuki Yamaguchi2021-04-041-20/+14
| | | | | | Similarly to OpenSSL::PKey.generate_key and .generate_parameters, let OpenSSL::PKey::PKey#sign and #verify take an optional parameter for specifying control strings for EVP_PKEY_CTX_ctrl_str().
* Look up digest by name instead of constantBart de Water2020-04-211-5/+5
|
* Add Marshal support to PKey objectsBart de Water2020-04-191-0/+7
|
* Fixed inconsistency directory structure with ruby/ruby repoHiroshi SHIBATA2020-02-171-0/+452