OR13 / did-jwk

did:jwk sdk & cli
https://github.com/OR13/did-jwk
MIT License
5 stars 0 forks source link

Why does resolve return private key? #3

Open vongohren opened 2 years ago

vongohren commented 2 years ago

Currently i create a did with create keyPair and run .toDid on the keypair. I get a DID and try to resolve it.


  "@context": [
    "https://www.w3.org/ns/did/v1",
    {
      "@vocab": "https://www.iana.org/assignments/jose#",
    },
  ],
  id: "did:jwk:eyJwdWJsaWNLZXlKd2siOnsia2lkIjoidXJuOmlldGY6cGFyYW1zOm9hdXRoOmp3ay10aHVtYnByaW50OnNoYS0yNTY6cUI2Zm02UG1tdnRjUkVUdmRsaDN1ZXRmNGU3MEIwZThIVVlzNWliN1ZJSSIsImt0eSI6Ik9LUCIsImNydiI6IkVkMjU1MTkiLCJhbGciOiJFZERTQSIsIngiOiJlV1Y1akVqLVBET3hlN2g4ZEhwOGtCRmhCZHpUVmtvS2pBSHFvWVB4Qzh3In0sInByaXZhdGVLZXlKd2siOnsia2lkIjoidXJuOmlldGY6cGFyYW1zOm9hdXRoOmp3ay10aHVtYnByaW50OnNoYS0yNTY6cUI2Zm02UG1tdnRjUkVUdmRsaDN1ZXRmNGU3MEIwZThIVVlzNWliN1ZJSSIsImt0eSI6Ik9LUCIsImNydiI6IkVkMjU1MTkiLCJhbGciOiJFZERTQSIsIngiOiJlV1Y1akVqLVBET3hlN2g4ZEhwOGtCRmhCZHpUVmtvS2pBSHFvWVB4Qzh3IiwiZCI6IlVCVzdGUS1nYnJTMDJvQWV0cGV6dWNMLWJna0VfWlY1VldoTkF0TGhHZGcifX0",
  verificationMethod: [
    {
      id: "#0",
      type: "JsonWebKey2020",
      controller: "did:jwk:eyJwdWJsaWNLZXlKd2siOnsia2lkIjoidXJuOmlldGY6cGFyYW1zOm9hdXRoOmp3ay10aHVtYnByaW50OnNoYS0yNTY6cUI2Zm02UG1tdnRjUkVUdmRsaDN1ZXRmNGU3MEIwZThIVVlzNWliN1ZJSSIsImt0eSI6Ik9LUCIsImNydiI6IkVkMjU1MTkiLCJhbGciOiJFZERTQSIsIngiOiJlV1Y1akVqLVBET3hlN2g4ZEhwOGtCRmhCZHpUVmtvS2pBSHFvWVB4Qzh3In0sInByaXZhdGVLZXlKd2siOnsia2lkIjoidXJuOmlldGY6cGFyYW1zOm9hdXRoOmp3ay10aHVtYnByaW50OnNoYS0yNTY6cUI2Zm02UG1tdnRjUkVUdmRsaDN1ZXRmNGU3MEIwZThIVVlzNWliN1ZJSSIsImt0eSI6Ik9LUCIsImNydiI6IkVkMjU1MTkiLCJhbGciOiJFZERTQSIsIngiOiJlV1Y1akVqLVBET3hlN2g4ZEhwOGtCRmhCZHpUVmtvS2pBSHFvWVB4Qzh3IiwiZCI6IlVCVzdGUS1nYnJTMDJvQWV0cGV6dWNMLWJna0VfWlY1VldoTkF0TGhHZGcifX0",
      publicKeyJwk: {
        publicKeyJwk: {
          kid: "urn:ietf:params:oauth:jwk-thumbprint:sha-256:qB6fm6PmmvtcRETvdlh3uetf4e70B0e8HUYs5ib7VII",
          kty: "OKP",
          crv: "Ed25519",
          alg: "EdDSA",
          x: "eWV5jEj-PDOxe7h8dHp8kBFhBdzTVkoKjAHqoYPxC8w",
        },
        privateKeyJwk: {
          kid: "urn:ietf:params:oauth:jwk-thumbprint:sha-256:qB6fm6PmmvtcRETvdlh3uetf4e70B0e8HUYs5ib7VII",
          kty: "OKP",
          crv: "Ed25519",
          alg: "EdDSA",
          x: "eWV5jEj-PDOxe7h8dHp8kBFhBdzTVkoKjAHqoYPxC8w",
          d: "UBW7FQ-gbrS02oAetpezucL-bgkE_ZV5VWhNAtLhGdg",
        },
      },
    },
  ],
}```

This is the output with private key inside of it?

What can I assist to document things correctly or is this a bug?
vongohren commented 2 years ago
image

Just a documentation on what was discussed