DefaultCryptoProvider

class DefaultCryptoProvider(keyNamespace: String, databaseName: String, context: Context) : CryptoProvider

Default CryptoProvider implementation.

Constructors

Link copied to clipboard
constructor(keyNamespace: String, databaseName: String, context: Context)

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
open override fun decrypt(keyId: String, algorithm: SymmetricKeyEncryptionAlgorithm, data: ByteArray): ByteArray

Encrypts the given data using the specified key and encryption algorithm.

Link copied to clipboard
open override fun encrypt(keyId: String, algorithm: SymmetricKeyEncryptionAlgorithm, data: ByteArray): ByteArray

Encrypts the given data using the specified key and encryption algorithm.

Link copied to clipboard

Export encryption keys used for encrypting and decrypting Sudo claims.

Link copied to clipboard
open override fun generateEncryptionKey(): String

Generate an encryption key to use for encrypting Sudo claims. Any existing keys are not removed to be able to decrypt existing claims but new claims will be encrypted using the newly generated key.

Link copied to clipboard
open override fun getSymmetricKeyId(): String?

Get the current (most recently generated) symmetric key ID.

Link copied to clipboard
open override fun importEncryptionKeys(keys: List<EncryptionKey>, currentKeyId: String)

Import encryption keys to use for encrypting and decrypting Sudo claims. All existing keys will be removed before the new keys are imported.

Link copied to clipboard
open override fun reset()

Removes all keys associated with this provider.