@aptos-labs/ts-sdk - v3.1.1
    Preparing search index...

    Class FederatedKeylessPublicKey

    Represents the FederatedKeylessPublicKey public key

    These keys use an on-chain address as a source of truth for the JWK used to verify signatures.

    FederatedKeylessPublicKey authentication key is represented in the SDK as AnyPublicKey.

    Hierarchy (View Summary)

    Index

    Implementation - BCS

    • Serializes a Serializable value to its BCS representation. This function is the TypeScript SDK equivalent of bcs::to_bytes in Move.

      Returns Uint8Array

      the BCS representation of the Serializable instance as a byte buffer.

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

    Implementation - Serialization

    jwkAddress: AccountAddress

    The address that contains the JWK set to be used for verification.

    keylessPublicKey: KeylessPublicKey

    The inner public key which contains the standard Keyless public key.

    • Creates a FederatedKeylessPublicKey from the JWT components plus pepper

      Parameters

      • args: {
            aud: string;
            iss: string;
            jwkAddress: AccountAddressInput;
            pepper: HexInput;
            uidKey: string;
            uidVal: string;
        }
        • aud: string

          the client ID of the application

        • iss: string

          the iss of the identity

        • jwkAddress: AccountAddressInput
        • pepper: HexInput

          The pepper used to maintain privacy of the account

        • uidKey: string

          the key to use to get the uidVal in the JWT token

        • uidVal: string

          the value of the uidKey in the JWT token

      Returns FederatedKeylessPublicKey

      FederatedKeylessPublicKey

    Constructors

    Methods

    • Verifies a keyless signature for a given message. It will fetch the keyless configuration and the JWK to use for verification from the appropriate network as defined by the aptosConfig.

      Parameters

      • args: {
            aptosConfig: AptosConfig;
            message: HexInput;
            options?: { throwErrorWithReason?: boolean };
            signature: KeylessSignature;
        }
        • aptosConfig: AptosConfig

          The aptos config to use for fetching the keyless configuration.

        • message: HexInput

          The message to verify the signature against.

        • Optionaloptions?: { throwErrorWithReason?: boolean }
          • OptionalthrowErrorWithReason?: boolean

            Whether to throw an error with the reason for the failure instead of returning false.

        • signature: KeylessSignature

          The signature to verify.

      Returns Promise<boolean>

      true if the signature is valid