SoftwareSecureArea

An implementation of SecureArea that creates and uses software keys.

This implementation supports all the curves and algorithms defined by SecureArea and also supports passphrase-protected keys. Key material is stored using the Storage abstraction and passphrase-protected keys are encrypted using AES-GCM with 256-bit keys with the key derived from the passphrase using HKDF.

On JVM and Android this is using Crypto and the algorithms and curves it implements.

Use SoftwareSecureArea.create to create an instance of SoftwareSecureArea.

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
open override val displayName: String

The name of the Secure Area, suitable for displaying to the end user.

Link copied to clipboard
open override val identifier: String

A stable identifier for the Secure Area.

Link copied to clipboard
open override val supportedAlgorithms: List<Algorithm>

The list of algorithms the Secure Area supports.

Functions

Link copied to clipboard
open suspend fun batchCreateKey(numKeys: Int, createKeySettings: CreateKeySettings): BatchCreateKeyResult

Creates a batch of new keys.

Link copied to clipboard
open suspend override fun createKey(alias: String?, createKeySettings: CreateKeySettings): SoftwareKeyInfo

Creates a new key.

Link copied to clipboard
open suspend override fun deleteKey(alias: String)

Deletes a previously created key.

Link copied to clipboard
open suspend override fun getKeyInfo(alias: String): SoftwareKeyInfo

Gets information about a key.

Link copied to clipboard
open suspend override fun getKeyInvalidated(alias: String): Boolean

Checks whether the key has been invalidated.

Link copied to clipboard
suspend fun getPrivateKey(alias: String, keyUnlockData: KeyUnlockData?): PrivateKey

Gets the underlying private key.

Link copied to clipboard
open suspend override fun kemDecapsulate(alias: String, ciphertext: ByteArray, unlockReason: Reason): SecureByteString

Performs Key Decapsulation.

Link copied to clipboard
open suspend override fun keyAgreement(alias: String, otherKey: EcPublicKey, unlockReason: Reason): SecureByteString

Performs Key Agreement.

Link copied to clipboard
open suspend override fun sign(alias: String, dataToSign: ByteArray, unlockReason: Reason): Signature

Signs data with a key.

Link copied to clipboard
open suspend override fun unlockKey(alias: String, unlockReason: Reason): List<KeyUnlockData>

Unlocks a key requiring user authentication.