-
Notifications
You must be signed in to change notification settings - Fork 298
/
Copy pathjson_web_crypto_schema.json
239 lines (239 loc) · 6.13 KB
/
json_web_crypto_schema.json
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
{
"type": "object",
"definitions": {
"JsonWebCryptoTestGroup": {
"type": "object",
"properties": {
"type": {
"enum": [
"JsonWebCrypto"
]
},
"comment": {
"type": "string",
"description": "a description of what these tests have in common"
},
"private": {
"oneOf" : [
{
"$ref": "#/definitions/JsonWebKeyset"
},
{
"$ref": "#/definitions/JsonWebKey"
}
],
"description": "the private or secret key in webcrypto format"
},
"public": {
"oneOf" : [
{
"$ref": "#/definitions/JsonWebKeyset"
},
{
"$ref": "#/definitions/JsonWebKey"
}
],
"description": "[optional] the public key in webcrypto format"
},
"tests": {
"type": "array",
"items": {
"$ref": "#/definitions/JsonWebCryptoTestVector"
}
}
},
"additionalProperties": false
},
"JsonWebKey": {
"type": "object",
"desription": "see https://tools.ietf.org/html/rfc7517#section-4 and https://tools.ietf.org/html/rfc7518#section-6",
"properties": {
"alg": {
"type": "string",
"description": "the encryption/signing algorithm to use"
},
"use": {
"type": "string",
"description": "what type of crypto operation to perform",
"enum": [
"sig",
"enc"
]
},
"kid": {
"type": "string",
"description": "the ID of the key entry"
},
"kty": {
"type": "string",
"description": "the family of algorithms the key belongs to",
"enum": [
"oct",
"EC",
"RSA"
]
},
"k": {
"type": "string",
"description": "the secret key value of an oct key"
},
"n": {
"type": "string",
"description": "the public modulus of an RSA key"
},
"e": {
"type": "string",
"description": "the public exponent of an RSA key"
},
"p": {
"type": "string",
"description": "the first prime factgor of an RSA key"
},
"q": {
"type": "string",
"description": "the second prime factor of an RSA key"
},
"dp": {
"type": "string",
"description": "the first factor Chinese Remainder Theorem exponent of an RSA key"
},
"dq": {
"type": "string",
"description": "the second factor Chinese Remainder Theorem exponent of an RSA key"
},
"qi": {
"type": "string",
"description": "the first factor Chinese Remainder Theorem coefficient of an RSA key"
},
"crv": {
"type": "string",
"description": "which defined curve to use",
"enum": [
"P-256",
"P-384",
"P-521"
]
},
"x": {
"type": "string",
"description": "the x-coordinate of an EC key point"
},
"y": {
"type": "string",
"description": "the y-coordinate of an EC key point"
},
"d": {
"type": "string",
"description": "the private key value of an EC key or private exponent for RSA"
}
},
"additionalProperties": false
},
"JsonWebKeyset": {
"type": "object",
"description": "see https://tools.ietf.org/html/rfc7517#section-5",
"properties": {
"keys": {
"type": "array",
"items": {
"$ref": "#/definitions/JsonWebKey"
}
}
},
"additionalProperties": false
},
"JsonWebCryptoTestVector": {
"type": "object",
"properties": {
"tcId": {
"type": "integer",
"description": "Identifier of the test case"
},
"comment": {
"type": "string",
"description": "A brief description of the test case"
},
"jws": {
"oneOf": [
{
"type": "object",
"description": "The JSON serialization form"
},
{
"type": "string",
"description": "The compact serialization form"
}
],
"description": "The JSON Web Signature"
},
"jwe": {
"oneOf": [
{
"type": "object",
"description": "The JSON serialization form"
},
{
"type": "string",
"description": "The compact serialization form"
}
],
"description": "The JSON Web Encryption"
},
"pt": {
"type": "string",
"description": "[optional] Plaintext"
},
"result": {
"type": "string",
"description": "Test result",
"enum": [
"valid",
"invalid",
"acceptable"
]
},
"flags": {
"type": "array",
"items": {
"type": "string"
},
"description": "A list of flags"
}
},
"additionalProperties": false
}
},
"properties": {
"generatorVersion": {
"type": "string",
"description": "the version of the test vectors."
},
"header": {
"type": "array",
"items": {
"type": "string"
},
"description": "additional documentation"
},
"notes": {
"type": "object",
"description": "a description of the labels used in the test vectors"
},
"numberOfTests": {
"type": "integer",
"description": "the number of test vectors in this test"
},
"schema": {
"enum": [
"json_web_crypto_schema.json"
]
},
"testGroups": {
"type": "array",
"items": {
"$ref": "#/definitions/JsonWebCryptoTestGroup"
}
}
},
"additionalProperties": false
}