Skip to content
This repository has been archived by the owner on Mar 5, 2022. It is now read-only.

Commit

Permalink
feat: Create trustbloc DID cli
Browse files Browse the repository at this point in the history
closes #29

Signed-off-by: Firas Qutishat <[email protected]>
  • Loading branch information
fqutishat committed Nov 3, 2020
1 parent dc16228 commit 8a890dc
Show file tree
Hide file tree
Showing 21 changed files with 1,111 additions and 19 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,6 @@ coverage.out
.build
*.log
test/bdd/fixtures/keys/tls
test/bdd/fixtures/keys/update
test/bdd/fixtures/keys/recover
test/bdd/fixtures/wellknown/jws
4 changes: 4 additions & 0 deletions ci/azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ jobs:
}
trap logout EXIT
echo $DOCKER_PASSWORD | docker login docker.pkg.github.com --username $DOCKER_USER --password-stdin
echo '127.0.0.1 testnet.trustbloc.local' | sudo tee -a /etc/hosts
echo '127.0.0.1 stakeholder.one' | sudo tee -a /etc/hosts
echo '127.0.0.1 stakeholder.two' | sudo tee -a /etc/hosts
echo '127.0.0.1 sidetree-mock' | sudo tee -a /etc/hosts
make bdd-test
env:
DOCKER_USER: $(DOCKER_USER)
Expand Down
6 changes: 3 additions & 3 deletions cmd/did-method-cli/createconfigcmd/createconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -376,12 +376,12 @@ func createDID(didClient didClient, sidetreeURL string, jwk *gojose.JSONWebKey)
Encoding: did.PublicKeyEncodingJwk,
KeyType: did.Ed25519KeyType,
Value: pkBytes,
Purposes: []string{did.KeyPurposeVerificationMethod},
Purposes: []string{did.KeyPurposeVerificationMethod},
}

recovery := did.PublicKey{Type: did.Ed25519VerificationKey2018, Encoding: did.PublicKeyEncodingJwk, Value: pkBytes, Recovery: true}
recovery := did.PublicKey{Type: did.Ed25519VerificationKey2018, Encoding: did.PublicKeyEncodingJwk, KeyType: did.Ed25519KeyType, Value: pkBytes, Recovery: true}

update := did.PublicKey{Type: did.Ed25519VerificationKey2018, Encoding: did.PublicKeyEncodingJwk, Value: pkBytes, Update: true}
update := did.PublicKey{Type: did.Ed25519VerificationKey2018, Encoding: did.PublicKeyEncodingJwk, KeyType: did.Ed25519KeyType, Value: pkBytes, Update: true}

// TODO: Verify usage of this code - recovery, update and general purpose key should NOT be the same
return didClient.CreateDID("", did.WithSidetreeEndpoint(sidetreeURL),
Expand Down
Loading

0 comments on commit 8a890dc

Please sign in to comment.