lib/xml/kit/crypto/oaep_cipher.rb in xml-kit-0.1.0 vs lib/xml/kit/crypto/oaep_cipher.rb in xml-kit-0.1.1

- old
+ new

@@ -11,11 +11,21 @@ def self.matches?(algorithm) ALGORITHMS[algorithm] end + def encrypt(plain_text) + @key.public_encrypt(plain_text, padding) + end + def decrypt(cipher_text) - @key.private_decrypt(cipher_text, OpenSSL::PKey::RSA::PKCS1_OAEP_PADDING) + @key.private_decrypt(cipher_text, padding) + end + + private + + def padding + OpenSSL::PKey::RSA::PKCS1_OAEP_PADDING end end end end end