SecuredSecret

class SecuredSecret(index: Int, encryptedSecretBytes: ByteArray, val pubkeySecp256k1: ByteArray, var decrypt: (encryptedSecret: ByteArray, idx: Int) -> 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(index: Int, encryptedSecretBytes: ByteArray, pubkeySecp256k1: ByteArray, decrypt: (encryptedSecret: ByteArray, idx: Int) -> ByteArray? = null)

Properties

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

Functions

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(decryp: (ByteArray, Int) -> ByteArray)

Your decrypt function should throw WalletLockedException if the wallet is locked

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

You need to serialize and deserialize even if locked