This repository has been archived by the owner on Mar 4, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.html
767 lines (691 loc) · 29.1 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
<!DOCTYPE html>
<html>
<head>
<title>Linked Data Signatures 1.0</title>
<meta http-equiv='Content-Type' content='text/html;charset=utf-8'/>
<!--
=== NOTA BENE ===
For the three scripts below, if your spec resides on dev.w3 you can check them
out in the same tree and use relative links so that they'll work offline,
-->
<script src='//www.w3.org/Tools/respec/respec-w3c-common' class='remove'></script>
<script type="text/javascript" class="remove">
var respecConfig = {
// specification status (e.g. WD, LCWD, NOTE, etc.). If in doubt use ED.
specStatus: "CG-DRAFT",
// the specification's short name, as in http://www.w3.org/TR/short-name/
shortName: "ld-signatures",
// if you wish the publication date to be other than today, set this
// publishDate: "2009-08-06",
// if there is a previously published draft, uncomment this and set its YYYY-MM-DD date
// and its maturity status
// previousPublishDate: "1977-03-15",
// previousMaturity: "WD",
// if there a publicly available Editor's Draft, this is the link
edDraftURI: "https://w3c.github.io/ld-signatures/",
// if this is a LCWD, uncomment and set the end of its review period
// lcEnd: "2009-08-05",
// if you want to have extra CSS, append them to this list
// it is recommended that the respec.css stylesheet be kept
//extraCSS: ["spec.css", "prettify.css"],
// editors, add as many as you like
// only "name" is required
editors: [
{ name: "Dave Longley", url: "http://digitalbazaar.com/",
company: "Digital Bazaar", companyURL: "http://digitalbazaar.com/" },
{ name: "Manu Sporny", url: "http://digitalbazaar.com/",
company: "Digital Bazaar", companyURL: "http://digitalbazaar.com/" },
{ name: "Shane McCarron", url: "https://github.com/halindrome",
company: "Spec-Ops", companyURL: "https://www.spec-ops.io/" },
{ name: "Christopher Allen", url: "http://www.lifewithalacrity.com/",
company: "Blockstream", companyURL: "https://blockstream.com/" }
],
// authors, add as many as you like.
// This is optional, uncomment if you have authors as well as editors.
// only "name" is required. Same format as editors.
authors: [
{ name: "Dave Longley", url: "http://digitalbazaar.com/",
company: "Digital Bazaar", companyURL: "http://digitalbazaar.com/" },
{ name: "Manu Sporny", url: "http://digitalbazaar.com/",
company: "Digital Bazaar", companyURL: "http://digitalbazaar.com/" }
],
// extend the bibliography entries
//localBiblio: webpayments.localBiblio,
// name of the WG
wg: "W3C Digital Verification Community Group",
// URI of the public WG page
wgURI: "https://www.w3.org/community/digital-verification/",
// name (with the @w3c.org) of the public mailing to which comments are due
wgPublicList: "public-digital-verification",
otherLinks: [{
key: "Source control",
data: [{
value: "https://github.com/w3c/ld-signatures/",
href: "https://github.com/w3c/ld-signatures/"
}]
}, {
key: "Issue Tracker",
data: [{
value: "https://github.com/w3c/ld-signatures/issues/",
href: "https://github.com/w3c/ld-signatures/issues/"
}]
}],
// URI of the patent status for this WG, for Rec-track documents
// !!!! IMPORTANT !!!!
// This is important for Rec-track documents, do not copy a patent URI from a random
// document unless you know what you're doing. If in doubt ask your friendly neighbourhood
// Team Contact.
wgPatentURI: "",
maxTocLevel: 4,
/*preProcess: [ webpayments.preProcess ],
alternateFormats: [ {uri: "diff-20111214.html", label: "diff to previous version"} ],
*/
localBiblio: {
"RDF-DATASET-NORMALIZATION": {
title: "RDF Dataset Normalization",
href: "https://json-ld.github.io/normalization/spec/",
authors: ["David Longley", "Manu Sporny"],
status: "CGDRAFT",
publisher: "JSON-LD Community Group"
},
"SECURITY-VOCABULARY": {
title: "Security Linked Data Vocabulary",
href: "https://web-payments.org/vocabs/security",
authors: ["Manu Sporny","David Longley"],
status: "CGDRAFT",
publisher: "Web Payments Community Group"
}
}
};
</script>
<style>
ol.algorithm { counter-reset:numsection; list-style-type: none; }
ol.algorithm li { margin: 0.5em 0; }
ol.algorithm li:before { font-weight: bold; counter-increment: numsection; content: counters(numsection, ".") ") "; }
</style>
</head>
<body>
<section id='abstract'>
<p>
This specification describes a mechanism for ensuring the authenticity and
integrity of linked data documents using digital signatures.
</p>
</section>
<section id='sotd'>
<p>
This is an experimental specification and is undergoing regular revisions. It
is not fit for production deployment.
</p>
</section>
<section>
<h2>Introduction</h2>
<p>
The term Linked Data is used to describe a recommended best practice for
exposing, sharing, and connecting information on the Web using standards,
such as URLs, to identify things and their properties. When information
is presented as Linked Data, other related information can be easily discovered
and new information can be easily linked to it. Linked Data is extensible in a
decentralized way, greatly reducing barriers to large scale integration.
With the increase in usage of Linked Data for a variety of applications, there
is a need to be able to verify the authenticity and integrity of Linked Data
documents. This specification adds authentication and integrity protection to
linked data documents through the use of public/private key cryptography
without sacrificing Linked Data features such as extensibility and
composability.
</p>
</section>
<section>
<h2>Design Goals and Rationale</h2>
<p>
The Linked Data Signature specification achieves the following design goals:
</p>
<dl>
<dt>Simple for Developers</dt>
<dd>
The signature format is designed to be easy to use for developers that don't
have significant cryptography training. For example, <a>signature suite</a> identifiers
are used instead of specific cryptographic parameters to ensure that it is
difficult to accidentally produce a weak digital signature.
</dd>
<dt>Syntax Agnostic</dt>
<dd>
The signature mechanism can be used across a variety of RDF data syntaxes such
as JSON-LD, N-Quads, and TURTLE, without the need to regenerate the signature.
</dd>
<dt>Agile</dt>
<dd>
Since digital signature suites may be compromised without warning due to
technological advancements, it is important that suites can be easily and
quickly replaced. This specification provides algorithm agility while still
keeping the digital signature format easy for developers to understand.
</dd>
<dt>Extensible</dt>
<dd>
Creating and deploying new signature suites is a fairly trivial undertaking
to ensure that the signature format increases the rate of innovation in the
digital signature space.
</dd>
</dl>
</section>
<section>
<h2>Terminology</h2>
<p>
The following terms are used to describe concepts involved in the
generation and verification of Linked Data digital signatures.
</p>
<dl>
<dt><dfn>linked data document</dfn></dt>
<dd>
A document comprised of Linked Data.
</dd>
<dt><dfn>signed linked data document</dfn></dt>
<dd>
A <a>linked data document</a> that has been digitally signed.
</dd>
<dt><dfn>linked data signature</dfn></dt>
<dd>
A set of attributes that represent a Linked Data digital signature and
the parameters required to verify it.
</dd>
<dt><dfn>signature options</dfn></dt>
<dd>
A set of options that is included in the signature data. These options may
be a <a>domain</a>, <a>nonce</a>, or other data that is specific to the
signature format.
</dd>
<dt><dfn>signature suite</dfn></dt>
<dd>
A specified set of cryptographic primitives typically consisting of
a canonicalization algorithm, a message digest algorithm, and a signature
algorithm that are bundled together by cryptographers for developers
for the purposes of safety and convenience.
</dd>
<dt><dfn>public key</dfn></dt>
<dd>
A cryptographic key that can be used to verify digital signatures created
with a corresponding <a>private key</a>.
</dd>
<dt><dfn>private key</dfn></dt>
<dd>
A cryptographic key that can be used to generate digital signatures.
</dd>
<dt><dfn>domain</dfn></dt>
<dd>
A string value that specifies the operational domain of a digital signature.
This may be an Internet domain name like <code>example.com</code>, a
ad-hoc value such as <code>mycorp-level3-access</code>, or a very
specific transaction value like <code>8zF6T$mqP</code>. A signer may
include a <a>domain</a> in its digital signature to restrict its use
to particular target, identified by the specified <a>domain</a>.
</dd>
<dt><dfn>canonicalization algorithm</dfn></dt>
<dd>
An algorithm that takes an input document that has more than one possible
representation and always transforms it into a canonical form. This process is
sometimes also called CANONICALIZATION.
</dd>
<dt><dfn>message digest algorithm</dfn></dt>
<dd>
An algorithm that takes an input message and produces a cryptographic
output message that is often many orders of magnitude smaller than the
input message. These algorithms are often 1) very fast, 2)
non-reversible, 3) cause the output to change significantly when even one
bit of the input message changes, and 4) make it infeasible to find two
different inputs for the same output.
</dd>
<dt><dfn>signature algorithm</dfn></dt>
<dd>
An algorithm that takes an input message and produces an output value where the
receiver of the message can mathematically verify that the message has not
been modified in transit and came from someone possessing a particular secret.
</dd>
</dl>
</section>
<section>
<h2>Linked Data Signature Overview</h2>
<p>
A <a>linked data signature</a> is comprised of information about the
signature, parameters required to verify it, and the signature value itself.
All of this information is provided using Linked Data vocabularies such as the
[[!SECURITY-VOCABULARY]].
</p>
<p>
A <a>linked data signature</a> typically includes at least the
following attributes:
</p>
<dl style="margin-left: 1em;">
<dt>type (required)<dt>
<dd>
A URI that identifies the digital <a>signature suite</a> that was used to create the
signature. For example: <code>RsaSignature2017</code>.</dd>
<dt>creator (required)<dt>
<dd>
A URI that identifies the public/private key pair associated with the
signature. The URI SHOULD be a URL that can be dereferenced to obtain a
<a>linked data document</a> that contains a link identifying the entity that
owns the key pair. Dereferencing the entity link SHOULD result in a Linked Data
document that contains a link back to the URL identifier for the
public/private key pair, thereby proving ownership.
</dd>
<dt><dfn>created</dfn> (required)<dt>
<dd>
The string value of an [[!ISO8601]] combined date and time string generated
by the <a href="#signature-algorithm">Signature Algorithm</a>.
</dd>
<dt>domain (optional)<dt>
<dd>
A string value specifying the restricted <a>domain</a> of the signature.
</dd>
<dt><dfn>nonce</dfn> (optional, but strongly recommended)<dt>
<dd>
A string value that is included in the digital signature and MUST only be
used once for a particular <a>domain</a> and window of time. This
value is used to mitigate replay attacks.
</dd>
<dt><dfn>signatureValue</dfn> (required)<dt>
<dd>
The value of the <em>signature value</em> generated by the
<a href="#signature-algorithm">Signature Algorithm</a>.
</dd>
</dl>
<p class="note">
Since this specification is based on Linked Data, the terms <code>type</code>,
<code>creator</code>, <code>created</code>, <code>domain</code>,
<code>nonce</code>, and <code>signatureValue</code> above
map to URLs. The vocabulary where these terms are defined is the
[[SECURITY-VOCABULARY]].
</p>
<p>
A signature can be added to a Linked Data document like the following:
</p>
<pre class="example highlight" title="A simple Linked Data document">
{
"@context": "https://w3id.org/identity/v1",
"title": "Hello World!"
}
</pre>
<p>
by adding the parameters outlined in this section:
</p>
<pre class="example highlight" title="A simple signed Linked Data document">
{
"@context": "https://w3id.org/identity/v1",
"title": "Hello World!",
"signature": {
"type": "RsaSignature2017",
"creator": "https://example.com/i/pat/keys/5",
"created": "2017-09-23T20:21:34Z",
"domain": "example.org",
"nonce": "2bbgh3dgjg2302d-d2b3gi423d42",
"signatureValue": "eyJ0eXAiOiJK...gFWFOEjXk"
}
}
</pre>
<p>
The signature example above uses the <code>RsaSignature2017</code>
<a>signature suite</a> to produce a verifiable digital signature.
</p>
<div class="issue">Create a separate section detailing an optional mechanism
for authenticating public key ownership via bi-directional links. How
to establish trust in key owner entities is out of scope but examples can
be given.</div>
<div class="issue">Specify algorithm agility mechanisms (additional attributes
from the security vocab can be used to indicate other signing and hash
algorithms). Rewrite algorithms to be parameterized on this basis and
move `RsaSignature2017` definition to a single supported
mechanism; specify its identifier as a URL. In order to make it easy to
specify a variety of combinations of algorithms, introduce a core
type `LinkedDataSignature` that allows for easy filtering/discover of
signature nodes, but that type on its own doesn't specify any default
signature or hash algorithms, those must be given via other properties in the
nodes.</div>
<div class="issue">Add a note indicating that this specification should not
be construed to indicate that public key owners should be restricted to a
single public key or that systems that use this spec and involve real people
should identify each person as only ever being a single entity rather than
perhaps N entities with M keys. There are no such restrictions and in many
cases those kinds of restrictions are ill-advised due to privacy
considerations.</div>
<div class="issue">Add an explicit check on key type to prevent an
attacker from selecting an algorithm that may abuse how the key is
used/interpreted.</div>
<div class="issue">Add a note indicating that selective disclosure signature
mechanisms can be compatible with Linked Data Signatures; for example,
an algorithm could produce a merkle tree from a canonicalized set of
N-Quads and then sign the root hash. Disclosure would involve including
the merkle paths for each N-Quad that is to be revealed. This mechanism
would merely consume the normalized output differently (this, and the
proof mechanism would be modifications to this core spec). It may also
be necessary to generate signature parameters such as a private key/seed
that can be used along with an algorithm to deterministically generate
nonces that are concatenated with each N-Quad to prevent rainbow
table or similar attacks.</div>
</section>
<section>
<h2>Multiple Signatures</h2>
<p>
The Linked Data Signatures specification supports the concept of multiple
signatures in a single document. There are two types of multi-signature
approaches that are identified: Signature Sets and Signature Chains.
</p>
<section>
<h3>Signature Sets</h3>
<p>
A signature set is useful when the same data needs to be signed by multiple
entities, but where the order of signatures does not matter,
such as in the case of a set of signatures on a contract. A signature set,
which has no order, is represented by associating a set of signatures
with the <code>signature</code> key in a document.
</p>
<pre class="example highlight" title="A signature set in a Linked Data document">
{
"@context": "https://w3id.org/identity/v1",
"title": "Hello World!",
"signature": [{
"type": "RsaSignature2017",
"creator": "https://example.com/i/pat/keys/5",
"created": "2017-09-23T20:21:34Z",
"domain": "example.org",
"nonce": "2bbgh3dgjg2302d-d2b3gi423d42",
"signatureValue": "eyJ0eXAiOiJK...gFWFOEjXk"
}, {
"type": "RsaSignature2017",
"creator": "https://example.com/i/kelly/keys/7f3j",
"created": "2017-09-23T20:24:12Z",
"domain": "example.org",
"nonce": "83jj4hd62j49gk38",
"signatureValue": "eyiOiJJ0eXAK...EjXkgFWFO"
}]
}
</pre>
</section>
<section>
<h3>Signature Chains</h3>
<p>
A signature chain is useful when the same data needs to be signed by
multiple entities and the order of when the signatures occurred matters,
such as in the case of a notary counter-signing a signature that had been
created on a document. A signature chain, where order must be preserved, is
represented by associating an ordered list of signatures with the
<code>signatureChain</code> key in a document.
</p>
<pre class="example highlight" title="A signature chain in a Linked Data document">
{
"@context": "https://w3id.org/identity/v1",
"title": "Hello World!",
"signatureChain": [{
"type": "RsaSignature2017",
"creator": "http://example.com/i/pat/keys/5",
"created": "2017-09-23T20:21:34Z",
"domain": "example.org",
"nonce": "2bbgh3dgjg2302d-d2b3gi423d42",
"signatureValue": "eyiOiJKJ0eXA...OEjgFWFXk"
}, {
"type": "RsaSignature2017",
"creator": "http://bank.example.com/notary/keys/7f3j",
"created": "2017-09-23T20:24:12Z",
"domain": "example.org",
"nonce": "83jj4hd62j49gk38",
"signatureValue": "eyiOiJJ0eXAK...EjXkgFWFO"
}]
}
</pre>
</section>
</section>
<section>
<h2>Signature Suites</h2>
<p>
A Linked Data Signature is designed to be easy to use by developers and
therefore strives to minimize the amount of information one has to remember
to generate a signature. Often, just the <a>signature suite</a> name (e.g.
<code>RsaSignature2017</code>) is required
from developers to initiate the creation of a signature. These signature
suites are often created or reviewed by people that have the requisite
cryptographic training to ensure that safe combinations of cryptographic
primitives are used.
</p>
<p>
This section details the cryptographic primitives that are available to
<a>signature suite</a> developers.
</p>
<p>
At a minimum, a <a>signature suite</a> must have the
following attributes:
</p>
<dl style="margin-left: 1em;">
<dt>id</dt>
<dd>
A URL that identifies the <a>signature suite</a>.
For example: <code>https://w3id.org/security#RsaSignature2017</code>.
</dd>
<dt>type</dt>
<dd>
The value <code>SignatureSuite</code>.
</dd>
<dt>canonicalizationAlgorithm</dt>
<dd>
A URL that identifies the <a>canonicalization algorithm</a> to use on the
<var>document</var>. For example:
<code>https://w3id.org/security#GCA2015</code>.
</dd>
<dt>digestAlgorithm</dt>
<dd>
A URL that identifies the <a>message digest algorithm</a> to use on the
<var>canonicalized document</var>. For example:
<code>https://registry.ietf.org/ietf-digest-algorithms#SHA256</code>
</dd>
<dt>signatureAlgorithm</dt>
<dd>
A URL that identifies the <a>signature algorithm</a> to use on the
<var>data to be signed</var>. For example:
<code>https://registry.ietf.org/ietf-jose-jws-algorithms#RS256</code>
</dd>
</dl>
<p>
A complete example of a <a>signature suite</a> is shown in the next example:
</p>
<pre class="example highlight">
{
"id": "https://w3id.org/security#RsaSignature2017",
"type": "SignatureSuite",
"canonicalizationAlgorithm": "https://w3id.org/security#GCA2015",
"digestAlgorithm": "https://registry.ietf.org/ietf-digest-algorithms#SHA256",
"signatureAlgorithm": "https://registry.ietf.org/ietf-jose-jws-algorithms#RS256"
}
</pre>
</section>
<section>
<h2>Algorithms</h2>
<p>
The algorithms defined below are generalized in that they require a specific
<a>canonicalization algorithm</a>, <a>message digest algorithm</a>, and
<a>signature algorithm</a> to be used to achieve the algorithm's intended
outcome.
</p>
<section>
<h3>Signature Algorithm</h3>
<div class="issue">The signature parameters should be included as headers
and values in the data to be signed.</div>
<p>
The following algorithm specifies how to create a digital signature that can
be later used to verify the authenticity and integrity of a
<a>linked data document</a>. A <a>linked data document</a>,
<var>document</var>, <a>signature options</a>, <var>options</var>,
and a <a>private key</a>, <var>privateKey</var>, are required inputs.
The <a>signature options</a> MUST contain an identifier for the
public/private key pair, <var>creator</var>, and an ISO8601 combined date and
time string, <var>created</var>, containing the current date and time,
accurate to at least one second, in Universal Time Code format. A <a>nonce</a>
and a <a>domain</a> may also be specified in the <var>options</var>. A
<a>signed linked data document</a> is produced as output. Whenever this
algorithm encodes strings, it MUST use UTF-8 encoding.
</p>
<ol class="algorithm">
<li>
Create a copy of <var>document</var>, hereafter referred to as <var>output</var>.
</li>
<li>
Generate a <var>canonicalized document</var> by canonicalizing
<var>document</var> according to a <a>canonicalization algorithm</a>
(e.g. the <em>GCA2015</em> [[!RDF-DATASET-NORMALIZATION]] algorithm).
</li>
<li>
Create a value <var>tbs</var> that represents the data to be signed, and
set it to the result of running the
<a href="#create-verify-hash-algorithm">Create Verify Hash Algorithm</a>,
passing the information in <var>options</var>.
</li>
<li>
Digitally sign <var>tbs</var> using the <var>privateKey</var> and the
the <var>digital signature algorithm</var> (e.g. JSON Web Signature using
<em>RSASSA-PKCS1-v1_5</em> algorithm). The resulting string is the
<a>signatureValue</a>.
</li>
<li>
Add a <code>signature</code> node to <var>output</var> containing
a <a>linked data signature</a> using the appropriate
<var>type</var> and <a>signatureValue</a> values as well as
all of the data in the <var>signature options</var> (e.g.
<var>creator</var>, <var>created</var>, and if given, any additional signature
options such as <a>nonce</a> and <a>domain</a>).
</li>
<li>
Return <var>output</var> as the <a>signed linked data document</a>.
</li>
</ol>
</section>
<section>
<h3>Signature Verification Algorithm</h3>
<p>
The following algorithm specifies how to check the authenticity and
integrity of a <a>signed linked data document</a> by verifying its
digital signature. This algorithm takes a
<a>signed linked data document</a>, <var>signed document</var> and
outputs a <code>true</code> or <code>false</code> value based on whether or
not the digital signature on <var>signed document</var> was verified. Whenever
this algorithm encodes strings, it MUST use UTF-8 encoding.
</p>
<div class="issue">Specify how the public key can be obtained (through
some out-of-band process and passed in or it can be retrieved by
derefencing its URL identifier, etc.</div>
<ol class="algorithm">
<li>
Get the <a>public key</a> by dereferencing its URL identifier in
the <code>signature</code> node of the default graph of
<var>signed document</var>. Confirm that the <a>linked data document</a>
that describes the <a>public key</a> specifies its owner and that its
owner's URL identifier can be dereferenced to reveal a bi-directional link back
to the key. Ensure that the key's owner is a trusted entity before proceeding
to the next step.
</li>
<li>
Let <var>document</var> be a copy of <var>signed document</var>.
</li>
<li>
Remove any <code>signature</code> nodes from the default graph in
<var>document</var> and save it as <var>signature</var>.
</li>
<li>
Generate a <var>canonicalized document</var> by canonicalizing
<var>document</var> according to the <a>canonicalization algorithm</a>
(e.g. the </var><em>GCA2015</em> [[!RDF-DATASET-NORMALIZATION]] algorithm).
</li>
<li>
Create a value <var>tbv</var> that represents the data to be verified, and
set it to the result of running the
<a href="#create-verify-hash-algorithm">Create Verify Hash Algorithm</a>,
passing the information in <var>signature</var>.
</li>
<li>
Pass the <a>signatureValue</a>, <var>tbv</var>,
and the <a>public key</a> to the <a>signature algorithm</a>
(e.g. JSON Web Signature using <em>RSASSA-PKCS1-v1_5</em> algorithm).
Return the resulting boolean value.
</li>
</ol>
</section>
<section>
<h3>Create Verify Hash Algorithm</h3>
<p>
The following algorithm specifies how to create the data that is used
to generate or verify a digital signature. It takes a canonicalized
<a>linked data document</a>, <var>canonicalized document</var>,
<a>canonicalization algorithm</a>, a <a>message digest algorithm</a>, and
<a>signature options</a>, <var>input options</var> (by reference).
The <a>signature options</a> MUST contain an identifier for the
public/private key pair, <var>creator</var>, and an ISO8601 combined date and
time string, <var>created</var>, containing the current date and time,
accurate to at least one second, in Universal Time Code format. A <a>nonce</a>
and a <a>domain</a> may also be specified in the <var>options</var>.
Its output is a message digest that can be used to generate or
verify a digital signature.
</p>
<ol class="algorithm">
<li>
Let <var>options</var> be a copy of <var>input options</var>.
</li>
<li>
If <code>type</code>, <code>id</code>, or <code>signatureValue</code>
exists in <var>options</var>, remove the entry.
</li>
<li>
If <var>created</var> does not exist in <var>options</var>, add an
entry with a value that is an ISO8601 combined date and
time string containing the current date and time accurate to at least one
second, in Universal Time Code format. For example:
<code>2017-11-13T20:21:34Z</code>.
</li>
<li>
Generate <var>output</var> by:
<ol class="algorithm">
<li>
Creating a <var>canonicalized options document</var> by canonicalizing
<var>options</var> according to the <a>canonicalization algorithm</a>
(e.g. the <em>GCA2015</em> [[!RDF-DATASET-NORMALIZATION]] algorithm).
</li>
<li>
Hash <var>canonicalized options document</var> using the
<a>message digest algorithm</a> (e.g. SHA-256) and set <var>output</var>
to the result.
</li>
<li>
Hash <var>canonicalized document</var> using the <a>message digest algorithm</a>
(e.g. SHA-256) and append it to <var>output</var>.
</li>
</ol>
</li>
<li>
Hash <var>output</var> using the <a>message digest algorithm</a>
(e.g. SHA-256) and replace it with the result.
</li>
<li>
Return <var>output</var>.
</li>
</ol>
</section>
</section>
<section>
<h2>Security Considerations</h2>
<p>
The following section describes security considerations that developers
implementing this specification should be aware of in order to create secure
software.
</p>
<div class="issue">TODO: We need to add a complete list of security
considerations.</div>
</section>
<section class="appendix">
<h2>GraphSignature2012</h2>
<p>A previous version of this specification has light deployment. For
purposes of identification, the algorithm is identified as
<a href="">GraphSignature2012</a> and its algorithms differ from the
stated algorithm in the following ways:</p>
<div class="issue">Specify GraphSignature2012 differences.</div>
<!--
<ul>
<li>
</li>
</ul> -->
</section>
</body>
</html>