SecuredSecretBytes

class SecuredSecretBytes(encryptedSecretBytes: ByteArray, val publicData: ByteArray, var decrypt: (encryptedSecret: ByteArray) -> ByteArray? = null) : Secret

A secured secret holds some encrypted data, and a public value that is used to initialize the encryption. It also must be provided with a function to be used to decrypt the secret. That function may throw a WalletLockedException if it cannot decrypt the secret at this time.

Constructors

Link copied to clipboard
constructor(encryptedSecretBytes: ByteArray, publicData: ByteArray, decrypt: (encryptedSecret: ByteArray) -> ByteArray? = null)

Properties

Link copied to clipboard
var decrypt: (encryptedSecret: ByteArray) -> ByteArray?
Link copied to clipboard

Functions

Link copied to clipboard
open override fun clean()

Zero key material from this secret to minimize exposure scope and time

Link copied to clipboard
open override fun consistencyCheck(): Boolean

For unlocked secrets, checks that the secret derives the pubkey

Link copied to clipboard
open override fun getPubkey(pktype: PubkeyType): ByteArray

the pubkey is accessible even if the secret is locked

Link copied to clipboard
open override fun getSecret(): ByteArray

getting the secret can throw WalletLockedException if the wallet is locked

Link copied to clipboard

open override fun installDecrypter(decrypt: (ByteArray, Int) -> ByteArray)

Your decrypt function should throw WalletLockedException if the wallet is locked

Link copied to clipboard
open override fun isCleaned(): Boolean

Return true if the key material is zeroed

Link copied to clipboard
open override fun serialize(): ByteArray

You need to serialize and deserialize even if locked