npm i @or13/did-jwk --save
# install cli globally
npm i -g @or13/did-jwk
did-jwk generate-key EdDSA
did-jwk generate-for authenticity
did-jwk generate-for privacy
did-jwk generate-for authenticity > k0.json
echo '{"message": "hello"}' > m0.json
did-jwk sign ./k0.json ./m0.json > m0.signed.json
did-jwk verify ./m0.signed.json --decode
did-jwk generate-for privacy > k1.json
echo '{"message": "hello"}' > m0.json
did-jwk create ./k1.json > recipient_id.json
did-jwk encrypt `cat ./recipient_id.json | jq '.id'` ./m0.json > m0.encrypted.json
did-jwk decrypt ./k1.json ./m0.encrypted.json --decode
npm i
npm t
# to test the cli.
npm i -g .
Create a private key
npm run did-jwk generate-key EdDSA --silent > ./src/cli-examples/key.json
Create a private key
npm run did-jwk generate-for authenticity --silent > ./src/cli-examples/key.authenticity.json
npm run did-jwk generate-for privacy --silent > ./src/cli-examples/key.privacy.json
Create a DID.
npm run did-jwk create ./src/cli-examples/key.json --silent > ./src/cli-examples/id.json
npm run did-jwk create ./src/cli-examples/key.privacy.json --silent > ./src/cli-examples/id.encrypt.json
Resolve a DID
npm run did-jwk resolve `cat ./src/cli-examples/id.json | jq '.id'` --silent > ./src/cli-examples/resolution.json
Dereference a DID.
npm run did-jwk dereference `cat ./src/cli-examples/id.json | jq '.id'`#0 --silent > ./src/cli-examples/dereference.json
Sign as a DID
npm run did-jwk sign ./src/cli-examples/key.json ./src/cli-examples/message.json --silent > ./src/cli-examples/message.signed.json
Verify with a DID
npm run did-jwk verify ./src/cli-examples/message.signed.json --silent > ./src/cli-examples/message.verified.json
Verify and decode
npm run did-jwk verify ./src/cli-examples/message.signed.json -- --decode
Encrypt to a DID
npm run did-jwk encrypt `cat ./src/cli-examples/id.encrypt.json | jq '.id'` ./src/cli-examples/message.json --silent > ./src/cli-examples/message.encrypted.json
Decrypt with a private key
npm run did-jwk decrypt ./src/cli-examples/key.privacy.json ./src/cli-examples/message.encrypted.json --silent > ./src/cli-examples/message.decrypted.json
Decrypt and decode as text
npm run did-jwk decrypt ./src/cli-examples/key.privacy.json ./src/cli-examples/message.encrypted.json -- --decode