Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / components / test / data / webcrypto / bad_rsa_keys.json
blob6c46af386b965c1bf8877d4ce1675cbd4b7949d1
1 // This file contains incorrect key data in a variety of formats.
2 //   "key" -- either a dictionary for JWK, or hex encoded bytes for PKCS8/SPKI.
3 //   "key_format" -- one of: "jwk", "pkcs8", "spki"
4 //   "error" -- The expected rejection reason when importing the key.
7   // This is a valid key (ValidKey). It forms the basis for later manipulations
8   // so its validity is tested separately.
9   {
10     "key_format": "jwk",
11     "key": {
12       "kty": "RSA",
13       "d": "ZmJJJ3PBfirgPEOb844fI_1_zXn3A09X9fkk-65xeTNo3JeigTPpuB54FC_GXUmqiXLVx5gynO6cwl9wjxVKYQ",
14       "dp": "DOUuUiDhtjpnCuIjcGRWhQYok8NeUO5XV1Uwx1-DxtU",
15       "dq": "mKOBL1e74J8OuGtW1kc2-s4VEP5Eeiwe__TAeBm-roE",
16       "e": "AQAB",
17       "n": "tFJAFt_UiJsHlRavDgOxOnYKTHkV-cF1aTDtkzNg6WYt9geaPbAvFnR3FVO0BFsl8tzPzMOTkI_kbOfCfAw3FQ",
18       "p": "7kMQn01JVhyHM7B85hLUuNBDsXiboMc4Di81qmxX7r0",
19       "q": "wb7rEiGxG4CrybVYns9voNQM2NPCuCEgWPLA_vCkuzk",
20       "qi": "6rrPQ4YaOLNGtG7TrLXUR_FSWpOFSUveHTHbFQU6iNU"
21     },
22     // This should pass import.
23     "error": "Success"
24   },
26   // This was a valid key (ValidKey), and then "p" and "q" were switched.
27   // (making dp, dq, and qi invalid).
28   {
29     "key_format": "jwk",
30     "key": {
31       "kty": "RSA",
32       "d": "ZmJJJ3PBfirgPEOb844fI_1_zXn3A09X9fkk-65xeTNo3JeigTPpuB54FC_GXUmqiXLVx5gynO6cwl9wjxVKYQ",
33       "dp": "DOUuUiDhtjpnCuIjcGRWhQYok8NeUO5XV1Uwx1-DxtU",
34       "dq": "mKOBL1e74J8OuGtW1kc2-s4VEP5Eeiwe__TAeBm-roE",
35       "e": "AQAB",
36       "n": "tFJAFt_UiJsHlRavDgOxOnYKTHkV-cF1aTDtkzNg6WYt9geaPbAvFnR3FVO0BFsl8tzPzMOTkI_kbOfCfAw3FQ",
37       "q": "7kMQn01JVhyHM7B85hLUuNBDsXiboMc4Di81qmxX7r0",
38       "p": "wb7rEiGxG4CrybVYns9voNQM2NPCuCEgWPLA_vCkuzk",
39       "qi": "6rrPQ4YaOLNGtG7TrLXUR_FSWpOFSUveHTHbFQU6iNU"
40     },
41     "error": "OperationError"
42   },
44   // This was a valid key (ValidKey), and then "p" and "q" were switched, as
45   // well as "dp" and "dq" (making qi invalid).
46   {
47     "key_format": "jwk",
48     "key": {
49       "kty": "RSA",
50       "d": "ZmJJJ3PBfirgPEOb844fI_1_zXn3A09X9fkk-65xeTNo3JeigTPpuB54FC_GXUmqiXLVx5gynO6cwl9wjxVKYQ",
51       "dq": "DOUuUiDhtjpnCuIjcGRWhQYok8NeUO5XV1Uwx1-DxtU",
52       "dp": "mKOBL1e74J8OuGtW1kc2-s4VEP5Eeiwe__TAeBm-roE",
53       "e": "AQAB",
54       "n": "tFJAFt_UiJsHlRavDgOxOnYKTHkV-cF1aTDtkzNg6WYt9geaPbAvFnR3FVO0BFsl8tzPzMOTkI_kbOfCfAw3FQ",
55       "q": "7kMQn01JVhyHM7B85hLUuNBDsXiboMc4Di81qmxX7r0",
56       "p": "wb7rEiGxG4CrybVYns9voNQM2NPCuCEgWPLA_vCkuzk",
57       "qi": "6rrPQ4YaOLNGtG7TrLXUR_FSWpOFSUveHTHbFQU6iNU"
58     },
59     "error": "OperationError"
60   },
62   // This was (ValidKey), where p and q were switched (dp, and dq were also
63   //  flipped, and qi was recomputed using the new q).
64   //
65   // TODO(eroman): This test is commented out because it does not pass when
66   // using certain versions of NSS, due to:
67   //    https://bugzilla.mozilla.org/show_bug.cgi?id=1049435
68   // Versions of NSS after 3.17.2 will pass this test.
69   // Enable this test once NSS is updated on all the bots, or chromium has
70   // switched to BoringSSL.
71 //{
72 //  "key_format": "jwk",
73 //  "key": {
74 //    "kty": "RSA",
75 //    "d": "ZmJJJ3PBfirgPEOb844fI_1_zXn3A09X9fkk-65xeTNo3JeigTPpuB54FC_GXUmqiXLVx5gynO6cwl9wjxVKYQ",
76 //    "dq": "DOUuUiDhtjpnCuIjcGRWhQYok8NeUO5XV1Uwx1-DxtU",
77 //    "dp": "mKOBL1e74J8OuGtW1kc2-s4VEP5Eeiwe__TAeBm-roE",
78 //    "e": "AQAB",
79 //    "n": "tFJAFt_UiJsHlRavDgOxOnYKTHkV-cF1aTDtkzNg6WYt9geaPbAvFnR3FVO0BFsl8tzPzMOTkI_kbOfCfAw3FQ",
80 //    "q": "7kMQn01JVhyHM7B85hLUuNBDsXiboMc4Di81qmxX7r0",
81 //    "p": "wb7rEiGxG4CrybVYns9voNQM2NPCuCEgWPLA_vCkuzk",
82 //    "qi": "At9OiWPsUGogvxI5FR0mMURSjnu1mZgyFXi7fX56Bl0"
83 //  },
84 //  // This should pass import.
85 //  "error": "Success"
86 //},
88   // The provided SPKI is empty.
89   {
90     "key_format": "spki",
91     "key": "",
92     "error": "DataError"
93   },
95   // The provided PKCS8 is empty.
96   {
97     "key_format": "pkcs8",
98     "key": "",
99     "error": "DataError"
100   },
102   // Bad DER encoding for SPKI.
103   {
104     "key_format": "spki",
105     "key": "618333c4cb",
106     "error": "DataError"
107   },
109   // Bad DER encoding for PKCS8.
110   {
111     "key_format": "pkcs8",
112     "key": "618333c4cb",
113     "error": "DataError"
114   },
116   // RSA private key with some optional parameters missing (q, dp, dq, qi).
117   //
118   // The only optional parameter included is "p".
119   //
120   // This fails because JWA says that producers must include either ALL optional
121   // parameters or NONE.
122   {
123     "key_format": "jwk",
124     "key": {
125       "kty": "RSA",
126       "n": "pW5KDnAQF1iaUYfcfqhB0Vby7A42rVKkTf6x5h962ZHYxRBW_-2xYrTA8oOhKoijlN_1JqtykcuzB86r_OCx39XNlQgJbVsri2311nHvY3fAkhyyPCcKcOJZjm_4nRnxBazC0_DLNfKSgOE4a29kxO8i4eHyDQzoz_siSb2aITc",
127       "e": "AQAB",
128       "d": "M6UEKpCyfU9UUcqbu9C0R3GhAa-IQ0Cu-YhfKku-kuiUpySsPFaMj5eFOtB8AmbIxqPKCSnx6PESMYhEKfxNmuVf7olqEM5wfD7X5zTkRyejlXRQGlMmgxCcKrrKuig8MbS9L1PD7jfjUs7jT55QO9gMBiKtecbc7og1R8ajsyU",
129       "p": "5-iUJyCod1Fyc6NWBT6iobwMlKpy1VxuhilrLfyWeUjApyy8zKfqyzVwbgmh31WhU1vZs8w0Fgs7bc0-2o5kQw"
130     },
131     "error": "DataError: The required JWK member \"q\" was missing"
132   },
134   // RSA private key without any of the optional parameters.
135   //
136   // According to JWA, such keys are valid, but applications SHOULD
137   // include all the parameters when sending, and recipients MAY
138   // accept them, but are not required to. Chromium's WebCrypto does
139   // not allow such degenerate keys.
140   {
141     "key_format": "jwk",
142     "key": {
143       "kty": "RSA",
144       "n": "pW5KDnAQF1iaUYfcfqhB0Vby7A42rVKkTf6x5h962ZHYxRBW_-2xYrTA8oOhKoijlN_1JqtykcuzB86r_OCx39XNlQgJbVsri2311nHvY3fAkhyyPCcKcOJZjm_4nRnxBazC0_DLNfKSgOE4a29kxO8i4eHyDQzoz_siSb2aITc",
145       "e": "AQAB",
146       "d": "M6UEKpCyfU9UUcqbu9C0R3GhAa-IQ0Cu-YhfKku-kuiUpySsPFaMj5eFOtB8AmbIxqPKCSnx6PESMYhEKfxNmuVf7olqEM5wfD7X5zTkRyejlXRQGlMmgxCcKrrKuig8MbS9L1PD7jfjUs7jT55QO9gMBiKtecbc7og1R8ajsyU"
147     },
148     "error": "DataError: The required JWK member \"p\" was missing"
149   },
151   // Public RSA key whose exponent contains leading zeros.
152   {
153     "key_format": "jwk",
154     "key": {
155       "kty": "RSA",
156       // 00 01 00 01
157       "e": "AAEAAQ",
158       "n": "qLOyhK-OtQs4cDSoYPFGxJGfMYdjzWxVmMiuSBGh4KvEx-CwgtaTpef87Wdc9GaFEncsDLxkp0LGxjD1M8jMcvYq6DPEC_JYQumEu3i9v5fAEH1VvbZi9cTg-rmEXLUUjvc5LdOq_5OuHmtme7PUJHYW1PW6ENTP0ibeiNOfFvs"
159     },
160     "error": "DataError: The JWK \"e\" member contained a leading zero."
161   },
164   // Corrupted PKCS8 (byte index 50 was inverted, which is inside of "n")
165   {
166     "key_format": "pkcs8",
167     "key": "30820275020100300D06092A864886F70D01010105000482025F3082025B02010002818100A56E4A0E701017589A5187DC7E5741D156F2EC0E36AD52A44DFEB1E61F7AD991D8C51056FFEDB162B4C0F283A12A88A394DFF526AB7291CBB307CEABFCE0B1DFD5CD9508096D5B2B8B6DF5D671EF6377C0921CB23C270A70E2598E6FF89D19F105ACC2D3F0CB35F29280E1386B6F64C4EF22E1E1F20D0CE8CFFB2249BD9A2137020301000102818033A5042A90B27D4F5451CA9BBBD0B44771A101AF884340AEF9885F2A4BBE92E894A724AC3C568C8F97853AD07C0266C8C6A3CA0929F1E8F11231884429FC4D9AE55FEE896A10CE707C3ED7E734E44727A39574501A532683109C2ABACABA283C31B4BD2F53C3EE37E352CEE34F9E503BD80C0622AD79C6DCEE883547C6A3B325024100E7E8942720A877517273A356053EA2A1BC0C94AA72D55C6E86296B2DFC967948C0A72CBCCCA7EACB35706E09A1DF55A1535BD9B3CC34160B3B6DCD3EDA8E6443024100B69DCA1CF7D4D7EC81E75B90FCCA874ABCDE123FD2700180AA90479B6E48DE8D67ED24F9F19D85BA275874F542CD20DC723E6963364A1F9425452B269A6799FD024028FA13938655BE1F8A159CBACA5A72EA190C30089E19CD274A556F36C4F6E19F554B34C077790427BBDD8DD3EDE2448328F385D81B30E8E43B2FFFA02786197902401A8B38F398FA712049898D7FB79EE0A77668791299CDFA09EFC0E507ACB21ED74301EF5BFD48BE455EAEB6E1678255827580A8E4E8E14151D1510A82A3F2E729024027156ABA4126D24A81F3A528CBFB27F56886F840A9F6E86E17A44B94FE9319584B8E22FDDE1E5A2E3BD8AA5BA8D8584194EB2190ACF832B847F13A3D24A79F4D",
168     "error": "DataError"
169   },
171   // Corrupted PKCS8 (byte index 168 was inverted, which is inside of "e")
172   {
173     "key_format": "pkcs8",
174     "key": "30820275020100300D06092A864886F70D01010105000482025F3082025B02010002818100A56E4A0E701017589A5187DC7EA841D156F2EC0E36AD52A44DFEB1E61F7AD991D8C51056FFEDB162B4C0F283A12A88A394DFF526AB7291CBB307CEABFCE0B1DFD5CD9508096D5B2B8B6DF5D671EF6377C0921CB23C270A70E2598E6FF89D19F105ACC2D3F0CB35F29280E1386B6F64C4EF22E1E1F20D0CE8CFFB2249BD9A2137020301FF0102818033A5042A90B27D4F5451CA9BBBD0B44771A101AF884340AEF9885F2A4BBE92E894A724AC3C568C8F97853AD07C0266C8C6A3CA0929F1E8F11231884429FC4D9AE55FEE896A10CE707C3ED7E734E44727A39574501A532683109C2ABACABA283C31B4BD2F53C3EE37E352CEE34F9E503BD80C0622AD79C6DCEE883547C6A3B325024100E7E8942720A877517273A356053EA2A1BC0C94AA72D55C6E86296B2DFC967948C0A72CBCCCA7EACB35706E09A1DF55A1535BD9B3CC34160B3B6DCD3EDA8E6443024100B69DCA1CF7D4D7EC81E75B90FCCA874ABCDE123FD2700180AA90479B6E48DE8D67ED24F9F19D85BA275874F542CD20DC723E6963364A1F9425452B269A6799FD024028FA13938655BE1F8A159CBACA5A72EA190C30089E19CD274A556F36C4F6E19F554B34C077790427BBDD8DD3EDE2448328F385D81B30E8E43B2FFFA02786197902401A8B38F398FA712049898D7FB79EE0A77668791299CDFA09EFC0E507ACB21ED74301EF5BFD48BE455EAEB6E1678255827580A8E4E8E14151D1510A82A3F2E729024027156ABA4126D24A81F3A528CBFB27F56886F840A9F6E86E17A44B94FE9319584B8E22FDDE1E5A2E3BD8AA5BA8D8584194EB2190ACF832B847F13A3D24A79F4D",
175     "error": "DataError"
176   },
178   // Corrupted PKCS8 (byte index 175 was inverted, which is inside of "d")
179   {
180     "key_format": "pkcs8",
181     "key": "30820275020100300D06092A864886F70D01010105000482025F3082025B02010002818100A56E4A0E701017589A5187DC7EA841D156F2EC0E36AD52A44DFEB1E61F7AD991D8C51056FFEDB162B4C0F283A12A88A394DFF526AB7291CBB307CEABFCE0B1DFD5CD9508096D5B2B8B6DF5D671EF6377C0921CB23C270A70E2598E6FF89D19F105ACC2D3F0CB35F29280E1386B6F64C4EF22E1E1F20D0CE8CFFB2249BD9A2137020301000102818033A5FB2A90B27D4F5451CA9BBBD0B44771A101AF884340AEF9885F2A4BBE92E894A724AC3C568C8F97853AD07C0266C8C6A3CA0929F1E8F11231884429FC4D9AE55FEE896A10CE707C3ED7E734E44727A39574501A532683109C2ABACABA283C31B4BD2F53C3EE37E352CEE34F9E503BD80C0622AD79C6DCEE883547C6A3B325024100E7E8942720A877517273A356053EA2A1BC0C94AA72D55C6E86296B2DFC967948C0A72CBCCCA7EACB35706E09A1DF55A1535BD9B3CC34160B3B6DCD3EDA8E6443024100B69DCA1CF7D4D7EC81E75B90FCCA874ABCDE123FD2700180AA90479B6E48DE8D67ED24F9F19D85BA275874F542CD20DC723E6963364A1F9425452B269A6799FD024028FA13938655BE1F8A159CBACA5A72EA190C30089E19CD274A556F36C4F6E19F554B34C077790427BBDD8DD3EDE2448328F385D81B30E8E43B2FFFA02786197902401A8B38F398FA712049898D7FB79EE0A77668791299CDFA09EFC0E507ACB21ED74301EF5BFD48BE455EAEB6E1678255827580A8E4E8E14151D1510A82A3F2E729024027156ABA4126D24A81F3A528CBFB27F56886F840A9F6E86E17A44B94FE9319584B8E22FDDE1E5A2E3BD8AA5BA8D8584194EB2190ACF832B847F13A3D24A79F4D",
182     "error": "DataError"
183   },
185   // Corrupted PKCS8 (byte index 333 was inverted, which is inside of "p")
186   {
187     "key_format": "pkcs8",
188     "key": "30820275020100300D06092A864886F70D01010105000482025F3082025B02010002818100A56E4A0E701017589A5187DC7EA841D156F2EC0E36AD52A44DFEB1E61F7AD991D8C51056FFEDB162B4C0F283A12A88A394DFF526AB7291CBB307CEABFCE0B1DFD5CD9508096D5B2B8B6DF5D671EF6377C0921CB23C270A70E2598E6FF89D19F105ACC2D3F0CB35F29280E1386B6F64C4EF22E1E1F20D0CE8CFFB2249BD9A2137020301000102818033A5042A90B27D4F5451CA9BBBD0B44771A101AF884340AEF9885F2A4BBE92E894A724AC3C568C8F97853AD07C0266C8C6A3CA0929F1E8F11231884429FC4D9AE55FEE896A10CE707C3ED7E734E44727A39574501A532683109C2ABACABA283C31B4BD2F53C3EE37E352CEE34F9E503BD80C0622AD79C6DCEE883547C6A3B325024100E7E8942720A877517273A356053EA2A1BC0C94AA72D55C6E86296B2DFC697948C0A72CBCCCA7EACB35706E09A1DF55A1535BD9B3CC34160B3B6DCD3EDA8E6443024100B69DCA1CF7D4D7EC81E75B90FCCA874ABCDE123FD2700180AA90479B6E48DE8D67ED24F9F19D85BA275874F542CD20DC723E6963364A1F9425452B269A6799FD024028FA13938655BE1F8A159CBACA5A72EA190C30089E19CD274A556F36C4F6E19F554B34C077790427BBDD8DD3EDE2448328F385D81B30E8E43B2FFFA02786197902401A8B38F398FA712049898D7FB79EE0A77668791299CDFA09EFC0E507ACB21ED74301EF5BFD48BE455EAEB6E1678255827580A8E4E8E14151D1510A82A3F2E729024027156ABA4126D24A81F3A528CBFB27F56886F840A9F6E86E17A44B94FE9319584B8E22FDDE1E5A2E3BD8AA5BA8D8584194EB2190ACF832B847F13A3D24A79F4D",
189     "error": "DataError"
190   },
192   // Corrupted PKCS8 (byte index 373 was inverted, which is inside of "q")
193   {
194     "key_format": "pkcs8",
195     "key": "30820275020100300D06092A864886F70D01010105000482025F3082025B02010002818100A56E4A0E701017589A5187DC7EA841D156F2EC0E36AD52A44DFEB1E61F7AD991D8C51056FFEDB162B4C0F283A12A88A394DFF526AB7291CBB307CEABFCE0B1DFD5CD9508096D5B2B8B6DF5D671EF6377C0921CB23C270A70E2598E6FF89D19F105ACC2D3F0CB35F29280E1386B6F64C4EF22E1E1F20D0CE8CFFB2249BD9A2137020301000102818033A5042A90B27D4F5451CA9BBBD0B44771A101AF884340AEF9885F2A4BBE92E894A724AC3C568C8F97853AD07C0266C8C6A3CA0929F1E8F11231884429FC4D9AE55FEE896A10CE707C3ED7E734E44727A39574501A532683109C2ABACABA283C31B4BD2F53C3EE37E352CEE34F9E503BD80C0622AD79C6DCEE883547C6A3B325024100E7E8942720A877517273A356053EA2A1BC0C94AA72D55C6E86296B2DFC967948C0A72CBCCCA7EACB35706E09A1DF55A1535BD9B3CC34160B3B6DCD3EDA8E6443024100B69D351CF7D4D7EC81E75B90FCCA874ABCDE123FD2700180AA90479B6E48DE8D67ED24F9F19D85BA275874F542CD20DC723E6963364A1F9425452B269A6799FD024028FA13938655BE1F8A159CBACA5A72EA190C30089E19CD274A556F36C4F6E19F554B34C077790427BBDD8DD3EDE2448328F385D81B30E8E43B2FFFA02786197902401A8B38F398FA712049898D7FB79EE0A77668791299CDFA09EFC0E507ACB21ED74301EF5BFD48BE455EAEB6E1678255827580A8E4E8E14151D1510A82A3F2E729024027156ABA4126D24A81F3A528CBFB27F56886F840A9F6E86E17A44B94FE9319584B8E22FDDE1E5A2E3BD8AA5BA8D8584194EB2190ACF832B847F13A3D24A79F4D",
196     "error": "DataError"
197   },
199   // Corrupted PKCS8 (byte index 450 was inverted, which is inside of "dp")
200   {
201     "key_format": "pkcs8",
202     "key": "30820275020100300D06092A864886F70D01010105000482025F3082025B02010002818100A56E4A0E701017589A5187DC7EA841D156F2EC0E36AD52A44DFEB1E61F7AD991D8C51056FFEDB162B4C0F283A12A88A394DFF526AB7291CBB307CEABFCE0B1DFD5CD9508096D5B2B8B6DF5D671EF6377C0921CB23C270A70E2598E6FF89D19F105ACC2D3F0CB35F29280E1386B6F64C4EF22E1E1F20D0CE8CFFB2249BD9A2137020301000102818033A5042A90B27D4F5451CA9BBBD0B44771A101AF884340AEF9885F2A4BBE92E894A724AC3C568C8F97853AD07C0266C8C6A3CA0929F1E8F11231884429FC4D9AE55FEE896A10CE707C3ED7E734E44727A39574501A532683109C2ABACABA283C31B4BD2F53C3EE37E352CEE34F9E503BD80C0622AD79C6DCEE883547C6A3B325024100E7E8942720A877517273A356053EA2A1BC0C94AA72D55C6E86296B2DFC967948C0A72CBCCCA7EACB35706E09A1DF55A1535BD9B3CC34160B3B6DCD3EDA8E6443024100B69DCA1CF7D4D7EC81E75B90FCCA874ABCDE123FD2700180AA90479B6E48DE8D67ED24F9F19D85BA275874F542CD20DC723E6963364A1F9425452B269A6799FD024028FA13938655BE1F8A159CBACAA572EA190C30089E19CD274A556F36C4F6E19F554B34C077790427BBDD8DD3EDE2448328F385D81B30E8E43B2FFFA02786197902401A8B38F398FA712049898D7FB79EE0A77668791299CDFA09EFC0E507ACB21ED74301EF5BFD48BE455EAEB6E1678255827580A8E4E8E14151D1510A82A3F2E729024027156ABA4126D24A81F3A528CBFB27F56886F840A9F6E86E17A44B94FE9319584B8E22FDDE1E5A2E3BD8AA5BA8D8584194EB2190ACF832B847F13A3D24A79F4D",
203     "error": "DataError"
204   },
206   // Corrupted PKCS8 (byte index 550 was inverted, which is inside of "dq")
207   {
208     "key_format": "pkcs8",
209     "key": "30820275020100300D06092A864886F70D01010105000482025F3082025B02010002818100A56E4A0E701017589A5187DC7EA841D156F2EC0E36AD52A44DFEB1E61F7AD991D8C51056FFEDB162B4C0F283A12A88A394DFF526AB7291CBB307CEABFCE0B1DFD5CD9508096D5B2B8B6DF5D671EF6377C0921CB23C270A70E2598E6FF89D19F105ACC2D3F0CB35F29280E1386B6F64C4EF22E1E1F20D0CE8CFFB2249BD9A2137020301000102818033A5042A90B27D4F5451CA9BBBD0B44771A101AF884340AEF9885F2A4BBE92E894A724AC3C568C8F97853AD07C0266C8C6A3CA0929F1E8F11231884429FC4D9AE55FEE896A10CE707C3ED7E734E44727A39574501A532683109C2ABACABA283C31B4BD2F53C3EE37E352CEE34F9E503BD80C0622AD79C6DCEE883547C6A3B325024100E7E8942720A877517273A356053EA2A1BC0C94AA72D55C6E86296B2DFC967948C0A72CBCCCA7EACB35706E09A1DF55A1535BD9B3CC34160B3B6DCD3EDA8E6443024100B69DCA1CF7D4D7EC81E75B90FCCA874ABCDE123FD2700180AA90479B6E48DE8D67ED24F9F19D85BA275874F542CD20DC723E6963364A1F9425452B269A6799FD024028FA13938655BE1F8A159CBACA5A72EA190C30089E19CD274A556F36C4F6E19F554B34C077790427BBDD8DD3EDE2448328F385D81B30E8E43B2FFFA02786197902401A8B38F398FA712049898D7FB79EE0A77668791299CDFA09EFC0E507ACB21ED74301EF5BFD48BE455EAEB6E16782557D7580A8E4E8E14151D1510A82A3F2E729024027156ABA4126D24A81F3A528CBFB27F56886F840A9F6E86E17A44B94FE9319584B8E22FDDE1E5A2E3BD8AA5BA8D8584194EB2190ACF832B847F13A3D24A79F4D",
210     "error": "DataError"
211   },
213   // Corrupted PKCS8 (byte index 600 was inverted, which is inside of "qi")
214   {
215     "key_format": "pkcs8",
216     "key": "30820275020100300D06092A864886F70D01010105000482025F3082025B02010002818100A56E4A0E701017589A5187DC7EA841D156F2EC0E36AD52A44DFEB1E61F7AD991D8C51056FFEDB162B4C0F283A12A88A394DFF526AB7291CBB307CEABFCE0B1DFD5CD9508096D5B2B8B6DF5D671EF6377C0921CB23C270A70E2598E6FF89D19F105ACC2D3F0CB35F29280E1386B6F64C4EF22E1E1F20D0CE8CFFB2249BD9A2137020301000102818033A5042A90B27D4F5451CA9BBBD0B44771A101AF884340AEF9885F2A4BBE92E894A724AC3C568C8F97853AD07C0266C8C6A3CA0929F1E8F11231884429FC4D9AE55FEE896A10CE707C3ED7E734E44727A39574501A532683109C2ABACABA283C31B4BD2F53C3EE37E352CEE34F9E503BD80C0622AD79C6DCEE883547C6A3B325024100E7E8942720A877517273A356053EA2A1BC0C94AA72D55C6E86296B2DFC967948C0A72CBCCCA7EACB35706E09A1DF55A1535BD9B3CC34160B3B6DCD3EDA8E6443024100B69DCA1CF7D4D7EC81E75B90FCCA874ABCDE123FD2700180AA90479B6E48DE8D67ED24F9F19D85BA275874F542CD20DC723E6963364A1F9425452B269A6799FD024028FA13938655BE1F8A159CBACA5A72EA190C30089E19CD274A556F36C4F6E19F554B34C077790427BBDD8DD3EDE2448328F385D81B30E8E43B2FFFA02786197902401A8B38F398FA712049898D7FB79EE0A77668791299CDFA09EFC0E507ACB21ED74301EF5BFD48BE455EAEB6E1678255827580A8E4E8E14151D1510A82A3F2E729024027156ABA4126D24A81F3A528CBFB27F56886F840A9F6E86E17A44B94FE9319A74B8E22FDDE1E5A2E3BD8AA5BA8D8584194EB2190ACF832B847F13A3D24A79F4D",
217     "error": "DataError"
218   },
220   // PKCS8 with only n, e, d parameters supplied, and all others are 0
221   {
222     "key_format": "pkcs8",
223     "key": "30820138020100300D06092A864886F70D0101010500048201223082011E02010002818100A56E4A0E701017589A5187DC7EA841D156F2EC0E36AD52A44DFEB1E61F7AD991D8C51056FFEDB162B4C0F283A12A88A394DFF526AB7291CBB307CEABFCE0B1DFD5CD9508096D5B2B8B6DF5D671EF6377C0921CB23C270A70E2598E6FF89D19F105ACC2D3F0CB35F29280E1386B6F64C4EF22E1E1F20D0CE8CFFB2249BD9A2137020301000102818033A5042A90B27D4F5451CA9BBBD0B44771A101AF884340AEF9885F2A4BBE92E894A724AC3C568C8F97853AD07C0266C8C6A3CA0929F1E8F11231884429FC4D9AE55FEE896A10CE707C3ED7E734E44727A39574501A532683109C2ABACABA283C31B4BD2F53C3EE37E352CEE34F9E503BD80C0622AD79C6DCEE883547C6A3B325020100020100020100020100020100",
224     "error": "DataError"
225   },
227   // Valid PKCS8, however it defines an EC key not an RSA key.
228   {
229     "key_format": "pkcs8",
230     "key": "308187020100301306072A8648CE3D020106082A8648CE3D030107046D306B02010104201FE33950C5F461124AE992C2BDFDF1C73B1615F571BD567E60D19AA1F48CDF42A144034200047C110C66DCFDA807F6E69E45DDB3C74F69A1484D203E8DC5ADA8E9A9DD7CB3C70DF448986E51BDE5D1576F99901F9C2C6A806A47FD907643A72B835597EFC8C6",
231     "error": "DataError"
232   },
234   // Valid SPKI, however it defines an EC key not an RSA key.
235   {
236     "key_format": "spki",
237     "key": "3059301306072A8648CE3D020106082A8648CE3D030107034200049CB0CF69303DAFC761D4E4687B4ECF039E6D34AB964AF80810D8D558A4A8D6F72D51233A1788920A86EE08A1962C79EFA317FB7879E297DAD2146DB995FA1C78",
238     "error": "DataError"
239   },
241   // PKCS8 with extra data after it.
242   {
243     "key_format": "pkcs8",
244     "key": "30820275020100300D06092A864886F70D01010105000482025F3082025B02010002818100A56E4A0E701017589A5187DC7EA841D156F2EC0E36AD52A44DFEB1E61F7AD991D8C51056FFEDB162B4C0F283A12A88A394DFF526AB7291CBB307CEABFCE0B1DFD5CD9508096D5B2B8B6DF5D671EF6377C0921CB23C270A70E2598E6FF89D19F105ACC2D3F0CB35F29280E1386B6F64C4EF22E1E1F20D0CE8CFFB2249BD9A2137020301000102818033A5042A90B27D4F5451CA9BBBD0B44771A101AF884340AEF9885F2A4BBE92E894A724AC3C568C8F97853AD07C0266C8C6A3CA0929F1E8F11231884429FC4D9AE55FEE896A10CE707C3ED7E734E44727A39574501A532683109C2ABACABA283C31B4BD2F53C3EE37E352CEE34F9E503BD80C0622AD79C6DCEE883547C6A3B325024100E7E8942720A877517273A356053EA2A1BC0C94AA72D55C6E86296B2DFC967948C0A72CBCCCA7EACB35706E09A1DF55A1535BD9B3CC34160B3B6DCD3EDA8E6443024100B69DCA1CF7D4D7EC81E75B90FCCA874ABCDE123FD2700180AA90479B6E48DE8D67ED24F9F19D85BA275874F542CD20DC723E6963364A1F9425452B269A6799FD024028FA13938655BE1F8A159CBACA5A72EA190C30089E19CD274A556F36C4F6E19F554B34C077790427BBDD8DD3EDE2448328F385D81B30E8E43B2FFFA02786197902401A8B38F398FA712049898D7FB79EE0A77668791299CDFA09EFC0E507ACB21ED74301EF5BFD48BE455EAEB6E1678255827580A8E4E8E14151D1510A82A3F2E729024027156ABA4126D24A81F3A528CBFB27F56886F840A9F6E86E17A44B94FE9319584B8E22FDDE1E5A2E3BD8AA5BA8D8584194EB2190ACF832B847F13A3D24A79F4D00000000",
245     "error": "DataError"
246   },
248   // SPKI with extra data after it.
249   {
250     "key_format": "spki",
251     "key": "30819F300D06092A864886F70D010101050003818D0030818902818100A56E4A0E701017589A5187DC7EA841D156F2EC0E36AD52A44DFEB1E61F7AD991D8C51056FFEDB162B4C0F283A12A88A394DFF526AB7291CBB307CEABFCE0B1DFD5CD9508096D5B2B8B6DF5D671EF6377C0921CB23C270A70E2598E6FF89D19F105ACC2D3F0CB35F29280E1386B6F64C4EF22E1E1F20D0CE8CFFB2249BD9A2137020301000100000000",
252     "error": "DataError"
253   },
255   // Base64 padding was added to the "d" member (==).
256   {
257     "key_format": "jwk",
258     "key": {
259        "alg": "RS256",
260        "d": "ZmJJJ3PBfirgPEOb844fI_1_zXn3A09X9fkk-65xeTNo3JeigTPpuB54FC_GXUmqiXLVx5gynO6cwl9wjxVKYQ==",
261        "dp": "DOUuUiDhtjpnCuIjcGRWhQYok8NeUO5XV1Uwx1-DxtU",
262        "dq": "mKOBL1e74J8OuGtW1kc2-s4VEP5Eeiwe__TAeBm-roE",
263        "e": "AQAB",
264        "kty": "RSA",
265        "n": "tFJAFt_UiJsHlRavDgOxOnYKTHkV-cF1aTDtkzNg6WYt9geaPbAvFnR3FVO0BFsl8tzPzMOTkI_kbOfCfAw3FQ",
266        "p": "7kMQn01JVhyHM7B85hLUuNBDsXiboMc4Di81qmxX7r0",
267        "q": "wb7rEiGxG4CrybVYns9voNQM2NPCuCEgWPLA_vCkuzk",
268        "qi": "6rrPQ4YaOLNGtG7TrLXUR_FSWpOFSUveHTHbFQU6iNU"
269     },
270     "error": "DataError: The JWK member \"d\" could not be base64url decoded or contained padding"
271   },
273   // A '/' was used in place of '_' in the "n" member. While this is valid for
274   // Base64, it is now for JWK's encoding scheme.
275   {
276     "key_format": "jwk",
277     "key": {
278        "alg": "RS256",
279        "d": "ZmJJJ3PBfirgPEOb844fI_1_zXn3A09X9fkk-65xeTNo3JeigTPpuB54FC_GXUmqiXLVx5gynO6cwl9wjxVKYQ",
280        "dp": "DOUuUiDhtjpnCuIjcGRWhQYok8NeUO5XV1Uwx1-DxtU",
281        "dq": "mKOBL1e74J8OuGtW1kc2-s4VEP5Eeiwe__TAeBm-roE",
282        "e": "AQAB",
283        "kty": "RSA",
284        "n": "tFJAFt_UiJsHlRavDgOxOnYKTHkV-cF1aTDtkzNg6WYt9geaPbAvFnR3FVO0BFsl8tzPzMOTkI/kbOfCfAw3FQ",
285        "p": "7kMQn01JVhyHM7B85hLUuNBDsXiboMc4Di81qmxX7r0",
286        "q": "wb7rEiGxG4CrybVYns9voNQM2NPCuCEgWPLA_vCkuzk",
287        "qi": "6rrPQ4YaOLNGtG7TrLXUR_FSWpOFSUveHTHbFQU6iNU"
288     },
289     "error": "DataError: The JWK member \"n\" could not be base64url decoded or contained padding"
290   },
292   // A '+' was used in place of '-' in the "dq" member. While this is valid for
293   // Base64, it is now for JWK's encoding scheme.
294   {
295     "key_format": "jwk",
296     "key": {
297        "alg": "RS256",
298        "d": "ZmJJJ3PBfirgPEOb844fI_1_zXn3A09X9fkk-65xeTNo3JeigTPpuB54FC_GXUmqiXLVx5gynO6cwl9wjxVKYQ",
299        "dp": "DOUuUiDhtjpnCuIjcGRWhQYok8NeUO5XV1Uwx1-DxtU",
300        "dq": "mKOBL1e74J8OuGtW1kc2+s4VEP5Eeiwe__TAeBm-roE",
301        "e": "AQAB",
302        "kty": "RSA",
303        "n": "tFJAFt_UiJsHlRavDgOxOnYKTHkV-cF1aTDtkzNg6WYt9geaPbAvFnR3FVO0BFsl8tzPzMOTkI_kbOfCfAw3FQ",
304        "p": "7kMQn01JVhyHM7B85hLUuNBDsXiboMc4Di81qmxX7r0",
305        "q": "wb7rEiGxG4CrybVYns9voNQM2NPCuCEgWPLA_vCkuzk",
306        "qi": "6rrPQ4YaOLNGtG7TrLXUR_FSWpOFSUveHTHbFQU6iNU"
307     },
308     "error": "DataError: The JWK member \"dq\" could not be base64url decoded or contained padding"
309   }