Skip to content

Commit

Permalink
Change examples to use fragments properly
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel Hardman <[email protected]>
  • Loading branch information
dhh1128 committed Aug 23, 2018
1 parent 6c50ae4 commit 2217d78
Showing 1 changed file with 19 additions and 15 deletions.
34 changes: 19 additions & 15 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,7 @@ <h2>
"@context": "https://w3id.org/did/v1",
"id": "did:example:123456789abcdefghi",
"publicKey": [{
"id": "did:example:123456789abcdefghi#keys-1",
"id": "keys-1",
"type": "RsaVerificationKey2018",
"owner": "did:example:123456789abcdefghi",
"publicKeyPem": "-----BEGIN PUBLIC KEY...END PUBLIC KEY-----\r\n"
Expand Down Expand Up @@ -809,13 +809,17 @@ <h2>
[[RFC3986]]. A DID fragment MUST be used only as a method-independent
pointer into the DID Document to identify a unique key description or
other DID Document component. To resolve this pointer, the complete
DID reference including the DID fragment MUST be used as the value of
the id key for the target JSON object.
DID reference including the DID fragment MUST be decomposed and mapped
as required by [[RFC3986]] section 3.5 -- the DID portion maps to the
id key of the DID Document, with the fragment mapping onto the value
of the id key of a child JSON object.
</p>

<p>
A specific DID scheme MAY specify ABNF rules for DID fragments that
are more restrictive than the generic rules in this section.
are more restrictive than the generic rules in this section; however,
it MUST NOT redefine fragment semantics, since this is specifically
prohibited by [[RFC3986]].
</p>
</section>

Expand Down Expand Up @@ -1174,17 +1178,17 @@ <h2>
"id": "did:example:123456789abcdefghi",
...
"publicKey": [{
"id": "did:example:123456789abcdefghi#keys-1",
"id": "keys-1",
"type": "RsaVerificationKey2018",
"owner": "did:example:123456789abcdefghi",
"publicKeyPem": "-----BEGIN PUBLIC KEY...END PUBLIC KEY-----\r\n"
}, {
"id": "did:example:123456789abcdefghi#keys-2",
"id": "keys-2",
"type": "Ed25519VerificationKey2018",
"owner": "did:example:pqrstuvwxyz0987654321",
"publicKeyBase58": "H3C2AVvLMv6gmMNam3uVAjZpfkcJCwDwnZn6z3wXmqPV"
}, {
"id": "did:example:123456789abcdefghi#keys-3",
"id": "keys-3",
"type": "Secp256k1VerificationKey2018",
"owner": "did:example:123456789abcdefghi",
"publicKeyHex": "02b97c30de767f084ce3080168ee293053ba33b235d7116a3263d29f1450936b71"
Expand All @@ -1205,12 +1209,12 @@ <h2>
"authentication": [{
// this key is referenced
"type": "RsaSignatureAuthentication2018",
"publicKey": "did:example:123456789abcdefghi#keys-1"
"publicKey": "#keys-1"
}, {
// this key is embedded
"type": "RsaSignatureAuthentication2018",
"publicKey: {
"id": "did:example:123456789abcdefghi#keys-2",
"id": "keys-2",
"type": "Ed25519VerificationKey2018",
"owner": "did:example:pqrstuvwxyz0987654321",
"publicKeyBase58": "H3C2AVvLMv6gmMNam3uVAjZpfkcJCwDwnZn6z3wXmqPV"
Expand Down Expand Up @@ -1242,9 +1246,9 @@ <h2>
Assume <em>value</em> is a URL.
<ol>
<li>
Dereference the URL and retrieve the <code>publicKey</code>
properties associated with the URL (e.g. process the
<code>publicKey</code> property at the top-level of the
Dereference the portion of the URL before the fragment and
retrieve the <code>publicKey</code> properties associated with the
URL (e.g. process the <code>publicKey</code> property at the top-level of the
dereferenced document).
</li>

Expand All @@ -1253,7 +1257,7 @@ <h2>
<ol>
<li>
If the <code>id</code> property of the object matches
<em>value</em>, set <em>result</em> to the object.
<em>fragment</em>, set <em>result</em> to the object.
</li>
</ol>
</li>
Expand Down Expand Up @@ -1338,11 +1342,11 @@ <h2>
"authentication": [{
// this key can be used to authenticate as DID ...fghi
"type": "RsaSignatureAuthentication2018",
"publicKey": "did:example:123456789abcdefghi#keys-1"
"publicKey": "#keys-1"
}, {
// this key can be used to authenticate as DID ...fghi
"type": "PseudonymousBiometricAuthentication2018",
"biometricTemplate": "did:example:123456789abcdefghi#bio-1"
"biometricTemplate": "#bio-1"
}],
...
}
Expand Down

0 comments on commit 2217d78

Please sign in to comment.