Skip to content

Commit

Permalink
update README
Browse files Browse the repository at this point in the history
  • Loading branch information
jnaulty committed Oct 30, 2024
1 parent a7d6b2c commit 0563c0b
Showing 1 changed file with 39 additions and 2 deletions.
41 changes: 39 additions & 2 deletions sdk/kms/README.md
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -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.

0 comments on commit 0563c0b

Please sign in to comment.