Secp256r1PublicKey class

Represents a Secp256r1 ECDSA public key.

Inheritance

Constructors

Secp256r1PublicKey(HexInput hexInput)
Create a new PublicKey instance from a HexInput, which can be a string or bytes. Compressed (33-byte) keys are expanded to the uncompressed (65-byte) form.
factory

Properties

hashCode → int
The hash code for this object.
no setterinherited
keyType → String
Identifier to distinguish from Secp256k1PublicKey.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

authKey() → AuthenticationKey
Generates an authentication key from the public key using the Secp256r1 scheme (as a unified SingleKey public key).
bcsToBytes() → Uint8List
Serializes a Serializable value to its BCS representation. This function is the Dart SDK equivalent of bcs::to_bytes in Move.
inherited
bcsToHex() → Hex
Converts the BCS-serialized bytes of a value into a Hex instance.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
serialize(Serializer serializer) → void
override
toString() → String
Get the public key as a hex string with the 0x prefix.
override
toStringWithoutPrefix() → String
Get the public key as a hex string without the 0x prefix.
inherited
toUint8Array() → Uint8List
Get the data as a Uint8List representation.
override
verifyBytes({required Uint8List message, required Signature signature}) → bool
Verifies a signature against the exact bytes of message. This is the unambiguous form — the input is interpreted as raw bytes regardless of what they encode. Pair with Secp256r1PrivateKey.signBytes.
verifySignature({required HexInput message, required Signature signature}) → bool
Verifies a Secp256r1 signature against the public key.
override
verifySignatureAsync({Object? aptosConfig, required HexInput message, required Signature signature, Object? options}) → Future<bool>
Verifies signature with the public key and makes any network calls required to get state required to verify the signature.
inherited
verifyText({required String message, required Signature signature}) → bool
Verifies a signature against the UTF-8 encoding of message. The input is always treated as text — there is no hex/text heuristic. Pair with Secp256r1PrivateKey.signText.

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Methods

deserialize(Deserializer deserializer) → Secp256r1PublicKey
load(Deserializer deserializer) → Secp256r1PublicKey
Loads a Secp256r1PublicKey from the provided deserializer.

Constants

compressedLength → const int
If it's compressed, it is only 33 bytes.
length → const int
Secp256r1 ecdsa public keys contain a prefix indicating compression and two 32-byte coordinates.