Class: JWE::Alg::Rsa15
- Inherits:
-
Object
- Object
- JWE::Alg::Rsa15
- Defined in:
- lib/jwe/alg/rsa15.rb
Overview
RSA RSA with PKCS1 v1.5 algorithm.
Instance Attribute Summary collapse
-
#key ⇒ Object
Returns the value of attribute key.
Instance Method Summary collapse
- #decrypt(encrypted_cek) ⇒ Object
- #encrypt(cek) ⇒ Object
-
#initialize(key) ⇒ Rsa15
constructor
A new instance of Rsa15.
Constructor Details
#initialize(key) ⇒ Rsa15
Returns a new instance of Rsa15.
9 10 11 |
# File 'lib/jwe/alg/rsa15.rb', line 9 def initialize(key) self.key = key end |
Instance Attribute Details
#key ⇒ Object
Returns the value of attribute key.
7 8 9 |
# File 'lib/jwe/alg/rsa15.rb', line 7 def key @key end |
Instance Method Details
#decrypt(encrypted_cek) ⇒ Object
17 18 19 |
# File 'lib/jwe/alg/rsa15.rb', line 17 def decrypt(encrypted_cek) key.private_decrypt(encrypted_cek) end |
#encrypt(cek) ⇒ Object
13 14 15 |
# File 'lib/jwe/alg/rsa15.rb', line 13 def encrypt(cek) key.public_encrypt(cek) end |