From 0563c0b8331dadef8b75ded0e9821bc4557b540b Mon Sep 17 00:00:00 2001 From: John Naulty Date: Wed, 30 Oct 2024 13:11:03 -0700 Subject: [PATCH] update README --- sdk/kms/README.md | 41 +++++++++++++++++++++++++++++++++++++++-- 1 file changed, 39 insertions(+), 2 deletions(-) diff --git a/sdk/kms/README.md b/sdk/kms/README.md index d7f871dd7acfa..5d3496d7f6824 100644 --- a/sdk/kms/README.md +++ b/sdk/kms/README.md @@ -1,10 +1,21 @@ # Sui KMS Signers -This package is the source for finding exported KMS signers. +The Sui KMS Signers package provides a set of tools for securely signing transactions using Key Management Services (KMS) like AWS KMS. + +## Table of Contents + +- [AWS KMS Signer](#aws-kms-signer) + - [Usage](#usage) + - [API](#api) + - [fromCredentials](#fromcredentials) + - [Parameters](#parameters) + - [Examples](#examples) ## AWS KMS Signer -You can use AWS KMS signer like the following: +The AWS KMS Signer allows you to leverage AWS's Key Management Service to sign Sui transactions. + +### Usage ```typescript import { AwsKmsSigner } from '@mysten/kms/aws'; @@ -19,3 +30,29 @@ const prepareSigner = async () => { }); }; ``` + +### API + +#### fromCredentials + +Create an AWS KMS signer from credentials. This method initializes the signer with the necessary AWS credentials and region information, allowing it to interact with AWS KMS to perform cryptographic operations. + +##### Parameters + +- `keyId` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** The AWS KMS key ID. +- `options` **[object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** An object containing AWS credentials and region. + - `region` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** The AWS region. + - `accessKeyId` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** The AWS access key ID. + - `secretAccessKey` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** The AWS secret access key. + +##### Examples + +```typescript +const signer = await AwsKmsSigner.fromCredentials('your-kms-key-id', { + region: 'us-west-2', + accessKeyId: 'your-access-key-id', + secretAccessKey: 'your-secret-access-key', +}); +``` + +Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)<[AwsKmsSigner](./src/aws/aws-kms-signer.ts)>** An instance of AwsKmsSigner. \ No newline at end of file