Skip to content

horizonx-tech/ic-identity-kms-js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ic-identity-kms-js

This is a Javascript implementation of the Identity Key Management Service (KMS) for the Internet Computer. This implements the SignIdentity of @dfinity/agent .

Installation

yarn add @horizonx/ic-identity-kms-js

or

npm install @horizonx/ic-identity-kms-js

Usage

import { KMSClient } from "@aws-sdk/client-kms";
import { KmsIdentity } from "@horizonx/ic-identity-kms-js";

export const handler = async () => {
  const identity = await KmsIdentity.from(new KMSClient(), "alias/sample-key");

  const agent = new HttpAgent({ host: "https://ic0.app", identity });
  agent.call("caniserId", {
    methodName: "methodName",
    arg: IDL.encode([IDL.Text], ["arg"]), 
  });
}

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published