The cryptographic algorithm used for the key.
The key data associated with the public key.
Generates an account hash for the public key, used to uniquely identify an account.
An AccountHash representing the account associated with this public key.
Converts the public key to a hexadecimal string representation.
The hexadecimal string representation of the public key.
checksummed
is true
, the result includes a checksum.checksummed
is false
, the raw hex string is returned.If the public key is not initialized properly (i.e., this.key
is missing).
A boolean indicating whether to return a checksummed version of the hex string.
true
: Includes a checksum in the output.false
(default): Returns the raw hexadecimal string without a checksum.Verifies a signature for a given message.
A promise that resolves to a boolean indicating the validity of the signature.
Error if the signature or public key is empty, or if the signature is invalid.
The message to verify.
The signature to verify.
Static
encodeReturns the bytes encoded as hexadecimal with mixed-case based checksums following a scheme similar to EIP-55. Key differences:
checksummed hex presentation string of input
Uint8Array to generate checksummed hex string
Static
fromStatic
fromCreates a PublicKey instance from a byte array.
A new PublicKey instance.
Error if the public key algorithm is invalid.
The byte array.
Static
fromTries to decode PublicKey from its hex-representation. The hex format should be as produced by PublicKey.toHex
public key hex string contains key tag
throws an Error if true and given string is not checksummed
Static
fromJSONStatic
isVerify a mixed-case hexadecimal string that it conforms to the checksum scheme similar to scheme in EIP-55. Key differences:
SMALL_BYTES_COUNT
, not just 20-byte addressestrue if input is checksummed
string to check if it is checksummed
Static
newGenerated using TypeDoc
Represents a public key with a cryptographic algorithm and key data. Provides utilities for serialization, verification, and obtaining an associated account hash.