# Encryption helper
Encryption helper allows to perform common encryption operations such as RSA/AES encryption and decryption.
# Provided operations
Below you can find the encryption helper's provided operations with some examples
Encrypts the given
data
with AES using the specifiedkey
.fun encryptWithAes(data: String, key: SecretKey): ByteArray
1Encrypts the given
data
with AES using the specifiedkey
.fun encryptWithAes(data: ByteArray, key: SecretKey): ByteArray
1Decrypts the given
data
with AES using the specifiedkey
.fun decryptWithAes(data: ByteArray, key: SecretKey): ByteArray
1Encrypts the given
data
with AES-GCM using the specifiedkey
.fun encryptStringWithAesGCM(data: ByteArray, key: SecretKey): ByteArray
1Encrypts the given
data
with RSA and the specifiedkey
.fun encryptWithRsa(data: String, key: PublicKey): ByteArray
1Encrypts the given
data
with RSA using the specifiedkey
.fun encryptWithRsa(data: ByteArray, key: PublicKey): ByteArray
1Encrypts the given data with RSA using the specified
certificate
.fun encryptWithRsa(data: String, certificate: X509Certificate): ByteArray
1Encrypts the given
data
with RSA using the specifiedcertificate
.fun encryptWithRsa(data: ByteArray, certificate: X509Certificate): ByteArray
1Decrypts the given data using the specified private
key
.fun decryptWithRsa(data: ByteArray, key: PrivateKey): ByteArray
1Returns the RSA
PublicKey
associated to the government that should be used when encrypting the data that only it should see.suspend fun getGovernmentRsaPubKey(lcdUrl: String): PublicKey
1