Skip to content

Add Verifiable Credential digital signature views for multiple examples. #834

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Dec 4, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
131 changes: 72 additions & 59 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
src="https://unpkg.com/browse/jquery/dist/jquery.min.js"></script>
<script src='https://www.w3.org/Tools/respec/respec-w3c' class='remove'></script>
<script src="./common.js" class="remove"></script>
<script class="remove"
src="https://cdn.jsdelivr.net/gh/digitalbazaar/respec-vc@1.0.0/dist/main.js"></script>

<script type="text/javascript" class="remove">
var respecConfig = {
group: "vc",
Expand Down Expand Up @@ -46,7 +49,11 @@
// Uncomment these to use the respec extension that generates a list of
// normative statements:
preProcess: [/*prepare_reqlist*/],
postProcess: [/*add_reqlist_button*/, restrictRefs],
postProcess: [
restrictRefs,
window.respecVc.createVcExamples
/*add_reqlist_button*/
],

github: "https://github.com/w3c/vc-data-model/",
includePermalinks: false,
Expand Down Expand Up @@ -926,7 +933,7 @@ <h3>Concrete Lifecycle Example</h3>
<span class='comment'>// purpose of this proof</span>
"proofPurpose": "assertionMethod",
<span class='comment'>// the identifier of the public key that can verify the signature</span>
"verificationMethod": "https://example.edu/issuers/565049/keys/1",
"verificationMethod": "https://example.edu/issuers/565049#key-1",
<span class='comment'>// the digital signature value</span>
"jws": "eyJhbGciOiJSUzI1NiIsImI2NCI6ZmFsc2UsImNyaXQiOlsiYjY0Il19..TCYt5X
sITJX1CxPCT8yAV-TVkIEq_PbChOMqsLfRoPsnsgw5WEuts01mq-pQy7UJiN5mgRxD-WUc
Expand Down Expand Up @@ -982,7 +989,7 @@ <h3>Concrete Lifecycle Example</h3>
"type": "RsaSignature2018",
"created": "2017-06-18T21:19:10Z",
"proofPurpose": "assertionMethod",
"verificationMethod": "https://example.edu/issuers/565049/keys/1",
"verificationMethod": "https://example.edu/issuers/565049#key-1",
"jws": "eyJhbGciOiJSUzI1NiIsImI2NCI6ZmFsc2UsImNyaXQiOlsiYjY0Il19..TCYt5X
sITJX1CxPCT8yAV-TVkIEq_PbChOMqsLfRoPsnsgw5WEuts01mq-pQy7UJiN5mgRxD-WUc
X16dUEMGlv50aqzpqh4Qktb3rk-BuQy72IFLOqV0G_zS245-kronKb78cPN25DGlcTwLtj
Expand Down Expand Up @@ -1191,7 +1198,8 @@ <h3>Identifiers</h3>
</dd>
</dl>

<pre class="example nohighlight" title="Usage of the id property">
<pre class="example nohighlight vc" title="Usage of the id property"
data-vc-vm="https://example.edu/issuers/565049#key-1">
{
"@context": [
"https://www.w3.org/2018/credentials/v1",
Expand All @@ -1207,8 +1215,7 @@ <h3>Identifiers</h3>
"type": "BachelorDegree",
"name": "Bachelor of Science and Arts"
}
},
"proof": { <span class="comment">...</span> }
}
}
</pre>

Expand Down Expand Up @@ -1267,7 +1274,8 @@ <h3>Types</h3>
</dd>
</dl>

<pre class="example nohighlight" title="Usage of the type property">
<pre class="example nohighlight vc" title="Usage of the type property"
data-vc-vm="https://example.edu/issuers/565049#key-1">
{
"@context": [
"https://www.w3.org/2018/credentials/v1",
Expand All @@ -1283,8 +1291,7 @@ <h3>Types</h3>
"type": "BachelorDegree",
"name": "Bachelor of Science and Arts"
}
},
"proof": { <span class="comment">...</span> }
}
}
</pre>

Expand Down Expand Up @@ -1483,7 +1490,9 @@ <h3>Credential Subject</h3>
</dd>
</dl>

<pre class="example nohighlight" title="Usage of the credentialSubject property">
<pre class="example nohighlight vc"
title="Usage of the credentialSubject property"
data-vc-vm="https://example.edu/issuers/565049#key-1">
{
"@context": [
"https://www.w3.org/2018/credentials/v1",
Expand All @@ -1499,8 +1508,7 @@ <h3>Credential Subject</h3>
"type": "BachelorDegree",
"name": "Bachelor of Science and Arts"
}
},
"proof": { <span class="comment">...</span> }
}
}
</pre>

Expand All @@ -1511,7 +1519,8 @@ <h3>Credential Subject</h3>
<a>subjects</a> with the <code>credentialSubject</code> property.
</p>

