forked from kjur/jsrsasign
-
Notifications
You must be signed in to change notification settings - Fork 0
/
qunit-do-x509-param.html
executable file
·793 lines (757 loc) · 34.6 KB
/
qunit-do-x509-param.html
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
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>QUnit for X509.getParam() test'</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<script type="text/javascript" src="jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="qunit.js"></script>
<link rel="stylesheet" href="qunit.css" type="text/css" media="screen" />
<script src="../ext/cj/cryptojs-312-core-fix.js"></script>
<script src="../ext/cj/x64-core.js"></script>
<script src="../ext/cj/cipher-core_min.js"></script>
<script src="../ext/cj/aes_min.js"></script>
<script src="../ext/cj/tripledes_min.js"></script>
<script src="../ext/cj/enc-base64_min.js"></script>
<script src="../ext/cj/md5_min.js"></script>
<script src="../ext/cj/sha1_min.js"></script>
<script src="../ext/cj/sha256_min.js"></script>
<script src="../ext/cj/sha224_min.js"></script>
<script src="../ext/cj/sha512_min.js"></script>
<script src="../ext/cj/sha384_min.js"></script>
<script src="../ext/cj/ripemd160_min.js"></script>
<script src="../ext/cj/hmac_min.js"></script>
<script src="../ext/cj/pbkdf2_min.js"></script>
<script src="../ext/jsbn.js"></script>
<script src="../ext/jsbn2.js"></script>
<script src="../ext/prng4.js"></script>
<script src="../ext/rng.js"></script>
<script src="../ext/rsa.js"></script>
<script src="../ext/rsa2.js"></script>
<script src="../ext/base64.js"></script>
<script src="../src/base64x-1.1.js"></script>
<script src="../src/crypto-1.1.js"></script>
<script src="../src/asn1hex-1.1.js"></script>
<script src="../src/rsapem-1.1.js"></script>
<script src="../src/rsasign-1.2.js"></script>
<script src="../src/x509-1.1.js"></script>
<script src="../src/asn1-1.0.js"></script>
<script src="../src/asn1x509-1.0.js"></script>
<script type="text/javascript">
$(document).ready(function(){
var certGithubPEM = (function() {/*
-----BEGIN CERTIFICATE-----
MIIF4DCCBMigAwIBAgIQDACTENIG2+M3VTWAEY3chzANBgkqhkiG9w0BAQsFADB1
MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3
d3cuZGlnaWNlcnQuY29tMTQwMgYDVQQDEytEaWdpQ2VydCBTSEEyIEV4dGVuZGVk
IFZhbGlkYXRpb24gU2VydmVyIENBMB4XDTE0MDQwODAwMDAwMFoXDTE2MDQxMjEy
MDAwMFowgfAxHTAbBgNVBA8MFFByaXZhdGUgT3JnYW5pemF0aW9uMRMwEQYLKwYB
BAGCNzwCAQMTAlVTMRkwFwYLKwYBBAGCNzwCAQITCERlbGF3YXJlMRAwDgYDVQQF
Ewc1MTU3NTUwMRcwFQYDVQQJEw41NDggNHRoIFN0cmVldDEOMAwGA1UEERMFOTQx
MDcxCzAJBgNVBAYTAlVTMRMwEQYDVQQ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Y29tMFIGCCsGAQUFBzAChkZodHRw
Oi8vY2FjZXJ0cy5kaWdpY2VydC5jb20vRGlnaUNlcnRTSEEyRXh0ZW5kZWRWYWxp
ZGF0aW9uU2VydmVyQ0EuY3J0MAwGA1UdEwEB/wQCMAAwDQYJKoZIhvcNAQELBQAD
ggEBAG/nbcuC8++QhwnXDxUiLIz+06scipbbXRJd0XjAMbD/RciJ9wiYUhcfTEsg
ZGpt21DXEL5+q/4vgNipSlhBaYFyGQiDm5IQTmIte0ZwQ26jUxMf4pOmI1v3kj43
FHU7uUskQS6lPUgND5nqHkKXxv6V2qtHmssrA9YNQMEK93ga2rWDpK21mUkgLviT
PB5sPdE7IzprOCp+Ynpf3RcFddAkXb6NqJoQRPrStMrv19C1dqUmJRwIQdhkkqev
ff6IQDlhC8BIMKmCNK33cEYDfDWROtW7JNgBvBTwww8jO1gyug8SbGZ6bZ3k8OV8
XX4C2NesiZcLYbc2n7B9O+63M2k=
-----END CERTIFICATE-----
*/}).toString().match(/\/\*([^]*)\*\//)[1];
// _test/0cert_sites/digicertevroot.cer
var digiCertEvRootPEM = (function() {/*
-----BEGIN CERTIFICATE-----
MIIDxTCCAq2gAwIBAgIQAqxcJmoLQJuPC3nyrkYldzANBgkqhkiG9w0BAQUFADBs
MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3
d3cuZGlnaWNlcnQuY29tMSswKQYDVQQDEyJEaWdpQ2VydCBIaWdoIEFzc3VyYW5j
ZSBFViBSb290IENBMB4XDTA2MTExMDAwMDAwMFoXDTMxMTExMDAwMDAwMFowbDEL
MAkGA1UEBhMCVVMxFTATBgNVBAoTDERpZ2lDZXJ0IEluYzEZMBcGA1UECxMQd3d3
LmRpZ2ljZXJ0LmNvbTErMCkGA1UEAxMiRGlnaUNlcnQgSGlnaCBBc3N1cmFuY2Ug
RVYgUm9vdCBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMbM5XPm
+9S75S0tMqbf5YE/yc0lSbZxKsPVlDRnogocsF9ppkCxxLeyj9CYpKlBWTrT3JTW
PNt0OKRKzE0lgvdKpVMSOO7zSW1xkX5jtqumX8OkhPhPYlG++MXs2ziS4wblCJEM
xChBVfvLWokVfnHoNb9Ncgk9vjo4UFt3MRuNs8ckRZqnrG0AFFoEt7oT61EKmEFB
Ik5lYYeBQVCmeVyJ3hlKV9Uu5l0cUyx+mM0aBhakaHPQNAQTXKFx01p8VdteZOE3
hzBWBOURtCmAEvF5OYiiAhF8J2a3iLd48soKqDirCmTCv2ZdlYTBoSUeh10aUAsg
EsxBu24LUTi4S8sCAwEAAaNjMGEwDgYDVR0PAQH/BAQDAgGGMA8GA1UdEwEB/wQF
MAMBAf8wHQYDVR0OBBYEFLE+w2kD+L9HAdSYJhoIAu9jZCvDMB8GA1UdIwQYMBaA
FLE+w2kD+L9HAdSYJhoIAu9jZCvDMA0GCSqGSIb3DQEBBQUAA4IBAQAcGgaX3Nec
nzyIZgYIVyHbIUf4KmeqvxgydkAQV8GK83rZEWWONfqe/EW1ntlMMUu4kehDLI6z
eM7b41N5cdblIZQB2lWHmiRk9opmzN6cN82oNLFpmyPInngiK3BD41VHMWEZ71jF
hS9OMPagMRYjyOfiZRYzy78aG6A9+MpeizGLYAiJLQwGXFK3xPkKmNEVX58Svnw2
Yzi9RKR/5CYrCsSXaQ3pjOLAEFe4yHYSkVXySGnYvCoCWw9E1CAx2/S6cCZdkGCe
vEsXCS+0yx5DaMkHJ8HSXPfqIbloEpw8nL+e/IBcm2PN7EeqJSdnoDfzAIJ9VNep
+OkuE6N36B9K
-----END CERTIFICATE-----
*/}).toString().match(/\/\*([^]*)\*\//)[1];
// _test/0cert_sites/digicertevroot.cer
var pulseCioGovPEM = (function() {/*
-----BEGIN CERTIFICATE-----
MIIFJDCCBAygAwIBAgISA+A6XXjiqOEp6wsxRPSMihs9MA0GCSqGSIb3DQEBCwUA
MEoxCzAJBgNVBAYTAlVTMRYwFAYD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0dHA6Ly9jcHMubGV0c2VuY3J5
cHQub3JnMIGrBggrBgEFBQcCAjCBngyBm1RoaXMgQ2VydGlmaWNhdGUgbWF5IG9u
bHkgYmUgcmVsaWVkIHVwb24gYnkgUmVseWluZyBQYXJ0aWVzIGFuZCBvbmx5IGlu
IGFjY29yZGFuY2Ugd2l0aCB0aGUgQ2VydGlmaWNhdGUgUG9saWN5IGZvdW5kIGF0
IGh0dHBzOi8vbGV0c2VuY3J5cHQub3JnL3JlcG9zaXRvcnkvMA0GCSqGSIb3DQEB
CwUAA4IBAQALdvLGTpz2/YXmGKfbKOF01bp1YWCLDa8Wha9VPnSFfNhMr4BDE1WU
25C4qWoK/aulDPKmic9wE5GB9wWtFgkNnYRKL1IRYIiTj4RNcObAKQ8UKn6nWY5J
QS6c083NC8kLp9bY+EUWJGImbXoSYo9kxdsmF7hMUXJwy2eGVDy8JRPl+s8hWGoO
WacFqZW/keeSiHxuja2t/r8SADVs41HnGIGrhLpAqgetunCOVOBf3/ukXi7I/99G
skSN1/Bs6kbCE//oDJHBGhHLrU8NCFHD3geyZ2M7fvl8NySvNmK401kdW8d0YlZ+
huwF7BwiYT9T3KZrcukwsj5BUinH75i4
-----END CERTIFICATE-----
*/}).toString().match(/\/\*([^]*)\*\//)[1];
// _test/0cert_sites/ip1.1.1.1.cer
var cfip1111PEM = (function() {/*
-----BEGIN CERTIFICATE-----
MIID9DCCA3qgAwIBAgIQBWzetBRl/ycHFsBukRYuGTAKBggqhkjOPQQDAjBMMQsw
CQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMSYwJAYDVQQDEx1EaWdp
Q2VydCBFQ0MgU2VjdXJlIFNlcnZlciBDQTAeFw0xODAzMzAwMDAwMDBaFw0yMDAz
MjUxMjAwMDBaMGwxCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJDQTEWMBQGA1UEBxMN
U2FuIEZyYW5jaXNjbzEZMBcGA1UEChMQQ2xvdWRmbGFyZSwgSW5jLjEd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-----END CERTIFICATE-----
*/}).toString().match(/\/\*([^]*)\*\//)[1];
// _test/0cert_sites/danmarksapotuser1.cer
var danmarksUser1PEM = (function() {/*
-----BEGIN CERTIFICATE-----
MIIGYDCCBUigAwIBAgIEU7s4dDANBgkqhkiG9w0BAQsFADBAMQswCQYDVQQGEwJE
SzESMBAGA1UECgwJVFJVU1QyNDA4MR0wGwYDVQQDDBRUUlVTVDI0MDggT0NFUyBD
QSBJSTAeFw0xNTEyMzAxMjE4MDNaFw0xODEyMzAxMjE2NTBaMIGeMQswCQYDVQQG
EwJESzEyMDAGA1UECgwpRGFubWFya3MgQXBvdGVrZXJmb3JlbmluZyAvLyBDVlI6
MjAxMjQ1MTIxWzAgBgNVBAUTGUNWUjoyMDEyNDUxMi1VSUQ6NjQyOTA2OTgwNwYD
VQQDDDBEYW5tYXJrcyBBcG90ZWtlcmZvcmVuaW5nIC0gRGFubWFya3MgQXBvdGVr
ZXJmb3IwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDQNL1iA9kO241w
eNpuTm/OoU5i9kOpp+/Vi6OmY14aYEIpgDEWr6nfeGugrsFyR2crOxr7iRhngUyk
UnSsfSqPkhhGiXdcPtEplSubCzP08zf/0PyIyyV5LoBEZr60M7LmahPuQojb09sK
dCTEDMk46LCeISEQGI/ZggALH1SRSQiodctQvVN98okuaJDobgbTi/P2sMu3OK/J
SbQrI2kn5d4ShUlWIBkZqsRUBNRmrvfBQzZpv2+mkDMFGouYzSkYccPivzQCx8BV
9e2QdrB6KVnT6m/l5ND0d3qY41h0i/CffnjofQmoaQ1a3xO82+A6EF+Dl3QF5Wcm
fR2Z2C6rAgMBAAGjggMBMIIC/TAOBgNVHQ8BAf8EBAMCA7gwgYkGCCsGAQUFBwEB
BH0wezA1BggrBgEFBQcwAYYpaHR0cDovL29jc3AuaWNhMDIudHJ1c3QyNDA4LmNv
bS9yZXNwb25kZXIwQgYIKwYBBQUHMAKGNmh0dHA6Ly92LmFpYS5pY2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]*)\*\//)[1];
// _test/0cert_sites/globalsignr6root.cer keyUsage=keyCertSign,cRLSign
var certGlobalSignRootR6PEM = (function() {/*
-----BEGIN CERTIFICATE-----
MIIDXzCCAkegAwIBAgILBAAAAAABIVhTCKIwDQYJKoZIhvcNAQELBQAwTDEgMB4G
A1UECxMXR2xvYmFsU2lnbiBSb290IENBIC0gUjMxEzARBgNVBAoTCkdsb2JhbFNp
Z24xEzARBgNVBAMTCkdsb2JhbFNpZ24wHhcNMDkwMzE4MTAwMDAwWhcNMjkwMzE4
MTAwMDAwWjBMMSAwHgYDVQQLExdHbG9iYWxTaWduIFJvb3QgQ0EgLSBSMzETMBEG
A1UEChMKR2xvYmFsU2lnbjETMBEGA1UEAxMKR2xvYmFsU2lnbjCCASIwDQYJKoZI
hvcNAQEBBQADggEPADCCAQoCggEBAMwldpB5BngiFvXAg7aEyiie/QV2EcWtiHL8
RgJDx7KKnQRfJMsuS+FggkbhUqsMgUdwbN1k0ev1LKMPgj0MK66X17YUhhB5uzsT
gHeMCOFJ0mpiLx9e+pZo34knlTifBtc+ycsmWQ1z3rDI6SYOgxXG71uL0gRgykmm
KPZpO/bLyCiR5Z2KYVc3rHQU3HTgOu5yLy6c+9C7v/U9AOEGM+iCK65TpjoWc4zd
QQ4gOsC0p6Hpsk+QLjJg6VfLuQSSaGjlOCZgdbKfd/+RFO+uIEn8rUAVSNECMWEZ
XriX7613t2Saer9fwRPvm2L7DWzgVGkWqQPabumDk3F2xmmFghcCAwEAAaNCMEAw
DgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFI/wS3+o
LkUkrk1Q+mOai97i3Ru8MA0GCSqGSIb3DQEBCwUAA4IBAQBLQNvAUKr+yAzv95ZU
RUm7lgAJQayzE4aGKAczymvmdLm6AC2upArT9fHxD4q/c2dKg8dEe3jgr25sbwMp
jjM5RcOO5LlXbKr8EpbsU8Yt5CRsuZRj+9xTaGdWPoO4zzUhw8lo/s7awlOqzJCK
6fBdRoyV3XpYKBovHd7NADdBj+1EbddTKJd+82cEHhXXipa0095MJ6RMG3NzdvQX
mcIfeg7jLQitChws/zyrVQ4PkX4268NXSb7hLi18YIvDQVETI53O9zJrlAGomecs
Mx86OyXShkDOOyyGeMlhLxS67ttVb9+E7gUJTb0o2HLO02JQZR7rkpeDMdmztcpH
WD9f
-----END CERTIFICATE-----
*/}).toString().match(/\/\*([^]*)\*\//)[1];
// NIST PKITS nameConstraints Test01 ICA pkitsnc/nc01.pem
var certPKITSNC01PEM = (function() {/*
-----BEGIN CERTIFICATE-----
MIID7TCCAtWgAwIBAgIBPjANBgkqhkiG9w0BAQsFADBFMQswCQYDVQQGEwJVUzEf
MB0GA1UEChMWVGVzdCBDZXJ0aWZpY2F0ZXMgMjAxMTEVMBMGA1UEAxMMVHJ1c3Qg
QW5jaG9yMB4XDTEwMDEwMTA4MzAwMFoXDTMwMTIzMTA4MzAwMFowTzELMAkGA1UE
BhMCVVMxHzAdBgNVBAoTFlRlc3QgQ2VydGlmaWNhdGVzIDIwMTExHzAdBgNVBAMT
Fm5hbWVDb25zdHJhaW50cyBETjEgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAw
ggEKAoIBAQDIFZChS4W10eHwp3smMrXyTluiMJTrq0f8LEx4D63qlvrjNngGxCHt
BOlFbIH3uKwK24yKHywpFK38bHLyDf+2LoaEYox32sfyeqneYurTGJ4sZ1T/fsZk
lG/n5fkMlvIU0iu4eOkshyEEtvUGpvdSEg4a7TiadjmsAZkJkgBHV0h9VYaRYvgY
BnDsTd8MrzKo0bNnpMgiUGtGJB9lB0DmhO51IelaxiyaJUVIsKUZfpA1NPjSboLi
NLgKhP8El/AlBY3BG190xJ3a5xDIhDq5SRTJ16554PIIwzfE7nvY+9TpwfkYvVKL
zCOTyrA6VnFwTLKc8sLYKFfmKNEboLafAgMBAAGjgd0wgdowHwYDVR0jBBgwFoAU
5H1f0VyVhggsBa6+dbZlp9ldqGYwHQYDVR0OBB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IR74yfMz/Y4hw\n" +
"dXSW4r42bESo/DAfBgNVHSMEGDAWgBTIR74yfMz/Y4hwdXSW4r42bESo/DAMBgNV\n" +
"HRMEBTADAQH/MAoGCCqGSM49BAMCA0kAMEYCIQDfAcS/WKBrP6JBgksQVpp4jdq4\n" +
"C53Yu4F5NkaMgthAHgIhANGRdWAP1QdW9l6tiglQwdqJs4T0e8+NYv+RcAb3VYwn\n" +
"-----END CERTIFICATE-----\n";
var k1CertHex = pemtohex(k1CertPEM);
// test/z1.der1-p3 basicConstraints={ca:true, pathlen:3}
var z1P3CertHex = "3082017630820120a003020102020107300d06092a864886f70d01010b05003019310b3009060355040613025553310a3008060355040a0c0154301e170d3136303431333134313832365a170d3236303431333134313832365a3019310b3009060355040613025553310a3008060355040a0c0154305c300d06092a864886f70d0101010500034b003048024100e8664dd2b40529121568f3b39bc97a62e7ba3c09babdc4f0dcd8df90eb790b9bb645a2b70e3112747b4d3c41b51424895115fef88f79d43eae5b1a4e3518fd590203010001a3533051301d0603551d0e04160414c5473ee200c8e7ad7003dff5420b8cddf4c20e15301f0603551d23041830168014c5473ee200c8e7ad7003dff5420b8cddf4c20e15300f0603551d13040830060101ff020103300d06092a864886f70d01010b0500034100862bf6d5f0c366dd1c71af10df93e2e9e0b7210b6912d1774e27107203f2dc257f9b132285bc1ce8d32d8ffc69470cd6c52ec76b7d68708eca3bbd49556f3005";
// _data/0csrext/certbot1.csr.pem
var csrcertbot1 = (function() {/*
-----BEGIN CERTIFICATE REQUEST-----
MIICeDCCAWACAQIwADCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMf6
wBbRavWLUCZfLNF+C4uNO/T6N2YCxWgM/XI04hPLqQodfTudcIwsbWGGkRpJSwGG
pDXQs3A1fH5xrfev7PlWaDYCkhC4jrrZ/1L8HGR/nUxrS3jFTbzZTGA84TbkW8FH
fyugWWqnjrnoxOJW0XdiWe1Drsr5vaqVS0N4qEISH/ciLnaVeV//tLJc/V5g3sFu
4AQZQykvkltGD7w8vBhM4a/KQGeV3hG+ctCAwV5+RhQxForDgUv3ZPt76yVt142x
TJGsq8fsdEqBjg7xVQn+458Z3yMMQVMLCf/aEHFLYurc6PD2kEzJf+mRYXY3sNwy
4l38Qf8velG6Ij+8eVkCAwEAAaAzMDEGCSqGSIb3DQEJDjEkMCIwIAYDVR0RBBkw
F4IVbm9kZWpzLnJ6LWJzZC5teS5jb3JwMA0GCSqGSIb3DQEBCwUAA4IBAQB0isgR
I57C2GCszZdLdouAjpIZXa8W1C3FjOHcd6RQ77Fd+h22fn63gEMBUQk3AFzq4t2b
8JeOH1xjZ4gjTEXH4whOh95gR+LDvVmK3khIHBLMVCyJgUEUNTZJoaMu7adhpbJX
taiHpny63sQvh3QtEh7arMx8EaDh8MKYBQ5iTylvN0SS/yQcUvaS4kFs5CJTE/YG
FepaWdBWPlE4C5oJ956lnuZSRHlugKHUzWD/V/tSYLDJmQVJ7sPNJM1JaTd79cDq
cbtqMCqhg0GKH4OmbrS+Zu99iox+I7Mbsu9+F4rZjinez1looQ5hfJ+6FAtxE1HI
2/x4YDGRZtDqwcFe
-----END CERTIFICATE REQUEST-----
*/}).toString().match(/\/\*([^]*)\*\//)[1];
// ======================================================================
test("X509.getExtParam test", function() {
var x = new X509();
deepEqual(
x.getExtParam("300e0603551d0f0101ff0404030204b0"),
{ extname: "keyUsage",
critical: true,
names: ["digitalSignature","keyEncipherment","dataEncipherment"]
},
"keyUsage");
deepEqual(
x.getExtParam("30290603551d250422302006082b0601050507030206082b06010505070304060a2b0601040182370a0304"),
{ extname: "extKeyUsage",
array: ["clientAuth", "emailProtection", "1.3.6.1.4.1.311.10.3.4"]
},
"extKeyUsage");
deepEqual(
x.getExtParam("300f06092b060105050730010504020500"),
{ extname: "ocspNoCheck" },
"ocspNoCheck");
});
test("X509.getExtParamArray test", function() {
var x = new X509();
deepEqual(
x.getExtParamArray("302d300a0603551d140403020124301f0603551d230418301680148ff04b7fa82e4524ae4d50fa639a8bdee2dd1bbc"),
[{ extname: "cRLNumber",
num: {hex: "24"}
},{
extname: "authorityKeyIdentifier",
kid: {hex: "8ff04b7fa82e4524ae4d50fa639a8bdee2dd1bbc"}
}],
"param array");
});
test("getParam test github.com", function() {
var j2 =
{version:3,
serial:{hex:"0c009310d206dbe337553580118ddc87"},
sigalg:"SHA256withRSA",
issuer: {
array: [[{ds:'prn',type:'C',value:'US'}],
[{ds:'prn',type:'O',value:'DigiCert Inc'}],
[{ds:'prn',type:'OU',value:'www.digicert.com'}],
[{ds:'prn',type:'CN',value:'DigiCert SHA2 Extended Validation Server CA'}]],
str: "/C=US/O=DigiCert Inc/OU=www.digicert.com/CN=DigiCert SHA2 Extended Validation Server CA"
},
notbefore:"140408000000Z",
notafter:"160412120000Z",
subject: {
array: [[{ds:'utf8',type:'businessCategory',value:'Private Organization'}],
[{ds:'prn',type:'jurisdictionOfIncorporationC',value:'US'}],
[{ds:'prn',type:'jurisdictionOfIncorporationSP',value:'Delaware'}],
[{ds:'prn',type:'serialNumber',value:'5157550'}],
[{ds:'prn',type:'STREET',value:'548 4th Street'}],
[{ds:'prn',type:'postalCode',value:'94107'}],
[{ds:'prn',type:'C',value:'US'}],
[{ds:'prn',type:'ST',value:'California'}],
[{ds:'prn',type:'L',value:'San Francisco'}],
[{ds:'prn',type:'O',value:'GitHub, Inc.'}],
[{ds:'prn',type:'CN',value:'github.com'}]
],
str: "/businessCategory=Private Organization/jurisdictionOfIncorporationC=US/jurisdictionOfIncorporationSP=Delaware/serialNumber=5157550/STREET=548 4th Street/postalCode=94107/C=US/ST=California/L=San Francisco/O=GitHub, Inc./CN=github.com"
},
sbjpubkey:"-----BEGIN PUBLIC KEY-----\r\n"+
"MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAsdTcPK/9807twWet5ssi\r\n"+
"6Lfiqyjy99xicAjRDK/WFmohsDZLFw02YwSuv+ogUZVlZvK/uU2kDCnr9RWx6DWz\r\n"+
"cBCU1RtZtCYP1oNXWZ3hfAnd4BPKTW9Dm83PhzoVp4XdZoPtkwz+K204HHmIkM+t\r\n"+
"WBgtUdHCo/JHjG84Cbm470yTC8uDlIfq4KO12Xubaw9D+crugA0op3bxJfTBNTz2\r\n"+
"dK3eajOCe9z9S3anwu7yar+pJKZf5y58DtvDdHP6fsbYz2DrNlYhtsGKuCSCTXgk\r\n"+
"uukdoYqnh75mJWm/vjtybk/g5IUlCLGRibjWdGV2myxPYh+h+jq+nCS/n8qwxcBn\r\n"+
"jQIDAQAB\r\n"+
"-----END PUBLIC KEY-----\r\n",
ext:[{
extname:"authorityKeyIdentifier",
kid:{hex:"3dd350a5d6a0adeef34a600a65d321d4f8f8d60f"}
},{
extname:"subjectKeyIdentifier",
kid:{hex:"6a43907d3b98147252953aaa280a43f8517ed3a6"}
},{
extname:"subjectAltName",
array:[{dns:"github.com"},{dns:"www.github.com"}]
},{
extname:"keyUsage",
critical:true,
names:["digitalSignature","keyEncipherment"]
},{
extname:"extKeyUsage",
array:["serverAuth","clientAuth"]
},{
extname:"cRLDistributionPoints",
array:[{dpname:{full:[{uri:"http://crl3.digicert.com/sha2-ev-server-g1.crl"}]}},
{dpname:{full:[{uri:"http://crl4.digicert.com/sha2-ev-server-g1.crl"}]}}]
},{
extname:"certificatePolicies",
array:[{policyoid:"2.16.840.1.114412.2.1",
array:[{cps:"https://www.digicert.com/CPS"}]}]
},{
extname:"authorityInfoAccess",
array:[{ocsp:"http://ocsp.digicert.com"},
{caissuer:"http://cacerts.digicert.com/DigiCertSHA2ExtendedValidationServerCA.crt"}]
},{
extname:"basicConstraints",
critical:true
}],
sighex:"6fe76dcb82f3ef908709d70f15222c8cfed3ab1c8a96db5d125dd178c031b0ff45c889f7089852171f4c4b20646a6ddb50d710be7eabfe2f80d8a94a58416981721908839b92104e622d7b4670436ea353131fe293a6235bf7923e3714753bb94b24412ea53d480d0f99ea1e4297c6fe95daab479acb2b03d60d40c10af7781adab583a4adb59949202ef8933c1e6c3dd13b233a6b382a7e627a5fdd170575d0245dbe8da89a1044fad2b4caefd7d0b576a526251c0841d86492a7af7dfe884039610bc04830a98234adf77046037c35913ad5bb24d801bc14f0c30f233b5832ba0f126c667a6d9de4f0e57c5d7e02d8d7ac89970b61b7369fb07d3beeb73369"
};
var x = new X509();
x.readCertPEM(certGithubPEM);
var j = x.getParam();
deepEqual(j, j2, "github pem");
//equal(utf8tohex(JSON.stringify(j,null," ")), utf8tohex(JSON.stringify(j2,null," ")), "str");
});
test("getParam test pulse.cio.gov", function() {
var j2 =
{version:3,
serial:{hex:"03e03a5d78e2a8e129eb0b3144f48c8a1b3d"},
sigalg:"SHA256withRSA",
issuer: {
array:[[{type:'C',value:'US',ds:'prn'}],
[{type:'O',value:"Let's Encrypt",ds:'prn'}],
[{type:'CN',value:"Let's Encrypt Authority X3",ds:'prn'}]],
str:"/C=US/O=Let's Encrypt/CN=Let's Encrypt Authority X3"
},
notbefore:"160403023700Z",
notafter:"160702023700Z",
subject: {
array:[[{type:'CN',value:'pulse.cio.gov',ds:'prn'}]],
str:"/CN=pulse.cio.gov"
},
sbjpubkey:"-----BEGIN PUBLIC KEY-----\r\n"+
"MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAyr4tcC8KGAyGtqQvv95v\r\n"+
"wXRJt4ruq+16R+PjbRI2L3Wbq8vxN3ZnQrVP7ASG/2WxPDAhbvQwjljTs5AfLZHu\r\n"+
"s+uWtsWKg3QzZnVlchYpmX8tzNpbBW9cm8ONV0OcXr5kU36cJ5NpkShMs4bi8cst\r\n"+
"Ceht3SuzQB8gwFHoaJHmBASiTbWq4TQ2b8UeJcCatq1BVpVaxLgJaryNLNkqgjdW\r\n"+
"BGyVBprmJ45EqSx23ZpFzW/eN23yhVHfBG10N7AJ2dUTK/fWyUMRyXibARe2UUjH\r\n"+
"JuRhQtB7QD88gjClU0C6tF+f6YFBX2V3KvTVpRwhw6XTP0XomGYH8lFVB7UMcwR+\r\n"+
"jQIDAQAB\r\n"+
"-----END PUBLIC KEY-----\r\n",
ext:[{
extname:"keyUsage",
critical:true,
names:["digitalSignature","keyEncipherment"]
},{
extname:"extKeyUsage",
array:["serverAuth","clientAuth"]
},{
extname:"basicConstraints",
critical:true
},{
extname:"subjectKeyIdentifier",
kid:{hex:"f2eba920f40ce881494b5040e8db05286074a806"}
},{
extname:"authorityKeyIdentifier",
kid:{hex:"a84a6a63047dddbae6d139b7a64565eff3a8eca1"}
},{
extname:"authorityInfoAccess",
array:[{ocsp:"http://ocsp.int-x3.letsencrypt.org/"},
{caissuer:"http://cert.int-x3.letsencrypt.org/"}]
},{
extname:"subjectAltName",
array:[
{dns:"https.cio.gov"},
{dns:"pulse.cio.gov"},
{dns:"staging.pulse.cio.gov"}]
},{
extname:"certificatePolicies",
array:[{
policyoid:"2.23.140.1.2.1"
},{
policyoid:"1.3.6.1.4.1.44947.1.1.1",
array:[{
cps:"http://cps.letsencrypt.org"
},{
unotice:{
exptext:{
type:"utf8",
str:"This Certificate may only be relied upon by Relying Parties and only in accordance with the Certificate Policy found at https://letsencrypt.org/repository/"
}
}
}]
}]
}],
sighex:"0b76f2c64e9cf6fd85e618a7db28e174d5ba7561608b0daf1685af553e74857cd84caf8043135594db90b8a96a0afdaba50cf2a689cf70139181f705ad16090d9d844a2f52116088938f844d70e6c0290f142a7ea7598e49412e9cd3cdcd0bc90ba7d6d8f845162462266d7a12628f64c5db2617b84c517270cb6786543cbc2513e5facf21586a0e59a705a995bf91e792887c6e8dadadfebf1200356ce351e71881ab84ba40aa07adba708e54e05fdffba45e2ec8ffdf46b2448dd7f06cea46c213ffe80c91c11a11cbad4f0d0851c3de07b267633b7ef97c3724af3662b8d3591d5bc77462567e86ec05ec1c22613f53dca66b72e930b23e415229c7ef98b8"
};
var x = new X509();
x.readCertPEM(pulseCioGovPEM);
var j = x.getParam();
deepEqual(j, j2, "pulse.cio.gov");
});
test("getParam digicert ev root test", function() {
var j2 =
{version:3,
serial:{hex:"02ac5c266a0b409b8f0b79f2ae462577"},
sigalg:"SHA1withRSA",
issuer: {
array: [[{ds:'prn',type:'C',value:'US'}],
[{ds:'prn',type:'O',value:'DigiCert Inc'}],
[{ds:'prn',type:'OU',value:'www.digicert.com'}],
[{ds:'prn',type:'CN',value:'DigiCert High Assurance EV Root CA'}]],
str: "/C=US/O=DigiCert Inc/OU=www.digicert.com/CN=DigiCert High Assurance EV Root CA"
},
notbefore:"061110000000Z",
notafter:"311110000000Z",
subject: {
array: [[{ds:'prn',type:'C',value:'US'}],
[{ds:'prn',type:'O',value:'DigiCert Inc'}],
[{ds:'prn',type:'OU',value:'www.digicert.com'}],
[{ds:'prn',type:'CN',value:'DigiCert High Assurance EV Root CA'}]],
str: "/C=US/O=DigiCert Inc/OU=www.digicert.com/CN=DigiCert High Assurance EV Root CA"
},
sbjpubkey:"-----BEGIN PUBLIC KEY-----\r\n"+
"MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAxszlc+b71LvlLS0ypt/l\r\n"+
"gT/JzSVJtnEqw9WUNGeiChywX2mmQLHEt7KP0JikqUFZOtPclNY823Q4pErMTSWC\r\n"+
"90qlUxI47vNJbXGRfmO2q6Zfw6SE+E9iUb74xezbOJLjBuUIkQzEKEFV+8taiRV+\r\n"+
"ceg1v01yCT2+OjhQW3cxG42zxyRFmqesbQAUWgS3uhPrUQqYQUEiTmVhh4FBUKZ5\r\n"+
"XIneGUpX1S7mXRxTLH6YzRoGFqRoc9A0BBNcoXHTWnxV215k4TeHMFYE5RG0KYAS\r\n"+
"8Xk5iKICEXwnZreIt3jyygqoOKsKZMK/Zl2VhMGhJR6HXRpQCyASzEG7bgtROLhL\r\n"+
"ywIDAQAB\r\n"+
"-----END PUBLIC KEY-----\r\n",
ext:[{
extname:"keyUsage",
critical:true,
names:["digitalSignature","keyCertSign","cRLSign"]
},{
extname:"basicConstraints",
critical:true,
cA:true
},{
extname:"subjectKeyIdentifier",
kid:{hex:"b13ec36903f8bf4701d498261a0802ef63642bc3"}
},{
extname:"authorityKeyIdentifier",
kid:{hex:"b13ec36903f8bf4701d498261a0802ef63642bc3"}
}],
sighex:"1c1a0697dcd79c9f3c886606085721db2147f82a67aabf183276401057c18af37ad911658e35fa9efc45b59ed94c314bb891e8432c8eb378cedbe3537971d6e5219401da55879a2464f68a66ccde9c37cda834b1699b23c89e78222b7043e35547316119ef58c5852f4e30f6a0311623c8e7e2651633cbbf1a1ba03df8ca5e8b318b6008892d0c065c52b7c4f90a98d1155f9f12be7c366338bd44a47fe4262b0ac497690de98ce2c01057b8c876129155f24869d8bc2a025b0f44d42031dbf4ba70265d90609ebc4b17092fb4cb1e4368c90727c1d25cf7ea21b968129c3c9cbf9efc805c9b63cdec47aa252767a037f300827d54d7a9f8e92e13a377e81f4a"
};
var x = new X509();
x.readCertPEM(digiCertEvRootPEM);
var j = x.getParam();
deepEqual(j, j2, "digicert ha ev root");
});
test("getParam digicert ev root test", function() {
var pIn = new X509(certPKITSNC01PEM).getParam();
var pExpected =
{
version: 3,
serial: {hex: "3e"},
sigalg: "SHA256withRSA",
issuer: {
array: [
[{type: "C", value: "US", ds: "prn"}],
[{type: "O", value: "Test Certificates 2011", ds: "prn"}],
[{type: "CN", value: "Trust Anchor", ds: "prn"}]],
str: "/C=US/O=Test Certificates 2011/CN=Trust Anchor"},
notbefore: "100101083000Z",
notafter: "301231083000Z",
subject: {
array: [
[{type: "C", value: "US", ds: "prn"}],
[{type: "O", value: "Test Certificates 2011", ds: "prn"}],
[{type: "CN", value: "nameConstraints DN1 CA", ds: "prn"}]],
str: "/C=US/O=Test Certificates 2011/CN=nameConstraints DN1 CA"},
sbjpubkey: "-----BEGIN PUBLIC KEY-----\r\n" +
"MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAyBWQoUuFtdHh8Kd7JjK1\r\n" +
"8k5bojCU66tH/CxMeA+t6pb64zZ4BsQh7QTpRWyB97isCtuMih8sKRSt/Gxy8g3/\r\n" +
"ti6GhGKMd9rH8nqp3mLq0xieLGdU/37GZJRv5+X5DJbyFNIruHjpLIchBLb1Bqb3\r\n" +
"UhIOGu04mnY5rAGZCZIAR1dIfVWGkWL4GAZw7E3fDK8yqNGzZ6TIIlBrRiQfZQdA\r\n" +
"5oTudSHpWsYsmiVFSLClGX6QNTT40m6C4jS4CoT/BJfwJQWNwRtfdMSd2ucQyIQ6\r\n" +
"uUkUydeueeDyCMM3xO572PvU6cH5GL1Si8wjk8qwOlZxcEyynPLC2ChX5ijRG6C2\r\n" +
"nwIDAQAB\r\n" +
"-----END PUBLIC KEY-----\r\n",
ext: [
{ extname: "authorityKeyIdentifier",
kid: {hex: "e47d5fd15c9586082c05aebe75b665a7d95da866"}},
{ extname: "subjectKeyIdentifier",
kid: {hex: "41784246cd4ea882e7e139dff7a916c00afcef86"}},
{ extname: "keyUsage",
critical: true,
names: ["keyCertSign", "cRLSign"]},
{ extname: "certificatePolicies",
array: [{"policyoid": "2.16.840.1.101.3.2.1.48.1"}]},
{ extname: "basicConstraints",
cA: true,
critical: true },
{ extname: "nameConstraints",
critical: true,
permit: [
{dn: {array: [
[{type: "C", value: "US", ds: "prn"}],
[{type: "O", value: "Test Certificates 2011", ds: "prn"}],
[{type: "OU", value: "permittedSubtree1", ds: "prn"}]],
str: "/C=US/O=Test Certificates 2011/OU=permittedSubtree1"}}]}
],
sighex: "69114c2bbd01edaedba8c86e717ecadc09c284fd43f13fc2150527396782ff22807076e99507f7b96ccbe7664922828b25a4fb7670ae2f1c7d4adfe6e5a08830a66e21d6bef392365a2b15e1bac9256c999602dab80d162d9b84b30a81d2f882646d2f82d5939bdb8de8ef0baae6b77e733fd1642d72630c36cdcd58df854d7e921c8bb967f0ee5195921741fbea38e1792246db05e7d13264f11449ee69f97670c4a03154a5e3ced2a68e8e5d4a1a8bf6f33cf640622becdabe4b46771a4d59d8edc396060c798b6a92230f299e18b0f0d920006e692608d68d19a059e92e08965566c12433b7c39c7a7884bf0ae792f2129f5f487bf9d21c8108400657a8db",
};
deepEqual(pIn, pExpected, "NIST PKITS nameConstraints Test01 ICA");
});
test("findParam test", function() {
var x = new X509();
var aExt = [{
extname:"keyUsage",
critical:true,
names:["digitalSignature","keyCertSign","cRLSign"]
},{
extname:"basicConstraints",
critical:true,
cA:true
},{
extname:"subjectKeyIdentifier",
kid:{hex:"b13ec36903f8bf4701d498261a0802ef63642bc3"}
}];
var aExtExpect = [{
extname:"keyUsage",
names:["keyCertSign","cRLSign"]
},{
extname:"basicConstraints"
},{
extname:"subjectKeyIdentifier",
kid:{hex:"1234"}
}];
var pKU = x.findExt(aExt, "keyUsage");
delete pKU["critical"];
pKU.names = ["keyCertSign","cRLSign"];
var pBC = x.findExt(aExt, "basicConstraints");
delete pBC["critical"];
delete pBC["cA"];
var pSKID = x.findExt(aExt, "subjectKeyIdentifier");
pSKID.kid = {hex: "1234"};
deepEqual(aExt, aExtExpect, "findExt");
});
// **** updateExtCDPFullURI
test("updateExtCDPFullURI test", function() {
var aParam = [{
"extname": "subjectAltName",
"array": [{"rfc822": "[email protected]"}]
},{
"extname": "cRLDistributionPoints",
"array": [{
"dpname": {"full": [{"uri": "http://example.com/a.crl"}]}
}]
},{
"extname": "basicConstraints"
}];
var aExpect = [{
"extname": "subjectAltName",
"array": [{"rfc822": "[email protected]"}]
},{
"extname": "cRLDistributionPoints",
"array": [{
"dpname": {"full": [{"uri": "http://foo.com/b.crl"}]}
}]
},{
"extname": "basicConstraints"
}];
var x = new X509();
x.updateExtCDPFullURI(aParam,"http://foo.com/b.crl");
deepEqual(aParam, aExpect);
});
// **** updateExtAIAOCSP;
test("updateExtAIAOCSP test", function() {
var aParam = [{
"extname": "subjectAltName",
"array": [{"rfc822": "[email protected]"}]
},{
"extname": "authorityInfoAccess",
"array": [
{"caissuer": "http://example.com/a.crt"},
{"ocsp": "http://ocsp.example.com"}
]
},{
"extname": "basicConstraints"
}];
var aExpect = [{
"extname": "subjectAltName",
"array": [{"rfc822": "[email protected]"}]
},{
"extname": "authorityInfoAccess",
"array": [
{"caissuer": "http://example.com/a.crt"},
{"ocsp": "http://ocsp.foo.net"}
]
},{
"extname": "basicConstraints"
}];
var x = new X509();
x.updateExtAIAOCSP(aParam,"http://ocsp.foo.net");
deepEqual(aParam, aExpect);
});
// **** updateExtAIACAIssuer;
test("updateExtAIACAIssuer test", function() {
var aParam = [{
"extname": "subjectAltName",
"array": [{"rfc822": "[email protected]"}]
},{
"extname": "authorityInfoAccess",
"array": [
{"caissuer": "http://example.com/a.crt"},
{"ocsp": "http://ocsp.example.com"}
]
},{
"extname": "basicConstraints"
}];
var aExpect = [{
"extname": "subjectAltName",
"array": [{"rfc822": "[email protected]"}]
},{
"extname": "authorityInfoAccess",
"array": [
{"caissuer": "http://example.foo.net/b.crt"},
{"ocsp": "http://ocsp.example.com"}
]
},{
"extname": "basicConstraints"
}];
var x = new X509();
x.updateExtAIACAIssuer(aParam,"http://example.foo.net/b.crt");
deepEqual(aParam, aExpect);
});
});
</script>
</head>
<body>
<div id="qunit"></div>
<div id="qunit-fixture">test markup</div>
<p>
<a href="../">TOP</a> |
<a href="index.html">TEST INDEX</a> |
<a href="qunit-do-x509.html">x509</a> |
<a href="qunit-do-x509-ext.html">x509-ext</a> |
<a href="qunit-do-x509-param.html">x509-param</a> |
<a href="qunit-do-x509-key.html">x509-key</a> |
<a href="qunit-do-x509-kid.html">x509-kid</a> |
<a href="qunit-do-x509-getinfo.html">x509-getinfo</a> |
<a href="qunit-do-asn1x509.html">asn1x509</a> |
</p>
</body>
<center><p>© 2015-2020 Kenji Urushima</p></center>
</html>