KeyPair

org.sigilaris.core.crypto.KeyPair
final case class KeyPair(privateKey: UInt256, publicKey: PublicKey)

An ECDSA secp256k1 key pair consisting of a private and public key.

The key pair enables cryptographic operations such as signing transactions and recovering public keys from signatures.

Value parameters

privateKey

32-byte private key as datatype.UInt256, must be in range [1, n-1] where n is the secp256k1 curve order

publicKey

corresponding 64-byte uncompressed public key (x||y coordinates)

Attributes

See also

CryptoOps.generate for key pair generation

CryptoOps.fromPrivate for deriving from private key

Example
 // Generate a new key pair
 val keyPair = CryptoOps.generate()
 // Derive from existing private key
 val privateKey = UInt256.fromHex("0123...").toOption.get
 val keyPair2   = CryptoOps.fromPrivate(privateKey.toBigInt)
Source
KeyPair.scala
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Members list

Value members

Inherited methods

def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product

Concrete fields

lazy override val toString: String

Returns a string representation of the object.

Returns a string representation of the object.

The default representation is platform dependent.

Attributes

Returns

a string representation of the object.

Source
KeyPair.scala