You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Let <var>components</var> be an array of strings identifying which content (headers, etc.) to include in the signature.
425
-
<ol>
426
-
<li>Let |components| initial value be `<<"@method", "@target-uri">>`.</li>
427
-
<li>If <var>request</var>'s headers includes the `Authorization` header, append `authorization` to <var>components</var>.
428
-
<li>If <var>request</var>'s body is not `null`, append `content-length`, `content-digest` and `content-type` to <var>components</var>.
429
-
</ol>
430
-
</li>
431
423
<li>
432
424
Let <var>algorithm</var> be `ed25519`.
433
425
</li>
434
426
<li>
435
427
Let <var>privateKey</var> be the Ed25519 [=private key=].
436
428
</li>
429
+
<li>Let |keyId:string| be JWK's [=Key ID=] corresponding to |privateKey|.</li>
430
+
<li>Let |createdTimestamp:integer| represent the creation time of the signature as a UNIX timestamp value of type integer. <spanclass="note">Sub-second precision is not supported.</span></li>
437
431
<li>
438
-
Construct the canonical data for each element in <var>components</var>.
439
-
</li>
440
-
<li>
441
-
Concatenate the canonical data into a single string (or buffer).
442
-
</li>
443
-
<li>
444
-
Use `Ed25519` to sign the canonical data with <var>privateKey</var>.
445
-
</li>
446
-
<li>
447
-
Let <var>signatureValue</var> be the resulting signature, as a byte sequence.
432
+
<p>Construct the <adata-cite="RFC9421#section-1.1-7.19">|signature base|</a> as described in <adata-cite="RFC9421#name-creating-the-signature-base"></a>:</p>
433
+
<ol>
434
+
<li>Let |components| be an ordered <adata-cite="RFC8941#name-inner-lists">inner list of string values with parameters</a> to describe the <adata-cite="RFC9421#section-1.1-7.17">covered components</a> for the signature.</li>
435
+
<li>Let |components| initial value be `<<"@method", "@target-uri">>`.</li>
436
+
<li>If |request|'s headers includes the `Authorization` header, append `"authorization"` to |components|.</li>
437
+
<li>If |request|'s body is not `null`, append `"content-length"`, `"content-digest"` and `"content-type"` to |components|.</li>
438
+
<li>
439
+
Define following as parameters to |components|: the |algorithm| as `alg`, |keyId| as `keyid` and |createdTimestamp| as `created`.
440
+
</li>
441
+
<li>Serialize |components| as described in <adata-cite="RFC9421#name-creating-the-signature-base"></a> to obtain the |signature base|.</li>
<li>Let |signatureDigest| be the result of computing a digest of |signature base| using the `sha-512` algorithm.</li>
460
+
<li>Use the `Ed25519` |privateKey| to sign the |signatureDigest|.</li>
461
+
<li>
462
+
Let <var>signatureValue</var> be the resulting signature, as a byte sequence.
463
+
</li>
464
+
</ol>
448
465
</li>
466
+
449
467
<li>
450
-
Construct the `Signature-Input` header value, including the |components|, the |algorithm|, `keyid` and `created` and [=header list/append=] it to <var>request's</var> headers with name `sig1`.
451
-
<divclass="note">
452
-
<p>`keyid` represents the JWK's [=Key ID=]</a>.</p>
453
-
<p>`created` represents the creation time of the signature as a UNIX timestamp value of type Integer. Sub-second precision is not supported.</p>
454
-
</div>
468
+
Construct the `Signature-Input` header value, including the |components|, the |algorithm|, |keyId| and |createdTimestamp| and [=header list/append=] it to <var>request's</var> headers with name `sig1`.
455
469
</li>
456
470
<li>
457
471
[=Set a structured header=] with headerName `Signature`, key `sig1`, and |signatureValue| as value.
0 commit comments