Decrypt AES Key with RSA
Decrypt an AES Key with an RSA Private Key
Last updated
Was this helpful?
Decrypt an AES Key with an RSA Private Key
Last updated
Was this helpful?
The decryptAESKeyWithRSA
performs asymmetric decryption using an RSA Private Key
and the RSA-OAEP
algorithm. The permissions are requested with the help of the Arweave Wallet (Window Object)
in a browser environment if no wallet or use_wallet
is passed. The node environment expects Arweave JWK to be passed.
The function is called as follows:
The following params are available for this function and they must be passed in as an object:
key: Uint8Array
: The encrypted AES key received from the encryptAESKeyWithRSA function.
wallet: ArWallet
(optional): A value of type JWKInterface
or use_wallet
can be passed. If use_wallet
or nothing is passed to this param, it expects ArConnect
to be installed to run the decryption successfully.
The function call returns the following data:
decryptedKey: string
: The AES
key decrypted using an RSA Public Key
returned as a Base64 string
.