Class: OpenSSL::PKey::RSA
- Inherits:
-
Object
- Object
- OpenSSL::PKey::RSA
- Defined in:
- lib/mcapi/encryption/utils/openssl_rsa_oaep.rb
Instance Method Summary collapse
- #private_decrypt_oaep(str, label = '', md = nil, mgf1md = nil) ⇒ Object
- #public_encrypt_oaep(str, label = '', md = nil, mgf1md = nil) ⇒ Object
Instance Method Details
#private_decrypt_oaep(str, label = '', md = nil, mgf1md = nil) ⇒ Object
17 18 19 20 |
# File 'lib/mcapi/encryption/utils/openssl_rsa_oaep.rb', line 17 def private_decrypt_oaep(str, label = '', md = nil, mgf1md = nil) padded = private_decrypt(str, OpenSSL::PKey::RSA::NO_PADDING) PKCS1.check_oaep_mgf1(padded, label, md, mgf1md) end |
#public_encrypt_oaep(str, label = '', md = nil, mgf1md = nil) ⇒ Object
12 13 14 15 |
# File 'lib/mcapi/encryption/utils/openssl_rsa_oaep.rb', line 12 def public_encrypt_oaep(str, label = '', md = nil, mgf1md = nil) padded = PKCS1.add_oaep_mgf1(str, n.num_bytes, label, md, mgf1md) public_encrypt(padded, OpenSSL::PKey::RSA::NO_PADDING) end |