<pre class="example nohighlight" title="Specifying multiple subjects in a verifiable credential">
<pre class="example nohighlight"
title="Specifying multiple subjects in a verifiable credential">
{
"@context": [
"https://www.w3.org/2018/credentials/v1",
Expand All @@ -1529,8 +1538,7 @@ <h3>Credential Subject</h3>
"id": "did:example:c276e12ec21ebfeb1f712ebc6f1",
"name": "Morgan Doe",
"spouse": "did:example:ebfeb1f712ebc6f1c276e12ec21"
}]</span>,
"proof": { <span class="comment">...</span> }
}]</span>
}
</pre>

Expand Down Expand Up @@ -1560,7 +1568,8 @@ <h3>Issuer</h3>
</dd>
</dl>

<pre class="example nohighlight" title="Usage of issuer property">
<pre class="example nohighlight vc" title="Usage of issuer property"
data-vc-vm="https://example.edu/issuers/14#key-1">
{
"@context": [
"https://www.w3.org/2018/credentials/v1",
Expand All @@ -1576,8 +1585,7 @@ <h3>Issuer</h3>
"type": "BachelorDegree",
"name": "Bachelor of Science and Arts"
}
},
"proof": { <span class="comment">...</span> }
}
}
</pre>

Expand All @@ -1586,7 +1594,9 @@ <h3>Issuer</h3>
associating an object with the issuer property:
</p>

<pre class="example nohighlight" title="Usage of issuer expanded property">
<pre class="example nohighlight vc"
title="Usage of issuer expanded property"
data-vc-vm="did:example:76e12ec712ebc6f1c221ebfeb1f#key-1">
{
"@context": [
"https://www.w3.org/2018/credentials/v1",
Expand All @@ -1605,8 +1615,7 @@ <h3>Issuer</h3>
"type": "BachelorDegree",
"name": "Bachelor of Science and Arts"
}
},
"proof": { <span class="comment">...</span> }
}
}
</pre>

Expand Down Expand Up @@ -1640,7 +1649,9 @@ <h3>Issuance Date</h3>
</dd>
</dl>

<pre class="example nohighlight" title="Usage of issuanceDate property">
<pre class="example nohighlight vc"
title="Usage of issuanceDate property"
data-vc-vm="https://example.edu/issuers/14#key-1">
{
"@context": [
"https://www.w3.org/2018/credentials/v1",
Expand All @@ -1656,8 +1667,7 @@ <h3>Issuance Date</h3>
"type": "BachelorDegree",
"name": "Bachelor of Science and Arts"
}
},
"proof": { <span class="comment">...</span> }
}
}
</pre>

Expand Down Expand Up @@ -1736,17 +1746,12 @@ <h3>Proofs (Signatures)</h3>
}
},
<span class="highlight">"proof": {
"type": "RsaSignature2018",
"created": "2018-06-18T21:19:10Z",
"type": "Ed25519Signature2020",
"created": "2021-11-13T18:19:39Z",
"verificationMethod": "https://example.edu/issuers/14#key-1",
"proofPurpose": "assertionMethod",
"verificationMethod": "https://example.com/jdoe/keys/1",
"jws": "eyJhbGciOiJQUzI1NiIsImI2NCI6ZmFsc2UsImNyaXQiOlsiYjY0Il19
..DJBMvvFAIC00nSGB6Tn0XKbbF9XrsaJZREWvR2aONYTQQxnyXirtXnlewJMB
Bn2h9hfcGZrvnC1b6PgWmukzFJ1IiH1dWgnDIS81BH-IxXnPkbuYDeySorc4
QU9MJxdVkY5EL4HYbcIfwKj6X4LBQ2_ZHZIu1jdqLcRZqHcsDF5KKylKc1TH
n5VRWy5WhYg_gBnyWny8E6Qkrze53MR7OuAmmNJ1m1nN8SxDrG6a08L78J0-
Fbas5OjAQz3c17GY8mVuDPOBIOVjMEghBlgl3nOi1ysxbRGhHLEK4s0KKbeR
ogZdgt1DkQxDFxxn41QWDw_mmMCjs9qxg0zcZzqEJw"
"proofValue": "z58DAdFfa9SkqZMVPxAQpic7ndSayn1PzZs6ZjWp1CktyGesjuTSwRdo
WhAfGFCF5bppETSTojQCrfFPP2oumHKtz"
}</span>
}
</pre>
Expand Down Expand Up @@ -1782,7 +1787,9 @@ <h3>Expiration</h3>
</dd>
</dl>

<pre class="example nohighlight" title="Usage of the expirationDate property">
<pre class="example nohighlight vc"
title="Usage of the expirationDate property"
data-vc-vm="https://example.edu/issuers/14#key-1">
{
"@context": [
"https://www.w3.org/2018/credentials/v1",
Expand All @@ -1799,8 +1806,7 @@ <h3>Expiration</h3>
"type": "BachelorDegree",
"name": "Bachelor of Science and Arts"
}
},
"proof": { <span class="comment">...</span> }
}
}
</pre>

Expand Down Expand Up @@ -1852,7 +1858,9 @@ <h3>Status</h3>
privacy-enhancing.
</p>

