Class: JWE::Alg::Rsa15

Inherits:
Object
  • Object
show all
Defined in:
lib/jwe/alg/rsa15.rb

Overview

RSA RSA with PKCS1 v1.5 algorithm.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(key) ⇒ Rsa15

Returns a new instance of Rsa15.


7
8
9
# File 'lib/jwe/alg/rsa15.rb', line 7

def initialize(key)
  self.key = key
end

Instance Attribute Details

#keyObject

Returns the value of attribute key


5
6
7
# File 'lib/jwe/alg/rsa15.rb', line 5

def key
  @key
end

Instance Method Details

#decrypt(encrypted_cek) ⇒ Object


15
16
17
# File 'lib/jwe/alg/rsa15.rb', line 15

def decrypt(encrypted_cek)
  key.private_decrypt(encrypted_cek)
end

#encrypt(cek) ⇒ Object


11
12
13
# File 'lib/jwe/alg/rsa15.rb', line 11

def encrypt(cek)
  key.public_encrypt(cek)
end