Skip to content

Commit

Permalink
Include support for multiple KMS types (#1386)
Browse files Browse the repository at this point in the history
* Include support for multiple KMS types

* Add API ref links for keymanagers

* Update site/docs/web5/build/decentralized-identifiers/key-management.mdx

* update interface for JS

* Update site/docs/web5/build/decentralized-identifiers/key-management.mdx

Co-authored-by: Angie Jones <[email protected]>

* Update site/docs/web5/build/decentralized-identifiers/key-management.mdx

Co-authored-by: Angie Jones <[email protected]>

---------

Co-authored-by: Angie Jones <[email protected]>
  • Loading branch information
acekyd and angiejones committed Apr 21, 2024
1 parent bced50a commit ca10000
Showing 1 changed file with 25 additions and 3 deletions.
28 changes: 25 additions & 3 deletions site/docs/web5/build/decentralized-identifiers/key-management.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Proper [key management](https://en.wikipedia.org/wiki/Key_management) ensures th

## Supported Types

The Web5 SDK offers two distinct `KeyManager` implementations:
The Web5 SDK provides a `KeyManager` interface that makes it possible to use any key management solution of your choice. A few examples out of the box are:

* **InMemoryKeyManager**: This implementation utilizes in-memory, ephemeral storage for managing keys.
It's ideal for scenarios where temporary key management is sufficient, such as in testing environments.
Expand All @@ -26,6 +26,28 @@ It's well-suited for production environments where a high level of security and

Both implementations facilitate key generation and signature operations essential for creating and managing DIDs. Each caters to distinct security needs, and the choice between them should be based on the specific requirements of your application.

Other production-friendly KMS solutions include [Azure Key Vault](https://azure.microsoft.com/en-us/products/key-vault), [Google Cloud KMS](https://cloud.google.com/security/products/security-key-management), and [HashiCorp Vault](https://www.hashicorp.com/products/vault) etc.

<LanguageSwitchBlock>
<div language="JavaScript">
<p>
Any of these can be used by implementing the [CryptoApi](https://tbd54566975.github.io/web5-js/interfaces/_web5_crypto.CryptoApi.html) interface.
</p>
</div>

<div language="Kotlin">
<p>
Any of these can be used by implementing the [KeyManager](https://tbd54566975.github.io/web5-kt/docs/-web5%20-s-d-k%20-documentation/web5.sdk.crypto/-key-manager/index.html) interface.
</p>
</div>
<div language="Swift">
<p>
Any of these can be used by implementing the [KeyManager](https://swiftpackageindex.com/tbd54566975/web5-swift/main/documentation/web5/keymanager) interface.
</p>
</div>
</LanguageSwitchBlock>


## Example
Below is an example that uses `AwsKeyManager` for production environments, and `InMemoryKeyManager` for any other environments (dev, test, etc).

Expand All @@ -39,7 +61,7 @@ Below is an example that uses `AwsKeyManager` for production environments, and `
{ language: 'maven', dependencies: ['web5-dids', 'web5-crypto'] },
{ language: 'gradle', dependencies: ['web5-dids', 'web5-crypto'] },
{ language: 'swift', dependencies: ['Web5']},
]}/>
]}/>

**Import Classes**

Expand All @@ -58,4 +80,4 @@ Below is an example that uses `AwsKeyManager` for production environments, and `
]} />

## Configuring AWS Key Manager
You can pass additional parameters to `AWSKeyManager()` to set up your key manager instance. See the [API Reference Guide](https://tbd54566975.github.io/web5-js/types/_web5_crypto_aws_kms.AwsKeyManagerParams.html) for information on how to use the KMSClient instance from the AWS SDK to store the private keys to your DID.
You can pass additional parameters to `AWSKeyManager()` to set up your key manager instance. See the [API Reference Guide](https://tbd54566975.github.io/web5-js/types/_web5_crypto_aws_kms.AwsKeyManagerParams.html) for information on how to use the KMSClient instance from the AWS SDK to store the private keys to your DID.

0 comments on commit ca10000

Please sign in to comment.