|
1 /* |
|
2 * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. |
|
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
|
4 * |
|
5 * This code is free software; you can redistribute it and/or modify it |
|
6 * under the terms of the GNU General Public License version 2 only, as |
|
7 * published by the Free Software Foundation. |
|
8 * |
|
9 * This code is distributed in the hope that it will be useful, but WITHOUT |
|
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
12 * version 2 for more details (a copy is included in the LICENSE file that |
|
13 * accompanied this code). |
|
14 * |
|
15 * You should have received a copy of the GNU General Public License version |
|
16 * 2 along with this work; if not, write to the Free Software Foundation, |
|
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
18 * |
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
|
20 * or visit www.oracle.com if you need additional information or have any |
|
21 * questions. |
|
22 */ |
|
23 |
|
24 /* |
|
25 * @test |
|
26 * @bug 8014618 |
|
27 * @summary Need to strip leading zeros in TlsPremasterSecret of DHKeyAgreement |
|
28 * @library .. |
|
29 * @author Pasi Eronen |
|
30 */ |
|
31 |
|
32 import java.io.*; |
|
33 import java.security.*; |
|
34 import java.security.spec.*; |
|
35 import java.security.interfaces.*; |
|
36 import javax.crypto.*; |
|
37 import javax.crypto.spec.*; |
|
38 import javax.crypto.interfaces.*; |
|
39 |
|
40 /** |
|
41 * Test that leading zeroes are stripped in TlsPremasterSecret case, |
|
42 * but are left as-is in other cases. |
|
43 * |
|
44 * We use pre-generated keypairs, since with randomly generated keypairs, |
|
45 * a leading zero happens only (roughly) 1 out of 256 cases. |
|
46 */ |
|
47 |
|
48 public class TestLeadingZeroesP11 extends PKCS11Test { |
|
49 |
|
50 public static void main(String[] args) throws Exception { |
|
51 main(new TestLeadingZeroesP11()); |
|
52 } |
|
53 |
|
54 public void main(Provider p) throws Exception { |
|
55 |
|
56 // decode pre-generated keypairs |
|
57 KeyFactory kfac = KeyFactory.getInstance("DH", p); |
|
58 PublicKey alicePubKey = |
|
59 kfac.generatePublic(new X509EncodedKeySpec(alicePubKeyEnc)); |
|
60 PublicKey bobPubKey = |
|
61 kfac.generatePublic(new X509EncodedKeySpec(bobPubKeyEnc)); |
|
62 PrivateKey alicePrivKey = |
|
63 kfac.generatePrivate(new PKCS8EncodedKeySpec(alicePrivKeyEnc)); |
|
64 PrivateKey bobPrivKey = |
|
65 kfac.generatePrivate(new PKCS8EncodedKeySpec(bobPrivKeyEnc)); |
|
66 |
|
67 // generate normal shared secret |
|
68 KeyAgreement aliceKeyAgree = KeyAgreement.getInstance("DH", p); |
|
69 aliceKeyAgree.init(alicePrivKey); |
|
70 aliceKeyAgree.doPhase(bobPubKey, true); |
|
71 byte[] sharedSecret = aliceKeyAgree.generateSecret(); |
|
72 System.out.println("shared secret:\n" + toHexString(sharedSecret)); |
|
73 |
|
74 // verify that leading zero is present |
|
75 if (sharedSecret.length != 128) { |
|
76 throw new Exception("Unexpected shared secret length"); |
|
77 } |
|
78 if (sharedSecret[0] != 0) { |
|
79 throw new Exception("First byte is not zero as expected"); |
|
80 } |
|
81 |
|
82 // now, test TLS premaster secret |
|
83 aliceKeyAgree.init(alicePrivKey); |
|
84 aliceKeyAgree.doPhase(bobPubKey, true); |
|
85 byte[] tlsPremasterSecret = |
|
86 aliceKeyAgree.generateSecret("TlsPremasterSecret").getEncoded(); |
|
87 System.out.println( |
|
88 "tls premaster secret:\n" + toHexString(tlsPremasterSecret)); |
|
89 |
|
90 // check that leading zero has been stripped |
|
91 if (tlsPremasterSecret.length != 127) { |
|
92 throw new Exception("Unexpected TLS premaster secret length"); |
|
93 } |
|
94 if (tlsPremasterSecret[0] == 0) { |
|
95 throw new Exception("First byte is zero"); |
|
96 } |
|
97 for (int i = 0; i < tlsPremasterSecret.length; i++) { |
|
98 if (tlsPremasterSecret[i] != sharedSecret[i+1]) { |
|
99 throw new Exception("Shared secrets differ"); |
|
100 } |
|
101 } |
|
102 |
|
103 } |
|
104 |
|
105 /* |
|
106 * Converts a byte to hex digit and writes to the supplied buffer |
|
107 */ |
|
108 private void byte2hex(byte b, StringBuffer buf) { |
|
109 char[] hexChars = { '0', '1', '2', '3', '4', '5', '6', '7', '8', |
|
110 '9', 'A', 'B', 'C', 'D', 'E', 'F' }; |
|
111 int high = ((b & 0xf0) >> 4); |
|
112 int low = (b & 0x0f); |
|
113 buf.append(hexChars[high]); |
|
114 buf.append(hexChars[low]); |
|
115 } |
|
116 |
|
117 /* |
|
118 * Converts a byte array to hex string |
|
119 */ |
|
120 private String toHexString(byte[] block) { |
|
121 StringBuffer buf = new StringBuffer(); |
|
122 |
|
123 int len = block.length; |
|
124 |
|
125 for (int i = 0; i < len; i++) { |
|
126 byte2hex(block[i], buf); |
|
127 if (i < len-1) { |
|
128 buf.append(":"); |
|
129 } |
|
130 } |
|
131 return buf.toString(); |
|
132 } |
|
133 |
|
134 private static final byte alicePubKeyEnc[] = { |
|
135 (byte)0x30, (byte)0x82, (byte)0x01, (byte)0x24, |
|
136 (byte)0x30, (byte)0x81, (byte)0x99, (byte)0x06, |
|
137 (byte)0x09, (byte)0x2A, (byte)0x86, (byte)0x48, |
|
138 (byte)0x86, (byte)0xF7, (byte)0x0D, (byte)0x01, |
|
139 (byte)0x03, (byte)0x01, (byte)0x30, (byte)0x81, |
|
140 (byte)0x8B, (byte)0x02, (byte)0x81, (byte)0x81, |
|
141 (byte)0x00, (byte)0xF4, (byte)0x88, (byte)0xFD, |
|
142 (byte)0x58, (byte)0x4E, (byte)0x49, (byte)0xDB, |
|
143 (byte)0xCD, (byte)0x20, (byte)0xB4, (byte)0x9D, |
|
144 (byte)0xE4, (byte)0x91, (byte)0x07, (byte)0x36, |
|
145 (byte)0x6B, (byte)0x33, (byte)0x6C, (byte)0x38, |
|
146 (byte)0x0D, (byte)0x45, (byte)0x1D, (byte)0x0F, |
|
147 (byte)0x7C, (byte)0x88, (byte)0xB3, (byte)0x1C, |
|
148 (byte)0x7C, (byte)0x5B, (byte)0x2D, (byte)0x8E, |
|
149 (byte)0xF6, (byte)0xF3, (byte)0xC9, (byte)0x23, |
|
150 (byte)0xC0, (byte)0x43, (byte)0xF0, (byte)0xA5, |
|
151 (byte)0x5B, (byte)0x18, (byte)0x8D, (byte)0x8E, |
|
152 (byte)0xBB, (byte)0x55, (byte)0x8C, (byte)0xB8, |
|
153 (byte)0x5D, (byte)0x38, (byte)0xD3, (byte)0x34, |
|
154 (byte)0xFD, (byte)0x7C, (byte)0x17, (byte)0x57, |
|
155 (byte)0x43, (byte)0xA3, (byte)0x1D, (byte)0x18, |
|
156 (byte)0x6C, (byte)0xDE, (byte)0x33, (byte)0x21, |
|
157 (byte)0x2C, (byte)0xB5, (byte)0x2A, (byte)0xFF, |
|
158 (byte)0x3C, (byte)0xE1, (byte)0xB1, (byte)0x29, |
|
159 (byte)0x40, (byte)0x18, (byte)0x11, (byte)0x8D, |
|
160 (byte)0x7C, (byte)0x84, (byte)0xA7, (byte)0x0A, |
|
161 (byte)0x72, (byte)0xD6, (byte)0x86, (byte)0xC4, |
|
162 (byte)0x03, (byte)0x19, (byte)0xC8, (byte)0x07, |
|
163 (byte)0x29, (byte)0x7A, (byte)0xCA, (byte)0x95, |
|
164 (byte)0x0C, (byte)0xD9, (byte)0x96, (byte)0x9F, |
|
165 (byte)0xAB, (byte)0xD0, (byte)0x0A, (byte)0x50, |
|
166 (byte)0x9B, (byte)0x02, (byte)0x46, (byte)0xD3, |
|
167 (byte)0x08, (byte)0x3D, (byte)0x66, (byte)0xA4, |
|
168 (byte)0x5D, (byte)0x41, (byte)0x9F, (byte)0x9C, |
|
169 (byte)0x7C, (byte)0xBD, (byte)0x89, (byte)0x4B, |
|
170 (byte)0x22, (byte)0x19, (byte)0x26, (byte)0xBA, |
|
171 (byte)0xAB, (byte)0xA2, (byte)0x5E, (byte)0xC3, |
|
172 (byte)0x55, (byte)0xE9, (byte)0x2F, (byte)0x78, |
|
173 (byte)0xC7, (byte)0x02, (byte)0x01, (byte)0x02, |
|
174 (byte)0x02, (byte)0x02, (byte)0x02, (byte)0x00, |
|
175 (byte)0x03, (byte)0x81, (byte)0x85, (byte)0x00, |
|
176 (byte)0x02, (byte)0x81, (byte)0x81, (byte)0x00, |
|
177 (byte)0xEE, (byte)0xD6, (byte)0xB1, (byte)0xA3, |
|
178 (byte)0xB4, (byte)0x78, (byte)0x2B, (byte)0x35, |
|
179 (byte)0xEF, (byte)0xCD, (byte)0x17, (byte)0x86, |
|
180 (byte)0x63, (byte)0x2B, (byte)0x97, (byte)0x0E, |
|
181 (byte)0x7A, (byte)0xD1, (byte)0xFF, (byte)0x7A, |
|
182 (byte)0xEB, (byte)0x57, (byte)0x61, (byte)0xA1, |
|
183 (byte)0xF7, (byte)0x90, (byte)0x11, (byte)0xA7, |
|
184 (byte)0x79, (byte)0x28, (byte)0x69, (byte)0xBA, |
|
185 (byte)0xA7, (byte)0xB2, (byte)0x37, (byte)0x17, |
|
186 (byte)0xAE, (byte)0x3C, (byte)0x92, (byte)0x89, |
|
187 (byte)0x88, (byte)0xE5, (byte)0x7E, (byte)0x8E, |
|
188 (byte)0xF0, (byte)0x24, (byte)0xD0, (byte)0xE1, |
|
189 (byte)0xC4, (byte)0xB0, (byte)0x26, (byte)0x5A, |
|
190 (byte)0x1E, (byte)0xBD, (byte)0xA0, (byte)0xCF, |
|
191 (byte)0x3E, (byte)0x97, (byte)0x2A, (byte)0x13, |
|
192 (byte)0x92, (byte)0x3B, (byte)0x39, (byte)0xD0, |
|
193 (byte)0x1D, (byte)0xA3, (byte)0x6B, (byte)0x3E, |
|
194 (byte)0xC2, (byte)0xBB, (byte)0x14, (byte)0xB6, |
|
195 (byte)0xE2, (byte)0x4C, (byte)0x0E, (byte)0x5B, |
|
196 (byte)0x4B, (byte)0xA4, (byte)0x9D, (byte)0xA6, |
|
197 (byte)0x21, (byte)0xB0, (byte)0xF9, (byte)0xDE, |
|
198 (byte)0x55, (byte)0xAE, (byte)0x5C, (byte)0x29, |
|
199 (byte)0x0E, (byte)0xC1, (byte)0xFC, (byte)0xBA, |
|
200 (byte)0x51, (byte)0xD3, (byte)0xB6, (byte)0x6D, |
|
201 (byte)0x75, (byte)0x72, (byte)0xDF, (byte)0x43, |
|
202 (byte)0xAB, (byte)0x94, (byte)0x21, (byte)0x6E, |
|
203 (byte)0x0C, (byte)0xD1, (byte)0x93, (byte)0x54, |
|
204 (byte)0x56, (byte)0x7D, (byte)0x4B, (byte)0x90, |
|
205 (byte)0xF1, (byte)0x94, (byte)0x45, (byte)0xD4, |
|
206 (byte)0x2A, (byte)0x71, (byte)0xA1, (byte)0xB8, |
|
207 (byte)0xDD, (byte)0xAA, (byte)0x05, (byte)0xF0, |
|
208 (byte)0x27, (byte)0x37, (byte)0xBD, (byte)0x44 |
|
209 }; |
|
210 |
|
211 private static final byte alicePrivKeyEnc[] = { |
|
212 (byte)0x30, (byte)0x81, (byte)0xE3, (byte)0x02, |
|
213 (byte)0x01, (byte)0x00, (byte)0x30, (byte)0x81, |
|
214 (byte)0x99, (byte)0x06, (byte)0x09, (byte)0x2A, |
|
215 (byte)0x86, (byte)0x48, (byte)0x86, (byte)0xF7, |
|
216 (byte)0x0D, (byte)0x01, (byte)0x03, (byte)0x01, |
|
217 (byte)0x30, (byte)0x81, (byte)0x8B, (byte)0x02, |
|
218 (byte)0x81, (byte)0x81, (byte)0x00, (byte)0xF4, |
|
219 (byte)0x88, (byte)0xFD, (byte)0x58, (byte)0x4E, |
|
220 (byte)0x49, (byte)0xDB, (byte)0xCD, (byte)0x20, |
|
221 (byte)0xB4, (byte)0x9D, (byte)0xE4, (byte)0x91, |
|
222 (byte)0x07, (byte)0x36, (byte)0x6B, (byte)0x33, |
|
223 (byte)0x6C, (byte)0x38, (byte)0x0D, (byte)0x45, |
|
224 (byte)0x1D, (byte)0x0F, (byte)0x7C, (byte)0x88, |
|
225 (byte)0xB3, (byte)0x1C, (byte)0x7C, (byte)0x5B, |
|
226 (byte)0x2D, (byte)0x8E, (byte)0xF6, (byte)0xF3, |
|
227 (byte)0xC9, (byte)0x23, (byte)0xC0, (byte)0x43, |
|
228 (byte)0xF0, (byte)0xA5, (byte)0x5B, (byte)0x18, |
|
229 (byte)0x8D, (byte)0x8E, (byte)0xBB, (byte)0x55, |
|
230 (byte)0x8C, (byte)0xB8, (byte)0x5D, (byte)0x38, |
|
231 (byte)0xD3, (byte)0x34, (byte)0xFD, (byte)0x7C, |
|
232 (byte)0x17, (byte)0x57, (byte)0x43, (byte)0xA3, |
|
233 (byte)0x1D, (byte)0x18, (byte)0x6C, (byte)0xDE, |
|
234 (byte)0x33, (byte)0x21, (byte)0x2C, (byte)0xB5, |
|
235 (byte)0x2A, (byte)0xFF, (byte)0x3C, (byte)0xE1, |
|
236 (byte)0xB1, (byte)0x29, (byte)0x40, (byte)0x18, |
|
237 (byte)0x11, (byte)0x8D, (byte)0x7C, (byte)0x84, |
|
238 (byte)0xA7, (byte)0x0A, (byte)0x72, (byte)0xD6, |
|
239 (byte)0x86, (byte)0xC4, (byte)0x03, (byte)0x19, |
|
240 (byte)0xC8, (byte)0x07, (byte)0x29, (byte)0x7A, |
|
241 (byte)0xCA, (byte)0x95, (byte)0x0C, (byte)0xD9, |
|
242 (byte)0x96, (byte)0x9F, (byte)0xAB, (byte)0xD0, |
|
243 (byte)0x0A, (byte)0x50, (byte)0x9B, (byte)0x02, |
|
244 (byte)0x46, (byte)0xD3, (byte)0x08, (byte)0x3D, |
|
245 (byte)0x66, (byte)0xA4, (byte)0x5D, (byte)0x41, |
|
246 (byte)0x9F, (byte)0x9C, (byte)0x7C, (byte)0xBD, |
|
247 (byte)0x89, (byte)0x4B, (byte)0x22, (byte)0x19, |
|
248 (byte)0x26, (byte)0xBA, (byte)0xAB, (byte)0xA2, |
|
249 (byte)0x5E, (byte)0xC3, (byte)0x55, (byte)0xE9, |
|
250 (byte)0x2F, (byte)0x78, (byte)0xC7, (byte)0x02, |
|
251 (byte)0x01, (byte)0x02, (byte)0x02, (byte)0x02, |
|
252 (byte)0x02, (byte)0x00, (byte)0x04, (byte)0x42, |
|
253 (byte)0x02, (byte)0x40, (byte)0x36, (byte)0x4D, |
|
254 (byte)0xD0, (byte)0x58, (byte)0x64, (byte)0x91, |
|
255 (byte)0x78, (byte)0xA2, (byte)0x4B, (byte)0x79, |
|
256 (byte)0x46, (byte)0xFE, (byte)0xC9, (byte)0xD9, |
|
257 (byte)0xCA, (byte)0x5C, (byte)0xF9, (byte)0xFD, |
|
258 (byte)0x6C, (byte)0x5D, (byte)0x76, (byte)0x3A, |
|
259 (byte)0x41, (byte)0x6D, (byte)0x44, (byte)0x62, |
|
260 (byte)0x75, (byte)0x93, (byte)0x81, (byte)0x93, |
|
261 (byte)0x00, (byte)0x4C, (byte)0xB1, (byte)0xD8, |
|
262 (byte)0x7D, (byte)0x9D, (byte)0xF3, (byte)0x16, |
|
263 (byte)0x2C, (byte)0x6C, (byte)0x9F, (byte)0x7A, |
|
264 (byte)0x84, (byte)0xA3, (byte)0x7A, (byte)0xC1, |
|
265 (byte)0x4F, (byte)0x60, (byte)0xE3, (byte)0xB5, |
|
266 (byte)0x86, (byte)0x28, (byte)0x08, (byte)0x4D, |
|
267 (byte)0x94, (byte)0xB6, (byte)0x04, (byte)0x0D, |
|
268 (byte)0xAC, (byte)0xBD, (byte)0x1F, (byte)0x42, |
|
269 (byte)0x8F, (byte)0x1B |
|
270 }; |
|
271 |
|
272 private static final byte bobPubKeyEnc[] = { |
|
273 (byte)0x30, (byte)0x82, (byte)0x01, (byte)0x23, |
|
274 (byte)0x30, (byte)0x81, (byte)0x99, (byte)0x06, |
|
275 (byte)0x09, (byte)0x2A, (byte)0x86, (byte)0x48, |
|
276 (byte)0x86, (byte)0xF7, (byte)0x0D, (byte)0x01, |
|
277 (byte)0x03, (byte)0x01, (byte)0x30, (byte)0x81, |
|
278 (byte)0x8B, (byte)0x02, (byte)0x81, (byte)0x81, |
|
279 (byte)0x00, (byte)0xF4, (byte)0x88, (byte)0xFD, |
|
280 (byte)0x58, (byte)0x4E, (byte)0x49, (byte)0xDB, |
|
281 (byte)0xCD, (byte)0x20, (byte)0xB4, (byte)0x9D, |
|
282 (byte)0xE4, (byte)0x91, (byte)0x07, (byte)0x36, |
|
283 (byte)0x6B, (byte)0x33, (byte)0x6C, (byte)0x38, |
|
284 (byte)0x0D, (byte)0x45, (byte)0x1D, (byte)0x0F, |
|
285 (byte)0x7C, (byte)0x88, (byte)0xB3, (byte)0x1C, |
|
286 (byte)0x7C, (byte)0x5B, (byte)0x2D, (byte)0x8E, |
|
287 (byte)0xF6, (byte)0xF3, (byte)0xC9, (byte)0x23, |
|
288 (byte)0xC0, (byte)0x43, (byte)0xF0, (byte)0xA5, |
|
289 (byte)0x5B, (byte)0x18, (byte)0x8D, (byte)0x8E, |
|
290 (byte)0xBB, (byte)0x55, (byte)0x8C, (byte)0xB8, |
|
291 (byte)0x5D, (byte)0x38, (byte)0xD3, (byte)0x34, |
|
292 (byte)0xFD, (byte)0x7C, (byte)0x17, (byte)0x57, |
|
293 (byte)0x43, (byte)0xA3, (byte)0x1D, (byte)0x18, |
|
294 (byte)0x6C, (byte)0xDE, (byte)0x33, (byte)0x21, |
|
295 (byte)0x2C, (byte)0xB5, (byte)0x2A, (byte)0xFF, |
|
296 (byte)0x3C, (byte)0xE1, (byte)0xB1, (byte)0x29, |
|
297 (byte)0x40, (byte)0x18, (byte)0x11, (byte)0x8D, |
|
298 (byte)0x7C, (byte)0x84, (byte)0xA7, (byte)0x0A, |
|
299 (byte)0x72, (byte)0xD6, (byte)0x86, (byte)0xC4, |
|
300 (byte)0x03, (byte)0x19, (byte)0xC8, (byte)0x07, |
|
301 (byte)0x29, (byte)0x7A, (byte)0xCA, (byte)0x95, |
|
302 (byte)0x0C, (byte)0xD9, (byte)0x96, (byte)0x9F, |
|
303 (byte)0xAB, (byte)0xD0, (byte)0x0A, (byte)0x50, |
|
304 (byte)0x9B, (byte)0x02, (byte)0x46, (byte)0xD3, |
|
305 (byte)0x08, (byte)0x3D, (byte)0x66, (byte)0xA4, |
|
306 (byte)0x5D, (byte)0x41, (byte)0x9F, (byte)0x9C, |
|
307 (byte)0x7C, (byte)0xBD, (byte)0x89, (byte)0x4B, |
|
308 (byte)0x22, (byte)0x19, (byte)0x26, (byte)0xBA, |
|
309 (byte)0xAB, (byte)0xA2, (byte)0x5E, (byte)0xC3, |
|
310 (byte)0x55, (byte)0xE9, (byte)0x2F, (byte)0x78, |
|
311 (byte)0xC7, (byte)0x02, (byte)0x01, (byte)0x02, |
|
312 (byte)0x02, (byte)0x02, (byte)0x02, (byte)0x00, |
|
313 (byte)0x03, (byte)0x81, (byte)0x84, (byte)0x00, |
|
314 (byte)0x02, (byte)0x81, (byte)0x80, (byte)0x2C, |
|
315 (byte)0x40, (byte)0xFA, (byte)0xF6, (byte)0xA6, |
|
316 (byte)0xF8, (byte)0xAC, (byte)0xC2, (byte)0x4F, |
|
317 (byte)0xCD, (byte)0xC7, (byte)0x37, (byte)0x93, |
|
318 (byte)0xE5, (byte)0xE4, (byte)0x5E, (byte)0x18, |
|
319 (byte)0x14, (byte)0xE6, (byte)0x50, (byte)0xDA, |
|
320 (byte)0x55, (byte)0x38, (byte)0x5D, (byte)0x24, |
|
321 (byte)0xF5, (byte)0x42, (byte)0x68, (byte)0x5F, |
|
322 (byte)0xF5, (byte)0x15, (byte)0xC8, (byte)0x9B, |
|
323 (byte)0x5D, (byte)0x06, (byte)0x3D, (byte)0xE1, |
|
324 (byte)0x52, (byte)0x2F, (byte)0x98, (byte)0xFF, |
|
325 (byte)0x37, (byte)0xBB, (byte)0x75, (byte)0x48, |
|
326 (byte)0x48, (byte)0xE9, (byte)0x65, (byte)0x84, |
|
327 (byte)0x37, (byte)0xBB, (byte)0xB3, (byte)0xE9, |
|
328 (byte)0x36, (byte)0x01, (byte)0xB4, (byte)0x6A, |
|
329 (byte)0x1C, (byte)0xB2, (byte)0x11, (byte)0x82, |
|
330 (byte)0xCE, (byte)0x3D, (byte)0x65, (byte)0xE5, |
|
331 (byte)0x3C, (byte)0x89, (byte)0xE9, (byte)0x52, |
|
332 (byte)0x19, (byte)0xBD, (byte)0x58, (byte)0xF6, |
|
333 (byte)0xA2, (byte)0x03, (byte)0xA8, (byte)0xB2, |
|
334 (byte)0xA5, (byte)0xDB, (byte)0xEB, (byte)0xF5, |
|
335 (byte)0x94, (byte)0xF9, (byte)0x46, (byte)0xBE, |
|
336 (byte)0x45, (byte)0x4C, (byte)0x65, (byte)0xD2, |
|
337 (byte)0xD1, (byte)0xCF, (byte)0xFF, (byte)0xFF, |
|
338 (byte)0xFA, (byte)0x38, (byte)0xF1, (byte)0x72, |
|
339 (byte)0xAB, (byte)0xB9, (byte)0x14, (byte)0x4E, |
|
340 (byte)0xF5, (byte)0xF0, (byte)0x7A, (byte)0x8E, |
|
341 (byte)0x45, (byte)0xFD, (byte)0x5B, (byte)0xF9, |
|
342 (byte)0xA2, (byte)0x97, (byte)0x1B, (byte)0xAE, |
|
343 (byte)0x2C, (byte)0x7B, (byte)0x6B, (byte)0x7C, |
|
344 (byte)0x98, (byte)0xFE, (byte)0x58, (byte)0xDD, |
|
345 (byte)0xBE, (byte)0xF6, (byte)0x1C, (byte)0x8E, |
|
346 (byte)0xD0, (byte)0xA1, (byte)0x72 |
|
347 }; |
|
348 |
|
349 private static final byte bobPrivKeyEnc[] = { |
|
350 (byte)0x30, (byte)0x81, (byte)0xE4, (byte)0x02, |
|
351 (byte)0x01, (byte)0x00, (byte)0x30, (byte)0x81, |
|
352 (byte)0x99, (byte)0x06, (byte)0x09, (byte)0x2A, |
|
353 (byte)0x86, (byte)0x48, (byte)0x86, (byte)0xF7, |
|
354 (byte)0x0D, (byte)0x01, (byte)0x03, (byte)0x01, |
|
355 (byte)0x30, (byte)0x81, (byte)0x8B, (byte)0x02, |
|
356 (byte)0x81, (byte)0x81, (byte)0x00, (byte)0xF4, |
|
357 (byte)0x88, (byte)0xFD, (byte)0x58, (byte)0x4E, |
|
358 (byte)0x49, (byte)0xDB, (byte)0xCD, (byte)0x20, |
|
359 (byte)0xB4, (byte)0x9D, (byte)0xE4, (byte)0x91, |
|
360 (byte)0x07, (byte)0x36, (byte)0x6B, (byte)0x33, |
|
361 (byte)0x6C, (byte)0x38, (byte)0x0D, (byte)0x45, |
|
362 (byte)0x1D, (byte)0x0F, (byte)0x7C, (byte)0x88, |
|
363 (byte)0xB3, (byte)0x1C, (byte)0x7C, (byte)0x5B, |
|
364 (byte)0x2D, (byte)0x8E, (byte)0xF6, (byte)0xF3, |
|
365 (byte)0xC9, (byte)0x23, (byte)0xC0, (byte)0x43, |
|
366 (byte)0xF0, (byte)0xA5, (byte)0x5B, (byte)0x18, |
|
367 (byte)0x8D, (byte)0x8E, (byte)0xBB, (byte)0x55, |
|
368 (byte)0x8C, (byte)0xB8, (byte)0x5D, (byte)0x38, |
|
369 (byte)0xD3, (byte)0x34, (byte)0xFD, (byte)0x7C, |
|
370 (byte)0x17, (byte)0x57, (byte)0x43, (byte)0xA3, |
|
371 (byte)0x1D, (byte)0x18, (byte)0x6C, (byte)0xDE, |
|
372 (byte)0x33, (byte)0x21, (byte)0x2C, (byte)0xB5, |
|
373 (byte)0x2A, (byte)0xFF, (byte)0x3C, (byte)0xE1, |
|
374 (byte)0xB1, (byte)0x29, (byte)0x40, (byte)0x18, |
|
375 (byte)0x11, (byte)0x8D, (byte)0x7C, (byte)0x84, |
|
376 (byte)0xA7, (byte)0x0A, (byte)0x72, (byte)0xD6, |
|
377 (byte)0x86, (byte)0xC4, (byte)0x03, (byte)0x19, |
|
378 (byte)0xC8, (byte)0x07, (byte)0x29, (byte)0x7A, |
|
379 (byte)0xCA, (byte)0x95, (byte)0x0C, (byte)0xD9, |
|
380 (byte)0x96, (byte)0x9F, (byte)0xAB, (byte)0xD0, |
|
381 (byte)0x0A, (byte)0x50, (byte)0x9B, (byte)0x02, |
|
382 (byte)0x46, (byte)0xD3, (byte)0x08, (byte)0x3D, |
|
383 (byte)0x66, (byte)0xA4, (byte)0x5D, (byte)0x41, |
|
384 (byte)0x9F, (byte)0x9C, (byte)0x7C, (byte)0xBD, |
|
385 (byte)0x89, (byte)0x4B, (byte)0x22, (byte)0x19, |
|
386 (byte)0x26, (byte)0xBA, (byte)0xAB, (byte)0xA2, |
|
387 (byte)0x5E, (byte)0xC3, (byte)0x55, (byte)0xE9, |
|
388 (byte)0x2F, (byte)0x78, (byte)0xC7, (byte)0x02, |
|
389 (byte)0x01, (byte)0x02, (byte)0x02, (byte)0x02, |
|
390 (byte)0x02, (byte)0x00, (byte)0x04, (byte)0x43, |
|
391 (byte)0x02, (byte)0x41, (byte)0x00, (byte)0xE0, |
|
392 (byte)0x31, (byte)0xE7, (byte)0x77, (byte)0xB8, |
|
393 (byte)0xD0, (byte)0x7E, (byte)0x0A, (byte)0x9B, |
|
394 (byte)0x94, (byte)0xD5, (byte)0x3D, (byte)0x33, |
|
395 (byte)0x62, (byte)0x32, (byte)0x51, (byte)0xCE, |
|
396 (byte)0x74, (byte)0x5C, (byte)0xA5, (byte)0x72, |
|
397 (byte)0xD9, (byte)0x36, (byte)0xF3, (byte)0x8A, |
|
398 (byte)0x3F, (byte)0x8B, (byte)0xC6, (byte)0xFE, |
|
399 (byte)0xEF, (byte)0x94, (byte)0x8B, (byte)0x50, |
|
400 (byte)0x41, (byte)0x9B, (byte)0x14, (byte)0xC8, |
|
401 (byte)0xE9, (byte)0x1F, (byte)0x24, (byte)0x1F, |
|
402 (byte)0x65, (byte)0x8E, (byte)0xD3, (byte)0x85, |
|
403 (byte)0xD0, (byte)0x68, (byte)0x6C, (byte)0xF1, |
|
404 (byte)0x79, (byte)0x45, (byte)0xD0, (byte)0x06, |
|
405 (byte)0xA4, (byte)0xB8, (byte)0xE0, (byte)0x64, |
|
406 (byte)0xF5, (byte)0x38, (byte)0x72, (byte)0x97, |
|
407 (byte)0x00, (byte)0x23, (byte)0x5F |
|
408 }; |
|
409 } |
|
410 |