Method: Bixby::CryptoUtil.decrypt
- Defined in:
- lib/bixby_common/util/crypto_util.rb
.decrypt(data, key_pem, iv_pem) ⇒ Object
25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/bixby_common/util/crypto_util.rb', line 25 def decrypt(data, key_pem, iv_pem) data = StringIO.new(data, 'rb') key = key_pem.private_decrypt(read_next(data)) iv = iv_pem.public_decrypt(read_next(data)) c = new_cipher() c.decrypt c.key = key c.iv = iv ret = c.update(d64(data.read)) + c.final end |