<pre class="example nohighlight" title="Usage of the status property">
<pre class="example nohighlight vc"
title="Usage of the status property"
data-vc-vm="https://example.edu/issuers/14#key-1">
{
"@context": [
"https://www.w3.org/2018/credentials/v1",
Expand All @@ -1872,8 +1880,7 @@ <h3>Status</h3>
<span class="highlight">"credentialStatus": {
"id": "https://example.edu/status/24",
"type": "CredentialStatusList2017"
}</span>,
"proof": { <span class="comment">...</span> }
}</span>
}
</pre>

Expand Down Expand Up @@ -2274,7 +2281,9 @@ <h3>Extensibility</h3>
Let us assume we start with the <a>verifiable credential</a> shown below.
</p>

<pre class="example nohighlight" title="A simple credential">
<pre class="example nohighlight vc"
title="A simple credential"
data-vc-vm="https://example.edu/issuers/14#keys-1">
{
"@context": [
"https://www.w3.org/2018/credentials/v1",
Expand All @@ -2287,8 +2296,7 @@ <h3>Extensibility</h3>
"credentialSubject": {
"id": "did:example:abcdef1234567",
"name": "Jane Doe"
},
"proof": { <span class="comment">...</span> }
}
}
</pre>

Expand Down Expand Up @@ -2343,8 +2351,7 @@ <h3>Extensibility</h3>
"id": "did:example:abcdef1234567",
"name": "Jane Doe",
<span class="highlight">"favoriteFood": "Papaya"</span>
},
"proof": { <span class="comment">...</span> }
}
}
</pre>

Expand Down Expand Up @@ -2494,7 +2501,9 @@ <h3>Data Schemas</h3>
[[JSON-SCHEMA-2018]] validation.
</p>

<pre class="example nohighlight" title="Usage of the credentialSchema property to perform JSON schema validation">
<pre class="example nohighlight vc"
title="Usage of the credentialSchema property to perform JSON schema validation"
data-vc-vm="https://example.edu/issuers/14#keys-1">
{
"@context": [
"https://www.w3.org/2018/credentials/v1",
Expand All @@ -2514,8 +2523,7 @@ <h3>Data Schemas</h3>
<span class="highlight">"credentialSchema": {
"id": "https://example.org/examples/degree.json",
"type": "JsonSchemaValidator2018"
}</span>,
"proof": { <span class="comment">...</span> }
}</span>
}
</pre>

Expand Down Expand Up @@ -2624,7 +2632,8 @@ <h3>Refreshing</h3>
</dd>
</dl>

<pre class="example nohighlight" title="Usage of the refreshService property by an issuer">
<pre class="example nohighlight"
title="Usage of the refreshService property by an issuer">
{
"@context": [
"https://www.w3.org/2018/credentials/v1",
Expand All @@ -2644,8 +2653,7 @@ <h3>Refreshing</h3>
<span class="highlight">"refreshService": {
"id": "https://example.edu/refresh/3732"
"type": "ManualRefreshService2018",
}</span>,
"proof": { <span class="comment">...</span> }
}</span>
}
</pre>

Expand Down Expand Up @@ -2703,7 +2711,9 @@ <h3>Terms of Use</h3>
</dd>
</dl>

<pre class="example nohighlight" title="Usage of the termsOfUse property by an issuer">
<pre class="example nohighlight vc"
title="Usage of the termsOfUse property by an issuer"
data-vc-vm="https://example.edu/issuers/14#keys-1">
{
"@context": [
"https://www.w3.org/2018/credentials/v1",
Expand All @@ -2730,8 +2740,8 @@ <h3>Terms of Use</h3>
"target": "http://example.edu/credentials/3732",
"action": ["Archival"]
}]
}</span>,
"proof": { <span class="comment">...</span> }
}]
</span>
}
</pre>

Expand Down Expand Up @@ -2873,7 +2883,8 @@ <h3>Evidence</h3>
Verifiable Credentials Implementation Guidelines [[VC-IMP-GUIDE]] document.
</p>

<pre class="example nohighlight" title="Usage of the evidence property">
<pre class="example nohighlight"
title="Usage of the evidence property">
{
"@context": [
"https://www.w3.org/2018/credentials/v1",
Expand Down Expand Up @@ -4206,7 +4217,9 @@ <h3>Bearer Credentials</h3>
<a>verifiable credential</a> is a <a>bearer credential</a>:
</p>

<pre class="example nohighlight" title="Usage of issuer properties">
<pre class="example nohighlight vc"
title="Usage of issuer properties"
data-vc-vm="https://example.edu/issuers/14#keys-1">
{
"@context": [
"https://www.w3.org/2018/credentials/v1",
Expand All @@ -4222,8 +4235,7 @@ <h3>Bearer Credentials</h3>
"type": "BachelorDegree",
"name": "Bachelor of Science and Arts"
}
},
"proof": { <span class="comment">...</span> }
}
}
</pre>

Expand Down Expand Up @@ -4663,7 +4675,8 @@ <h3>Content Integrity Protection</h3>
probably should be:
</p>

<pre class="example nohighlight" title="Non-content-integrity protected links">
<pre class="example nohighlight"
title="Non-content-integrity protected links">
{
"@context": [
<span class="highlight">"https://www.w3.org/2018/credentials/v1"</span>,
Expand Down