Documentation

    GCP KMS Signer integrates GCP Key Management Service (KMS) with the Sui blockchain to provide signing capabilities using GCP-managed cryptographic keys.

    Hierarchy (View Summary, Expand)

    Index

    Constructors

    • Creates an instance of GcpKmsSigner. It's expected to call the static fromOptions or fromVersionName method to create an instance. For example:

      const signer = await GcpKmsSigner.fromVersionName(versionName);
      

      Parameters

      Returns GcpKmsSigner

      Will throw an error if required GCP credentials are not provided.

    Methods

    • Retrieves the key scheme used by this signer.

      Returns "Secp256k1" | "Secp256r1" | "ED25519" | "MultiSig" | "ZkLogin" | "Passkey"

      GCP supports only Secp256k1 and Secp256r1 schemes.

    • Retrieves the public key associated with this signer.

      Returns PublicKey

      The Secp256k1PublicKey instance.

      Will throw an error if the public key has not been initialized.

    • Signs the given data using GCP KMS.

      Parameters

      • bytes: Uint8Array

        The data to be signed as a Uint8Array.

      Returns Promise<Uint8Array<ArrayBufferLike>>

      A promise that resolves to the signature as a Uint8Array.

      Will throw an error if the public key is not initialized or if signing fails.

    • Synchronous signing is not supported by GCP KMS.

      Returns never

      Always throws an error indicating synchronous signing is unsupported.

    • Signs provided personal message by calling signWithIntent() with a PersonalMessage provided as intent scope

      Parameters

      • bytes: Uint8Array

      Returns Promise<{ bytes: string; signature: string }>

    • Signs provided transaction by calling signWithIntent() with a TransactionData provided as intent scope

      Parameters

      • bytes: Uint8Array

      Returns Promise<SignatureWithBytes>

    • Sign messages with a specific intent. By combining the message bytes with the intent before hashing and signing, it ensures that a signed message is tied to a specific purpose and domain separator is provided

      Parameters

      Returns Promise<SignatureWithBytes>

    • Returns string

    • Creates a GCP KMS signer from the provided options. Expects the credentials file to be set as an env variable (GOOGLE_APPLICATION_CREDENTIALS).

      Parameters

      • options: {
            cryptoKey: string;
            cryptoKeyVersion: string;
            keyRing: string;
            location: string;
            projectId: string;
        }

      Returns Promise<GcpKmsSigner>

    • Parameters

      • versionName: string

      Returns Promise<GcpKmsSigner>

    MMNEPVFCICPMFPCPTTAAATR