import { PublicKey, Signer } from "@mysten/sui/cryptography"; import { KeyManagementServiceClient } from "@google-cloud/kms"; //#region src/gcp/gcp-kms-client.d.ts /** * Configuration options for initializing the GcpKmsSigner. */ interface GcpKmsSignerOptions { /** The version name generated from `client.cryptoKeyVersionPath()` */ versionName: string; /** Options for setting up the GCP KMS client */ client: KeyManagementServiceClient; /** Public key */ publicKey: PublicKey; } /** * GCP KMS Signer integrates GCP Key Management Service (KMS) with the Sui blockchain * to provide signing capabilities using GCP-managed cryptographic keys. */ declare class GcpKmsSigner extends Signer { #private; /** * 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); * ``` * @throws Will throw an error if required GCP credentials are not provided. */ constructor({ versionName, client, publicKey }: GcpKmsSignerOptions); /** * Retrieves the key scheme used by this signer. * @returns GCP supports only `Secp256k1` and `Secp256r1` schemes. */ getKeyScheme(): "ED25519" | "Secp256r1" | "Secp256k1" | "MultiSig" | "ZkLogin" | "Passkey"; /** * Retrieves the public key associated with this signer. * @returns The Secp256k1PublicKey instance. * @throws Will throw an error if the public key has not been initialized. */ getPublicKey(): PublicKey; /** * Signs the given data using GCP KMS. * @param bytes - The data to be signed as a Uint8Array. * @returns A promise that resolves to the signature as a Uint8Array. * @throws Will throw an error if the public key is not initialized or if signing fails. */ sign(bytes: Uint8Array): Promise>; /** * Creates a GCP KMS signer from the provided options. * Expects the credentials file to be set as an env variable * (GOOGLE_APPLICATION_CREDENTIALS). */ static fromOptions(options: { projectId: string; location: string; keyRing: string; cryptoKey: string; cryptoKeyVersion: string; }): Promise; static fromVersionName(versionName: string): Promise; } //#endregion export { GcpKmsSigner, GcpKmsSignerOptions }; //# sourceMappingURL=gcp-kms-client.d.mts.map