Create a new PrivateKey instance from a Uint8Array or String.
A HexInput (string or Uint8Array)
Optionalstrict: booleanIf true, private key must AIP-80 compliant.
Static ReadonlyLENGTHLength of Secp256r1 ecdsa private key
Derive the Secp256r1PublicKey from this private key.
Secp256r1PublicKey The derived public key.
Serializes the data into a byte array using the provided serializer. This function is essential for converting data into a format suitable for transmission or storage.
The serializer instance used to convert the data.
Sign the given message with the private key. This function generates a cryptographic signature for the provided message.
A message in HexInput format to be signed.
Signature - The generated signature for the provided message.
Get the private key as a string representation.
string representation of the private key
Get the private key in bytes (Uint8Array).
StaticdeserializeDeserializes a Secp256r1PrivateKey from the provided deserializer. This function allows you to reconstruct a Secp256r1PrivateKey object from its serialized byte representation.
The deserializer instance used to read the serialized data.
StaticgenerateGenerate a new random private key.
Secp256r1PrivateKey - A newly generated Secp256r1 private key.
Get the private key as a hex string with the 0x prefix.
string representation of the private key.
StaticformatFormat a HexInput to an AIP-80 compliant string.
The HexString or Uint8Array format of the private key.
StaticparseParse a HexInput that may be a HexString, Uint8Array, or a AIP-80 compliant string to a Hex instance.
A HexString, Uint8Array, or a AIP-80 compliant string.
Optionalstrict: booleanIf true, the value MUST be compliant with AIP-80.
Represents a Secp256r1 ECDSA private key, providing functionality to create, sign messages, derive public keys, and serialize/deserialize the key.