DerivedKey

Result of key derivation containing the derived cryptographic material.

IMPORTANT: This is a regular class (not data class) because:

  1. It contains mutable state that gets wiped via clear

  2. It should not be copied (copies would share mutable arrays)

  3. Hash code changes after clearing (breaks collections)

Security:

  • Call clear when done to wipe all keys from memory

  • Private, public, and chain code are ALL wiped

  • After clearing, this instance should not be used again

Properties

Link copied to clipboard

32-byte chain code for further derivation

Link copied to clipboard
val index: Int

The address index within the role

Link copied to clipboard

Human-readable derivation path

Link copied to clipboard

32-byte private key

Link copied to clipboard

33-byte compressed public key (with prefix)

Functions

Link copied to clipboard
fun clear()

Clears ALL key material from memory by filling with zeros.

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard

Returns true if this key has been cleared and can no longer be used.

Link copied to clipboard

Gets the private key as a hex string.

Link copied to clipboard

Gets the public key as a hex string.

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