# 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

  1. Encrypts the given data with AES using the specified key.

    fun encryptWithAes(data: String, key: SecretKey): ByteArray
    
    1
  2. Encrypts the given data with AES using the specified key.

    fun encryptWithAes(data: ByteArray, key: SecretKey): ByteArray
    
    1
  3. Decrypts the given data with AES using the specified key.

    fun decryptWithAes(data: ByteArray, key: SecretKey): ByteArray
    
    1
  4. Encrypts the given data with AES-GCM using the specified key.

    fun encryptStringWithAesGCM(data: ByteArray, key: SecretKey): ByteArray 
    
    1
  5. Encrypts the given data with RSA and the specified key.

    fun encryptWithRsa(data: String, key: PublicKey): ByteArray
    
    1
  6. Encrypts the given data with RSA using the specified key.

    fun encryptWithRsa(data: ByteArray, key: PublicKey): ByteArray
    
    1
  7. Encrypts the given data with RSA using the specified certificate.

    fun encryptWithRsa(data: String, certificate: X509Certificate): ByteArray
    
    1
  8. Encrypts the given data with RSA using the specified certificate.

    fun encryptWithRsa(data: ByteArray, certificate: X509Certificate): ByteArray
    
    1
  9. Decrypts the given data using the specified private key.

    fun decryptWithRsa(data: ByteArray, key: PrivateKey): ByteArray
    
    1
  10. Returns 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