@aptos-labs/ts-sdk - v7.4.0
    Preparing search index...

    Class Secp256r1PublicKey

    Represents a Secp256r1 ECDSA public key.

    Hierarchy (View Summary)

    Index
    • Converts the BCS-serialized bytes of a value into a Hex instance. This function provides a Hex representation of the BCS-serialized data for easier handling and manipulation.

      Returns Hex

      A Hex instance with the BCS-serialized bytes loaded into its underlying Uint8Array.

    • 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.

      The message is SHA3-256 hashed before verification (matching the Aptos-side Secp256r1 signing convention), and the signature is required to be in canonical low-S form for malleability resistance.

      Parameters

      • args: { message: Uint8Array; signature: Signature }

        The arguments for verification.

        • message: Uint8Array

          The exact bytes that were signed.

        • signature: Signature

          The signature to verify.

      Returns boolean

    • Verifies a Secp256r1 signature against the public key.

      Parameters

      • args: { message: HexInput; signature: Signature }

        The arguments for verifying the signature.

        • message: HexInput

          The message that was signed.

        • signature: Signature

          The signature to verify against the public key.

      Returns boolean

      The polymorphic message: HexInput input is ambiguous — a bare even-length string of hex characters (e.g., "cafe") is verified against the 2 bytes [0xCA, 0xFE], not 4 UTF-8 text bytes. Use verifyBytes for Uint8Array input or verifyText for string input; both are unambiguous. See convertSigningMessage for the full legacy rule.

    keyType: string = "secp256r1"
    COMPRESSED_LENGTH: number = 33
    LENGTH: number = 65

    The length of the Secp256r1 public key in bytes.