The following example will show how to sign a DID document with AWS KMS key. (demonstration only)
IMPORTANT: You must be careful on the way you expose the secret key and the access key. Always follow AWS security best practices.
Define some imports first:
Prepare the signer by providing the needed parameters gotten from previous steps:
Prepare an example document (can refer to this) that is to be signed:
Then sign the document (make sure to wrap document first):
Update the .env variables,
npm i then
node index.js. You should get a signed document.json that can be verified by DID method.