-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdraft-ietf-jose-json-web-signature-14.xml
4947 lines (4639 loc) · 207 KB
/
draft-ietf-jose-json-web-signature-14.xml
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
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd">
<?xml-stylesheet type='text/xsl' href='http://xml.resource.org/authoring/rfc2629.xslt' ?>
<?rfc toc="yes"?>
<?rfc tocompact="yes"?>
<?rfc tocdepth="4"?>
<?rfc tocindent="yes"?>
<?rfc symrefs="yes"?>
<?rfc sortrefs="yes"?>
<?rfc comments="yes"?>
<?rfc inline="yes"?>
<?rfc compact="yes"?>
<?rfc subcompact="no"?>
<rfc category="std" ipr="trust200902" docName="draft-ietf-jose-json-web-signature-14">
<front>
<title>JSON Web Signature (JWS)</title>
<author fullname="Michael B. Jones" initials="M.B." surname="Jones">
<organization>Microsoft</organization>
<address>
<email>[email protected]</email>
<uri>http://self-issued.info/</uri>
</address>
</author>
<author fullname="John Bradley" initials="J." surname="Bradley">
<organization abbrev="Ping Identity">Ping Identity</organization>
<address>
<email>[email protected]</email>
</address>
</author>
<author fullname="Nat Sakimura" initials="N." surname="Sakimura">
<organization abbrev="NRI">Nomura Research Institute</organization>
<address>
<email>[email protected]</email>
</address>
</author>
<date day="29" month="July" year="2013" />
<area>Security</area>
<workgroup>JOSE Working Group</workgroup>
<keyword>RFC</keyword>
<keyword>Request for Comments</keyword>
<keyword>I-D</keyword>
<keyword>Internet-Draft</keyword>
<keyword>JavaScript Object Notation</keyword>
<keyword>JSON</keyword>
<keyword>JSON Object Signing and Encryption</keyword>
<keyword>JOSE</keyword>
<keyword>JSON Web Signature</keyword>
<keyword>JWS</keyword>
<keyword>JSON Web Encryption</keyword>
<keyword>JWE</keyword>
<keyword>JSON Web Key</keyword>
<keyword>JWK</keyword>
<keyword>JSON Web Algorithms</keyword>
<keyword>JWA</keyword>
<abstract>
<t>
JSON Web Signature (JWS)は, JavaScript Object Notation (JSON)をベースとしたデータ構造を用いて, デジタル署名やMessage Authentication Codes (MACs)により保護されたコンテンツを表現するための手段である.
本仕様で使用する暗号アルゴリズムと識別子はJSON Web Algorithms (JWA) で述べられている.
関連する暗号化の機能は, JSON Web Encryption (JWE) で述べられている.
</t>
<!--
<t>
JSON Web Signature (JWS) is a means of
representing content secured with digital signatures or
Message Authentication Codes (MACs)
using JavaScript Object Notation (JSON) based data structures.
Cryptographic algorithms and identifiers for use with this
specification are described in the separate
JSON Web Algorithms (JWA) specification.
Related encryption capabilities are described in the separate
JSON Web Encryption (JWE) specification.
</t>
-->
</abstract>
</front>
<middle>
<section title="Introduction" anchor="Introduction">
<t>
JSON Web Signature (JWS)は, JavaScript Object Notation (JSON) <xref target="RFC4627"/> をベースとしたデータ構造を用いて, デジタル署名やMessage Authentication Codes (MACs)により保護されたコンテンツを表現するための手段である.
JWSの暗号化メカニズムは任意のオクテット列に対して完全性保護を提供する.
</t>
<!--
<t>
JSON Web Signature (JWS) is a means of
representing content secured with digital signatures or
Message Authentication Codes (MACs)
using JavaScript Object Notation (JSON) <xref target="RFC4627"/>
based data structures.
The JWS cryptographic mechanisms provide integrity protection for
arbitrary sequences of octets.
</t>
-->
<t>
JWSオブジェクトのために2つの密接に関連する表現が定義されている.
JWS Compact Serializationはコンパクトであり, HTTP Authorization ヘッダやURIクエリパラメータのようなスペースが制約された環境を意図したURL-safeな表現である.
JWS JSON SerializationはJSONオブジェクトとしてJWSオブジェクトを表現し, 同じコンテンツに対して複数の署名とMACsの両方, またはいずれかを適用することができる.
両方とも, 同じ暗号基盤を共有する.
</t>
<!--
<t>
Two closely related representations for JWS objects are defined.
The JWS Compact Serialization is a compact, URL-safe representation
intended for space constrained environments such as HTTP
Authorization headers and URI query parameters.
The JWS JSON Serialization represents JWS objects as JSON objects and
enables multiple signatures and/or MACs to be applied to the same content.
Both share the same cryptographic underpinnings.
</t>
-->
<t>
本仕様で使用する暗号アルゴリズムと識別子はJSON Web Algorithms (JWA) <xref target="JWA" />で述べられている.
関連する暗号化の機能は, JSON Web Encryption (JWE) <xref target="JWE" />で述べられている.
</t>
<!--
<t>
Cryptographic algorithms and identifiers for use with this
specification are described in the separate
JSON Web Algorithms (JWA) <xref target="JWA" /> specification.
Related encryption capabilities are described in the separate
JSON Web Encryption (JWE) <xref target="JWE" /> specification.
</t>
-->
<section title="Notational Conventions" anchor="NotationalConventions">
<t>
本仕様で用いられる各キーワード「MUST (しなければならない)」, 「MUST NOT (してはならない)」, 「REQUIRED (必須である)」, 「SHALL (するものとする)」, 「SHALL NOT (しないものとする)」, 「SHOULD (すべきである)」, 「SHOULD NOT (すべきではない)」, 「RECOMMENDED (推奨される)」, 「MAY (してもよい)」, 「OPTIONAL (任意である)」は <xref target='RFC2119' /> で述べられている通りに解釈されるべきものである.
</t>
<!--
<t>
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL",
"SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY",
and "OPTIONAL" in this document are to be interpreted as
described in
Key words for use in RFCs to Indicate Requirement Levels <xref target='RFC2119' />.
</t>
-->
</section>
</section>
<section title="Terminology" anchor="Terminology">
<t>
<list style="hanging">
<t hangText="JSON Web Signature (JWS)">
デジタル署名もしくはMAC化されたメッセージを表現するデータ構造.
JWSは以下の3つの値より構成される:
JWS ヘッダ,
JWS ペイロード,
JWS 署名
</t>
<!--
<t hangText="JSON Web Signature (JWS)">
A data structure representing a digitally signed or MACed message.
The structure represents three values:
the JWS Header,
the JWS Payload, and
the JWS Signature.
</t>
-->
<t hangText="JSON Text Object (JSON テキストオブジェクト)">
JSONオブジェクトを表現するUTF-8 <xref target="RFC3629"/>でエンコードされた文字列.
JSONオブジェクトの構文は<xref target="RFC4627"/>のSection 2.2で定義されている.
</t>
<!--
<t hangText="JSON Text Object">
A UTF-8 <xref target="RFC3629"/>
encoded text string representing a JSON object;
the syntax of JSON objects is defined in
Section 2.2 of <xref target="RFC4627"/>.
</t>
-->
<t hangText="JWS Header (JWS ヘッダ)">
JWS 署名値を作成するために使用したデジタル署名やMACの操作を説明するJSONテキストオブジェクト(もしくはJWS JSON Serializationを用いたJSONテキストオブジェクト).
JWS ヘッダオブジェクトのメンバは後述の "ヘッダパラメータ" である.
</t>
<!--
<t hangText="JWS Header">
A JSON Text Object
(or JSON Text Objects, when using the JWS JSON Serialization)
that describes the
digital signature or MAC operation applied to
create the JWS Signature value.
The members of the JWS Header object(s) are Header Parameters.
</t>
-->
<t hangText="JWS Payload (JWS ペイロード)">
保護対象となるオクテット列であり, メッセージとも呼ばれる.
ペイロードは任意のオクテット列を含むことが出来る.
</t>
<!--
<t hangText="JWS Payload">
The sequence of octets to be secured - a.k.a., the message.
The payload can contain an arbitrary sequence of octets.
</t>
-->
<t hangText="JWS Signature (JWS 署名)">
JWS プロテクトヘッダとJWS ペイロードの完全性を保証する暗号論的情報からなるオクテット列.
JWS 署名値はJWS ヘッダで指定されたパラメータを使いJWS署名入力から計算されたデジタル署名やMACの値である.
</t>
<!--
<t hangText="JWS Signature">
A sequence of octets containing the cryptographic material that
ensures the integrity of
the JWS Protected Header
and the JWS Payload.
The JWS Signature value is a digital signature or MAC value
calculated over the JWS Signing Input using the parameters
specified in the JWS Header.
</t>
-->
<t hangText="JWS Protected Header (JWS プロテクトヘッダ)">
JWS ヘッダのうち完全性が保護された部分にあたる JSON テキストオブジェクト.
JWS Compact Serialization では, JWS ヘッダ全体が JWS プロテクトヘッダとなる.
JWS JSON Serialization では, JWS プロテクトヘッダは JWS ヘッダ全体のうちの一部である.
</t>
<!--
<t hangText="JWS Protected Header">
A JSON Text Object that contains the portion of the
JWS Header that is integrity protected.
For the JWS Compact Serialization, this comprises the entire JWS Header.
For the JWS JSON Serialization, this is one component of the JWS Header.
</t>
-->
<t hangText="Header Parameter (ヘッダパラメータ)">
JWSヘッダのメンバである名前と値のペア.
</t>
<!--
<t hangText="Header Parameter">
A name/value pair that is member of the JWS Header.
</t>
-->
<t hangText="Header Parameter Name (ヘッダパラメータ名)">
JWSヘッダのメンバの名前.
</t>
<!--
<t hangText="Header Parameter Name">
The name of a member of the JWS Header.
</t>
-->
<t hangText="Header Parameter Value (ヘッダパラメータ値)">
JWSヘッダのメンバの値.
</t>
<!--
<t hangText="Header Parameter Value">
The value of a member of the JWS Header.
</t>
-->
<t hangText="Base64url Encoding">
<xref target="RFC4648">RFC 4648</xref>のSection 3.2で許可されているように, Section 5で述べられているURL-safeでない穴埋め文字'='を除いた, URL-safeかつfilename-safeであるBase64エンコーディング. (穴埋めなしのbase64urlエンコーディングの実装に関する注意事項については<xref target="base64urlnotes" />を参照.)
</t>
<!--
<t hangText="Base64url Encoding">
The URL- and filename-safe Base64 encoding
described in <xref target="RFC4648">RFC 4648</xref>,
Section 5, with the (non URL-safe) '=' padding characters
omitted, as permitted by Section 3.2. (See <xref
target="base64urlnotes" /> for notes on implementing
base64url encoding without padding.)
</t>
-->
<t hangText="Encoded JWS Header (エンコード済 JWS ヘッダ)">
Base64urlでエンコードされたJWS プロテクトヘッダ.
</t>
<!--
<t hangText="Encoded JWS Header">
Base64url encoding of the JWS Protected Header.
</t>
-->
<t hangText="Encoded JWS Payload (エンコード済 JWS ペイロード)">
Base64urlでエンコードされたJWS ペイロード.
</t>
<!--
<t hangText="Encoded JWS Payload">
Base64url encoding of the JWS Payload.
</t>
-->
<t hangText="Encoded JWS Signature (エンコード済 JWS 署名)">
Base64urlでエンコードされたJWS 署名.
</t>
<!--
<t hangText="Encoded JWS Signature">
Base64url encoding of the JWS Signature.
</t>
-->
<t hangText="JWS Signing Input (JWS署名入力)">
エンコード済JWSヘッダ, ピリオド('.'), およびエンコード済JWSペイロードを連結したもの.
</t>
<!--
<t hangText="JWS Signing Input">
The concatenation of the Encoded JWS Header, a period ('.')
character, and the Encoded JWS Payload.
</t>
-->
<t hangText="JWS Compact Serialization">
エンコード済JWS ヘッダ, エンコード済JWS ペイロード, エンコード済JWS 署名を順番通りに, 3つの文字列を2つのピリオド('.')で区切り連結したJWSの表現.
この表現はコンパクトでありURL-safeである.
</t>
<!--
<t hangText="JWS Compact Serialization">
A representation of the JWS as the concatenation of
the Encoded JWS Header,
the Encoded JWS Payload, and
the Encoded JWS Signature
in that order, with the three strings being separated
by two period ('.') characters.
This representation is compact and URL-safe.
</t>
-->
<t hangText="JWS JSON Serialization">
JWS ヘッダ, エンコード済 JWS ペイロード, エンコード済 JWS 署名値で構成される JSON 構造による JWS の表現.
JWS Compact Serializationと異なり, JWS JSON Serializationは同じコンテンツに対して複数の署名とMACsの両方, またはいずれかを適用することができる.
この表現はコンパクトでもなくURL-safeでもない.
</t>
<!--
<t hangText="JWS JSON Serialization">
A representation of the JWS as a JSON structure containing
JWS Header,
Encoded JWS Payload, and
Encoded JWS Signature values.
Unlike the JWS Compact Serialization,
the JWS JSON Serialization
enables multiple digital signatures and/or MACs to
be applied to the same content.
This representation is neither compact nor URL-safe.
</t>
-->
<t hangText="Collision Resistant Namespace">
他の名前と衝突することが極めて低くなるように名前を割り当てることを可能にする名前空間.
例えば, 衝突耐性は名前空間の部分の管理を委譲することで, または衝突耐性のある名前割り当て関数を利用することで実現できる.
Collision Resistant Namespaceの例:
ドメイン名,
ITU-T X.660とX.670 Recommendation seriesで定義されたObject Identifiers (OIDs),
Universally Unique IDentifiers (UUIDs)
<xref target="RFC4122"/>.
管理上委譲された名前空間を使用する場合, 名前を定義する際に, 名前を定義するために使用する名前空間の一部を制限していることを保証するために適切な注意を払う必要がある.
</t>
<!--
<t hangText="Collision Resistant Namespace">
A namespace that allows names to be allocated in a manner
such that they are highly unlikely to collide with other names.
For instance, collision resistance can be achieved through
administrative delegation of portions of the namespace or
through use of collision-resistant name allocation functions.
Examples of Collision Resistant Namespaces include:
Domain Names,
Object Identifiers (OIDs) as defined in the ITU-T X.660
and X.670 Recommendation series, and
Universally Unique IDentifiers (UUIDs)
<xref target="RFC4122"/>.
When using an administratively delegated namespace,
the definer of a name needs to take
reasonable precautions to ensure they are in control of
the portion of the namespace they use to define the name.
</t>
-->
<t hangText="StringOrURI">
以下の制約を設けたJSON文字列. 任意の文字列値を使用してよい(MAY)が, ":"を含む文字列はURI<xref target="RFC3986"/>でなければならない(MUST).
StringOrURIの値は変換や正規化は適用されず, 比較時には大文字・小文字を区別する.
</t>
<!--
<t hangText="StringOrURI">
A JSON string value, with the additional requirement that
while arbitrary string values MAY be used, any value
containing a ":" character MUST be a URI
<xref target="RFC3986"/>.
StringOrURI values are compared as case-sensitive strings
with no transformations or canonicalizations applied.
</t>
-->
</list>
</t>
</section>
<section title="JSON Web Signature (JWS) Overview" anchor="Overview">
<t>
JWSはJSONデータ構造とbase64urlエンコーディングを用いてデジタル署名, もしくはMACを行ったコンテンツを表現する.
JWSでは次の3つの値が表現される:
JWSヘッダ,
JWSペイロード,
JWS署名.
Compact Serializationでは3つの値はデータ転送のためにBase64urlでエンコードされ, またエンコードされた文字列を順番通りに, 3つの文字列を2つのピリオド('.')で区切って連結したものとして表現される.
JSON Serializationの情報は<xref target="JSONSerialization"/>で定義されている.
</t>
<!--
<t>
JWS represents digitally signed or MACed content using JSON data
structures and base64url encoding.
Three values are represented in a JWS:
the JWS Header,
the JWS Payload, and
the JWS Signature.
In the Compact Serialization, the three values are
base64url-encoded for transmission, and represented
as the concatenation of the encoded strings in that order,
with the three strings being separated by two period ('.') characters.
A JSON Serialization for this information is also defined in
<xref target="JSONSerialization"/>.
</t>
-->
<t>
JWSヘッダは採用した署名もしくはMACの手法とパラメータを記述する.
JWSペイロードは保護対象となるメッセージコンテンツである.
JWS署名はJWSプロテクトヘッダとJWSヘッダ両方の完全性を保証する.
</t>
<!--
<t>
The JWS Header describes the signature or MAC method and parameters employed.
The JWS Payload is the message content to be secured.
The JWS Signature ensures the integrity of
both the JWS Protected Header and the JWS Payload.
</t>
-->
<section title="Example JWS" anchor="ExampleJWS">
<t>
以下に示す例では, JWSヘッダはエンコードされたオブジェクトがJSON Web Token (JWT) <xref target="JWT" />であり, JWSヘッダとJWSペイロードがHMAC SHA-256アルゴリズムで保護されていることを示している:
</t>
<!--
<t>
The following example JWS Header declares that the
encoded object is a JSON Web Token (JWT) <xref target="JWT" />
and the JWS Header and the JWS Payload are
secured using the HMAC SHA-256 algorithm:
</t>
-->
<figure><artwork><![CDATA[
{"typ":"JWT",
"alg":"HS256"}
]]></artwork></figure>
<t>
JWSヘッダのUTF-8で表現されたオクテットをBase64urlエンコーディングすることで, 以下のエンコード済JWSヘッダの値が得られる:
</t>
<!--
<t>
Base64url encoding the octets of the UTF-8 representation of
the JWS Header yields this Encoded JWS Header value:
</t>
-->
<figure><artwork><![CDATA[
eyJ0eXAiOiJKV1QiLA0KICJhbGciOiJIUzI1NiJ9
]]></artwork></figure>
<t>
以下はJWSペイロードとして用いることの出来るJSONオブジェクトの例である.
(ペイロードは任意のコンテンツになり得るため, JSONオブジェクト表現である必要はないことに注意する.)
</t>
<!--
<t>
The following is an example of a JSON object that can be
used as a JWS Payload. (Note that the payload can be any
content, and need not be a representation of a JSON object.)
</t>
-->
<figure><artwork><![CDATA[
{"iss":"joe",
"exp":1300819380,
"http://example.com/is_root":true}
]]></artwork></figure>
<t>
上記のJSONオブジェクトのUTF-8表現である以下のオクテット列が, JWSペイロードである:
</t>
<!--
<t>
The following octet sequence, which is the UTF-8 representation
of the JSON object above, is the JWS Payload:
</t>
-->
<t>
[123, 34, 105, 115, 115, 34, 58, 34, 106, 111, 101, 34, 44, 13, 10, 32, 34, 101, 120, 112, 34, 58, 49, 51, 48, 48, 56, 49, 57, 51, 56, 48, 44, 13, 10, 32, 34, 104, 116, 116, 112, 58, 47, 47, 101, 120, 97, 109, 112, 108, 101, 46, 99, 111, 109, 47, 105, 115, 95, 114, 111, 111, 116, 34, 58, 116, 114, 117, 101, 125]
</t>
<t>
JWSペイロードをBase64urlエンコーディングすることで, 以下のエンコード済JWSペイロードが得られる
(改行は掲載上の都合による):
</t>
<!--
<t>
Base64url encoding the JWS Payload yields this Encoded JWS Payload
(with line breaks for display purposes only):
</t>
-->
<figure><artwork><![CDATA[
eyJpc3MiOiJqb2UiLA0KICJleHAiOjEzMDA4MTkzODAsDQogImh0dHA6Ly9leGFt
cGxlLmNvbS9pc19yb290Ijp0cnVlfQ
]]></artwork></figure>
<t>
JWS署名入力 (エンコード済JWSヘッダ, ピリオド('.'), エンコード済JWSペイロードを連結したもの) の ASCII <xref target="USASCII"/> オクテットの HMAC を, <xref target="HS256Example" />で指定されたキーを用いてHMAC SHA-256アルゴリズムで計算し, 結果をbase64urlエンコードすることで, 以下のエンコード済JWS署名値が得られる:
</t>
<!--
<t>
Computing the HMAC of the octets of the ASCII <xref target="USASCII"/>
representation of the JWS Signing Input
(the concatenation of the Encoded JWS Header, a period ('.')
character, and the Encoded JWS Payload)
with the HMAC SHA-256 algorithm
using the key specified in <xref target="HS256Example" />
and base64url encoding the result
yields this Encoded JWS Signature value:
</t>
-->
<figure><artwork><![CDATA[
dBjftJeZ4CVP-mB92K27uhbUJU1p1r_wW1gFWFOEjXk
]]></artwork></figure>
<t>
これらの値を "ヘッダ.ペイロード.署名" の順番で, パーツの間をピリオド('.')で連結することで, JWS Compact Serializationを用いたこの完全なJWS表現が得られる
(改行は掲載上の都合による):
</t>
<!--
<t>
Concatenating these values in the order
Header.Payload.Signature with period ('.') characters between the
parts yields this complete JWS representation
using the JWS Compact Serialization
(with line breaks for display purposes only):
</t>
-->
<figure><artwork><![CDATA[
eyJ0eXAiOiJKV1QiLA0KICJhbGciOiJIUzI1NiJ9
.
eyJpc3MiOiJqb2UiLA0KICJleHAiOjEzMDA4MTkzODAsDQogImh0dHA6Ly9leGFt
cGxlLmNvbS9pc19yb290Ijp0cnVlfQ
.
dBjftJeZ4CVP-mB92K27uhbUJU1p1r_wW1gFWFOEjXk
]]></artwork></figure>
<t>
この計算は<xref target="HS256Example"></xref>で更に詳細に示されている.
その他の例については<xref target="JWSExamples"/>を参照すること.
</t>
<!--
<t>
This computation is illustrated in more detail in <xref
target="HS256Example"></xref>.
See <xref target="JWSExamples"/> for additional examples.
</t>
-->
</section>
</section>
<section title="JWS Header" anchor="Header">
<t>
JWSヘッダを構成するJSONオブジェクトのメンバは, エンコードJWSヘッダおよびエンコード済JWSペイロード適用されたデジタル署名ないしMACについて記述する.
また, それ以外のJWSプロパティーについて記述することもある.
JWSヘッダ内のヘッダパラメータ名はユニークでなければならない (MUST).
受信者は重複したヘッダパラメータ名を持つJWSを, 拒否するか, または以下の動作をするJSONパーサーを使用しなければならない (MUST).
すなわち, 重複したメンバ名に対して字面上で最後の(lexically last)もののみを返すようなJSONパーサーである(この動作はECMAScript 5.1 <xref target="ECMAScript"/> Section 15.12 (The JSON Object)で定義されている).
</t>
<!--
<t>
The members of the JSON object(s) representing the JWS Header describe the
digital signature or MAC applied to the
Encoded JWS Header and the Encoded JWS Payload and optionally
additional properties of the JWS.
The Header Parameter Names within the JWS Header MUST be unique;
recipients MUST either reject JWSs with duplicate Header Parameter Names
or use a JSON parser that returns only the lexically last duplicate member name,
as specified in Section 15.12 (The JSON Object) of
ECMAScript 5.1 <xref target="ECMAScript"/>.
</t>
-->
<t>
実装は本仕様において「理解しなければならない (MUST)」と定義されているヘッダパラメータを理解し, 本仕様に定義されている方法で処理することが要求される.
本仕様で定義されており, かつMUSTでないヘッダパラメータは, 理解できなかった場合にはすべて無視しなければならない (MUST).
<xref target="critDef"/>によってクリティカルヘッダパラメータとして列挙されている場合を除き, 本仕様で定義されていないヘッダパラメータは, 理解できなかった場合にはすべて無視しなければならない (MUST).
</t>
<!--
<t>
Implementations are required to understand
the specific header parameters defined by this specification
that are designated as "MUST be understood"
and process them in the manner defined in this specification.
All other header parameters defined by this specification that
are not so designated MUST be ignored when not understood.
Unless listed as a critical header parameter, per <xref target="critDef"/>,
all header parameters not defined by this specification
MUST be ignored when not understood.
</t>
-->
<t>
ヘッダパラメータ名には3つのクラスがある. すなわち, 予約済ヘッダパラメータ名, パブリックヘッダパラメータ名, およびプライベートヘッダパラメータ名である.
</t>
<!--
<t>
There are three classes of Header Parameter Names:
Reserved Header Parameter Names, Public Header Parameter Names,
and Private Header Parameter Names.
</t>
-->
<section title="Reserved Header Parameter Names" anchor="ReservedHeaderParameterName">
<t>
以下に示すヘッダパラメータ名は予約済とし, その意味を以下で定義する.
これらのパラメータ名は短いが, それは本仕様の主目的として, JWS Compact Serialization方式による生成結果を小さくするためである.
</t>
<!--
<t>
The following Header Parameter Names are reserved
with meanings as defined below.
All the names are short because a core goal of this specification
is for the resulting representations
using the JWS Compact Serialization to be compact.
</t>
-->
<t>
追加の予約済ヘッダパラメータ名が定義される場合は, IANAによって JSON Web Signature and Encryption Header Parameters レジストリ <xref target="HdrReg"/>に追加される.
レジストリが共通であることから示されるとおり, JWSとJWEはヘッダパラメータ空間を共有する. あるパラメータが両方の仕様で使われる場合, その使い方は2つの仕様の間で互換でなればならない.
</t>
<!--
<t>
Additional reserved Header Parameter Names can be defined
via the IANA
JSON Web Signature and Encryption Header Parameters registry
<xref target="HdrReg"/>.
As indicated by the common registry, JWSs and JWEs share a
common header parameter space; when a parameter is used by
both specifications, its usage must be compatible
between the specifications.
</t>
-->
<section title='"alg" (Algorithm) Header Parameter' anchor="algDef">
<t>
<spanx style="verb">alg</spanx> (algorithm) ヘッダパラメータはJWSの署名に使われる暗号アルゴリズムを識別する.
受信者は以下の場合にはJWSを拒否しなければならない (MUST): <spanx style="verb">alg</spanx>で示されるアルゴリズムをサポートしていない場合, またはデジタル署名ないしMACを行ったパーティーの有効な鍵がない場合.
<spanx style="verb">alg</spanx>の値はIANA
JSON Web Signature and Encryption Algorithms レジストリ
<xref target="JWA" /> に登録されているか, またはCollision Resistant Namespaceを含んでいるべきである (SHOULD).
<spanx style="verb">alg</spanx>の値はStringOrURIを表現する文字列であり, 大文字・小文字は区別される.
このヘッダパラメータの利用は必須である (REQUIRED).
実装はこのヘッダパラメータを理解しなければならない (MUST).
</t>
<!--
<t>
The <spanx style="verb">alg</spanx> (algorithm) header
parameter identifies a cryptographic algorithm used to
secure the JWS.
The recipient MUST reject the JWS if the <spanx style="verb">alg</spanx>
value does not represent a supported algorithm, or if there is not a
key for use with that algorithm associated with the
party that digitally signed or MACed the content.
<spanx style="verb">alg</spanx> values SHOULD either be
registered in the IANA
JSON Web Signature and Encryption Algorithms registry
<xref target="JWA" /> or be
a value that contains a Collision Resistant Namespace.
The <spanx style="verb">alg</spanx> value is a case sensitive string
containing a StringOrURI value.
Use of this header parameter is REQUIRED.
This header parameter MUST be understood by implementations.
</t>
-->
<t>
定義済の<spanx style="verb">alg</spanx>値は IANA JSON Web Signature and Encryption Algorithms レジストリ <xref target="JWA" />に一覧されている.
このレジストリの初期の内容はJSON Web Algorithms (JWA) <xref target="JWA" />仕様のSection 3.1で定義されている.
</t>
<!--
<t>
A list of defined <spanx style="verb">alg</spanx> values can be found
in the IANA JSON Web Signature and Encryption Algorithms registry
<xref target="JWA" />;
the initial contents of this registry are the values defined in
Section 3.1 of the
JSON Web Algorithms (JWA) <xref target="JWA" /> specification.
</t>
-->
</section>
<section title='"jku" (JWK Set URL) Header Parameter' anchor="jkuDef">
<t>
<spanx style="verb">jku</spanx> (JWK Set URL)ヘッダパラメータはURI<xref target="RFC3986"/>であり, JSONでエンコードされた公開鍵セットのリソースを参照する. そのうちのひとつがJWSにデジタル署名をするときに用いる秘密鍵と対応する.
鍵は JSON Web Key Set (JWK Set) <xref target="JWK" />にしたがってエンコードされていなければならない (MUST).
リソースを取得するために使用するプロトコルは完全性を保証しなければならない (MUST).
HTTP GETリクエストによってJWK Setを取得する場合にはTLS<xref target="RFC2818"/> <xref target="RFC5246"/>を使用しなければならない (MUST).
サーバーのアイデンティティーはHTTP Over TLS <xref target='RFC2818'/>のSection 3.1で定義されるとおりに検証されなければならない (MUST)
このヘッダパラメータの利用は任意 (OPTIONAL) である.
</t>
<!--
<t>
The <spanx style="verb">jku</spanx> (JWK Set URL)
header parameter is a URI <xref target="RFC3986"/> that refers to a
resource for a set of JSON-encoded public keys, one of which
corresponds to the key
used to digitally sign the JWS.
The keys MUST be encoded as a JSON Web Key Set (JWK Set) <xref target="JWK" />.
The protocol used to acquire the resource MUST provide
integrity protection; an HTTP GET request to retrieve the
JWK Set MUST use TLS <xref target="RFC2818"/> <xref target="RFC5246"/>;
the identity of the server MUST be validated, as per
Section 3.1 of HTTP Over TLS <xref target='RFC2818'/>.
Use of this header parameter is OPTIONAL.
</t>
-->
</section>
<section title='"jwk" (JSON Web Key) Header Parameter' anchor="jwkDef">
<t>
<spanx style="verb">jwk</spanx> (JSON Web Key)ヘッダパラメータはJWSにデジタル署名をするときに用いる秘密鍵と対応する公開鍵である.
鍵は JSON Web Key <xref target="JWK" />形式で表現される.
このヘッダパラメータの利用は任意 (OPTIONAL) である.
</t>
<!--
<t>
The <spanx style="verb">jwk</spanx> (JSON Web Key)
header parameter is the public key
that corresponds to the key
used to digitally sign the JWS.
This key is represented as a JSON Web Key <xref target="JWK" />.
Use of this header parameter is OPTIONAL.
</t>
-->
</section>
<section title='"x5u" (X.509 URL) Header Parameter' anchor="x5uDef">
<t>
<spanx style="verb">x5u</spanx> (X.509 URL)ヘッダパラメータはURIであり, JWSにデジタル署名するために用いる鍵に対応するX.509公開鍵証明書もしくは証明書チェーン <xref target="RFC5280"/> リソースを参照する.
リソースは証明書または証明書チェーンを表現し, <xref target="RFC5280">RFC 5280</xref>仕様を満たすPEMフォーマット<xref target="RFC1421"/>でなければならない (MUST).
JWSのデジタル署名に使用する鍵に対応する公開鍵の証明書は先頭の証明書でなければならない (MUST).
これの後にさらなる証明書が続いても良く(MAY), それぞれの証明書は直前のものを証明する.
リソースを取得するために使用するプロトコルは完全性を保証しなければならない (MUST).
HTTP GETリクエストによってJWK Setを取得する場合にはTLS<xref target="RFC2818"/> <xref target="RFC5246"/>を使用しなければならない (MUST).
サーバーのアイデンティティーはHTTP Over TLS <xref target='RFC2818'/>のSection 3.1で定義されるとおりに検証されなければならない (MUST)
このヘッダパラメータの利用は任意 (OPTIONAL) である.
</t>
<!--
<t>
The <spanx style="verb">x5u</spanx> (X.509 URL) header
parameter is a URI <xref target="RFC3986"/> that refers to a resource for
the X.509 public key certificate or certificate chain <xref target="RFC5280"/>
corresponding to the key
used to digitally sign the JWS.
The identified resource MUST provide a representation of
the certificate or certificate chain that conforms to
<xref target="RFC5280">RFC 5280</xref> in PEM encoded form
<xref target="RFC1421"/>.
The certificate containing the public key
corresponding to the key
used to digitally sign the JWS
MUST be the first certificate.
This MAY be followed by additional certificates, with each
subsequent certificate being the one used to certify the
previous one.
The protocol used to acquire the resource MUST provide
integrity protection; an HTTP GET request to retrieve the
certificate MUST use TLS <xref target="RFC2818"/> <xref target="RFC5246"/>;
the identity of the server MUST be validated, as per
Section 3.1 of HTTP Over TLS <xref target='RFC2818'/>.
Use of this header parameter is OPTIONAL.
</t>
-->
</section>
<section title='"x5t" (X.509 Certificate Thumbprint) Header Parameter' anchor="x5tDef">
<t>
<spanx style="verb">x5t</spanx> (X.509証明書フィンガープリント)ヘッダパラメータは, JWSにデジタル署名するために用いる鍵に対応するX.509証明書<xref target="RFC5280"/>をDER形式で表現し, そのSHA-1フィンガープリント(ダイジェスト)をBase64 URLエンコードしたものである.
このヘッダパラメータの利用は任意 (OPTIONAL) である.
</t>
<!--
<t>
The <spanx style="verb">x5t</spanx> (X.509 Certificate Thumbprint)
header parameter is a base64url encoded
SHA-1 thumbprint (a.k.a. digest) of the DER encoding of
the X.509 certificate <xref target="RFC5280"/>
corresponding to the key
used to digitally sign the JWS.
Use of this header parameter is OPTIONAL.
</t>
-->
<t>
将来, 証明書フィンガープリントをSHA-1以外のハッシュ関数によって計算する必要が発生した場合, その目的のために追加のヘッダパラメータを定義することが推奨される.
例えば, 新しい<spanx style="verb">x5t#S256</spanx> (SHA-256によるX.509証明書フィンガープリント)というヘッダパラメータをIANA JSON Web Signature and Encryption Header Parameters レジストリに <xref target="HdrReg" />登録することが推奨される.
</t>
<!--
<t>
If, in the future, certificate thumbprints need to be
computed using hash functions other than SHA-1, it is
suggested that additional related header parameters be
defined for that purpose. For example, it is suggested
that a new <spanx style="verb">x5t#S256</spanx> (X.509
Certificate Thumbprint using SHA-256) header parameter
could be defined by registering it in the IANA
JSON Web Signature and Encryption Header Parameters
registry <xref target="HdrReg" />.
</t>
-->
</section>
<section title='"x5c" (X.509 Certificate Chain) Header Parameter' anchor="x5cDef">
<t>
<spanx style="verb">x5c</spanx> (X.509証明書チェーン) ヘッダパラメータは, JWSにデジタル署名するために用いる鍵に対応するX.509公開鍵証明書もしくは証明書チェーン <xref target="RFC5280"/> を含む.
証明書や証明書チェーンは, 証明書の文字列のJSON配列として表される.
配列中のそれぞれの文字列はBase64エンコード(<xref target="RFC4648"/> 4節 -- Base64 URLエンコードではない)されているDER <xref target="ITU.X690.1994"/> PKIX証明書の値である.
JWSにデジタル署名するために用いる鍵に対応する公開鍵の証明書は先頭の証明書でなければならない (MUST).
これの後にさらなる証明書が続いても良く(MAY), それぞれの証明書は直前のものを証明する.
受信者は証明書チェーンを <xref target="RFC5280"/> に従って確認する. 検証エラーが発生した場合には, そのJWSを拒否しなければならない (MUST).
このヘッダパラメータの利用は任意 (OPTIONAL) である.
</t>
<!--
<t>
The <spanx style="verb">x5c</spanx> (X.509 Certificate Chain)
header parameter contains the X.509 public key
certificate or certificate chain <xref target="RFC5280"/>
corresponding to the key
used to digitally sign the JWS.
The certificate or certificate chain is represented as
a JSON array of certificate value strings.
Each string in the array is a base64 encoded
(<xref target="RFC4648"/> Section 4 - not base64url encoded)
DER <xref target="ITU.X690.1994"/> PKIX certificate value.
The certificate containing the public key
corresponding to the key
used to digitally sign the JWS
MUST be the first certificate.
This MAY be followed by additional certificates, with each
subsequent certificate being the one used to certify the
previous one.
The recipient MUST verify the certificate chain according
to <xref target="RFC5280"/> and reject the JWS if any
validation failure occurs.
Use of this header parameter is OPTIONAL.
</t>
-->
<t>
<spanx style="verb">x5c</spanx> の例については <xref target="x5cExample"/> を参照.
</t>
<!--
<t>
See <xref target="x5cExample"/> for an example
<spanx style="verb">x5c</spanx> value.
</t>
-->
</section>
<section title='"kid" (Key ID) Header Parameter' anchor="kidDef">
<t>
<spanx style="verb">kid</spanx> (key ID)ヘッダパラメータはJWSを保護するためにどの鍵が使用されたかを示しているヒントである.
このパラメータは発信者が鍵の変更を受信者に明確に示すことを許す.
受信者が <spanx style="verb">kid</spanx> の値に一致する鍵を見つけることができないならば, その状態をエラーとして扱うべきである (SHOULD).
<spanx style="verb">kid</spanx> の値の説明は記載しない.
その値は文字列でなければならない (MUST).
このヘッダパラメータの利用は任意 (OPTIONAL) である.
</t>
<!--
<t>
The <spanx style="verb">kid</spanx> (key ID) header
parameter is a hint indicating which key
was used to secure the JWS.
This parameter allows originators to explicitly signal a change of
key to recipients.
Should the recipient be unable to locate a key
corresponding to the <spanx style="verb">kid</spanx>
value, they SHOULD treat that condition as an error.
The interpretation of the
<spanx style="verb">kid</spanx> value is unspecified.
Its value MUST be a string.
Use of this header parameter is OPTIONAL.
</t>
-->
<t>
JWKを利用する場合, <spanx style="verb">kid</spanx> の値はJWK <spanx style="verb">kid</spanx> パラメータの値と一致するように利用できる.
</t>
<!--
<t>
When used with a JWK, the <spanx style="verb">kid</spanx>
value can be used to match a JWK <spanx style="verb">kid</spanx>
parameter value.
</t>
-->
</section>
<section title='"typ" (Type) Header Parameter' anchor="typDef">
<t>
<spanx style="verb">typ</spanx> (type) ヘッダパラメータは, これがアプリケーションにとって有用な文脈の中で, アプリケーションに特化した方法で, この完全なJWSオブジェクトの種類を表すために用いられてもよい (MAY).
このパラメータはJWSの処理に影響を及ぼさない.
<spanx style="verb">JOSE</spanx> という値はアプリケーションによりこのオブジェクトがJWS Compact Serializationを用いたJWSもしくはJWE Compact Serializationを用いたJWEであることを示すために用いられてもよい (MAY).
<spanx style="verb">JOSE+JSON</spanx> という値はアプリケーションによりこのオブジェクトがJWS JSON Serialiationを用いたJWSもしくはJWE JSON Serializationを用いたJWEであることを示すために用いられてもよい (MAY).
その他の値も用いられても良く(MAY), もし理解されなかった場合は無視されるべきである (SHOULD).
<spanx style="verb">typ</spanx> の値は文字列であり, 大文字・小文字を区別する.
このヘッダパラメータの利用は任意 (OPTIONAL) である.
</t>
<!--
<t>
The <spanx style="verb">typ</spanx> (type) header
parameter MAY be used to declare the type of
this complete JWS object
in an application-specific manner
in contexts where this is useful to the application.
This parameter has no effect upon the JWS processing.
The type value <spanx style="verb">JOSE</spanx> MAY be used
by applications
to indicate that this object is a JWS or JWE using
the JWS Compact Serialization or the JWE Compact Serialization.
The type value <spanx style="verb">JOSE+JSON</spanx> MAY be used
by applications
to indicate that this object is a JWS or JWE using
the JWS JSON Serialization or the JWE JSON Serialization.
Other type values MAY be used, and if not understood, SHOULD be ignored.
The <spanx style="verb">typ</spanx> value is a case sensitive string.
Use of this header parameter is OPTIONAL.
</t>
-->
<t>
MIME Media Type <xref target="RFC2046"/> の値は <spanx style="verb">typ</spanx> の値として用いられてもよい (MAY).
</t>
<!--
<t>
MIME Media Type <xref target="RFC2046"/>
values MAY be used as <spanx style="verb">typ</spanx> values.
</t>
-->
<t>
<spanx style="verb">typ</spanx> の値は IANA JSON Web Signature and Encryption Type Values レジストリ <xref target="TypReg" /> に登録されるか衝突耐性を持つ名前空間を含む値であるべきである (SHOULD).
</t>
<!--
<t>
<spanx style="verb">typ</spanx> values SHOULD either be
registered in the IANA
JSON Web Signature and Encryption Type Values registry
<xref target="TypReg" /> or be
a value that contains a Collision Resistant Namespace.
</t>
-->
</section>
<section title='"cty" (Content Type) Header Parameter' anchor="ctyDef">
<t>
<spanx style="verb">cty</spanx> (content type) ヘッダパラメータは, これがアプリケーションにとって有用な文脈の中で, アプリケーションに特化した方法で, 保護されているコンテント(ペイロード)の種類を表すために用いられてもよい (MAY).
このパラメータはJWSの処理に影響を及ぼさない.
コンテントタイプの値が理解されなかった場合は無視されるべきである (SHOULD).
<spanx style="verb">cty</spanx> の値は文字列であり, 大文字・小文字を区別する.
このヘッダパラメータの利用は任意 (OPTIONAL) である.
</t>
<!--
<t>
The <spanx style="verb">cty</spanx> (content type) header
parameter MAY be used to declare the type of
the secured content (the payload)
in an application-specific manner
in contexts where this is useful to the application.
This parameter has no effect upon the JWS processing.
Content type values that are not understood SHOULD be ignored.
The <spanx style="verb">cty</spanx> value is a case sensitive string.
Use of this header parameter is OPTIONAL.
</t>
-->
<t>
<spanx style="verb">cty</spanx> ヘッダパラメータに用いられる値は <spanx style="verb">typ</spanx> ヘッダパラメータと同じ値空間となり, 同じ規則が適用される.
</t>
<!--
<t>
The values used for the <spanx style="verb">cty</spanx>
header parameter come from the same value space as the
<spanx style="verb">typ</spanx> header parameter,
with the same rules applying.
</t>
-->
</section>
<section title='"crit" (Critical) Header Parameter' anchor="critDef">
<t>
<spanx style="verb">crit</spanx> (critical) ヘッダパラメータは, 本仕様の拡張が利用されていること, およびその拡張仕様が必ず理解されなければならない (MUST) ことを示す.