klyn.cryptography.Cipher.rsaDecrypt
method
public static rsaDecrypt(cipherText as String, privateKeyPem as String, padding as String = "OAEP", hashAlgorithm as String = "SHA-256", inputEncoding as String = "base64") as String throws CryptoException:
DescriptionDecrypts RSA ciphertext with a private key.
import klyn.cryptography
keys = RSAKeyPairGenerator().generateKeyPair()
encrypted = Cipher.rsaEncrypt("hello", keys.publicKeyPem)
print(Cipher.rsaDecrypt(encrypted, keys.privateKeyPem))
ReturnsDecrypted UTF-8 text.