class JWA::Algorithms::KeyManagement::RsaOaep

RSA-OAEP key encryption algorithm.

Public Class Methods

new(key) click to toggle source
# File lib/jwa/algorithms/key_management/rsa_oaep.rb, line 6
def initialize(key)
  @key = key
end

Public Instance Methods

decrypt(ciphertext) click to toggle source
# File lib/jwa/algorithms/key_management/rsa_oaep.rb, line 14
def decrypt(ciphertext)
  @key.private_decrypt(ciphertext, OpenSSL::PKey::RSA::PKCS1_OAEP_PADDING)
end
encrypt(plaintext) click to toggle source
# File lib/jwa/algorithms/key_management/rsa_oaep.rb, line 10
def encrypt(plaintext)
  @key.public_encrypt(plaintext, OpenSSL::PKey::RSA::PKCS1_OAEP_PADDING)
end