forked from kjur/jsrsasign
-
Notifications
You must be signed in to change notification settings - Fork 0
/
qunit-do-keyutil-des.html
executable file
·98 lines (84 loc) · 4.3 KB
/
qunit-do-keyutil-des.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
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>QUnit for KEYUTIL DES-CBC PKCS5 private key 'keyutil.js'</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="http://code.jquery.com/qunit/qunit-1.11.0.js"></script>
<link rel="stylesheet" href="http://code.jquery.com/qunit/qunit-1.11.0.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/yahoo.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/base64.js"></script>
<script src="../ext/rsa.js"></script>
<script src="../ext/rsa2.js"></script>
<script src="../src/base64x-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/asn1-1.0.js"></script>
<script src="../src/crypto-1.1.js"></script>
<script src="../src/keyutil-1.0.js"></script>
<script type="text/javascript">
<!--
$(document).ready(function(){
// _test/z1.prv.p5e.pem.des PKCS#5 RSA private key (DES-CBC)
var z1PrvP5EPEM = "" +
"-----BEGIN RSA PRIVATE KEY-----\n" +
"Proc-Type: 4,ENCRYPTED\n" +
"DEK-Info: DES-CBC,A3D5101CABF7BD71\n" +
"\n" +
"KvnKN0lzwCBEKt5ki9aiq0hi7PBMyLDxs5LLs/Jkqglin+w4f+h3CRwR5xs9xQff\n" +
"yQS4riWlJOZSd9ke6h/OAq8FAnd0M+amF3NoKwUSmNxnsNHXsoNJjIUeJia0lgfa\n" +
"pILuvtirdgv3d++fhfzdGMgitnB+RKJAJMQjtscgVYdsAGpIHVaYF++ZENbNlalZ\n" +
"ReGolfQBYv2eiQbg+EohEum7AZJsp4n+nkBetIS9Cvfg/C2Glx26atqiNsudGe4f\n" +
"Zey4DpWOPJp/xzFyFENbsRSOjxXSmGY595oExD4vQjGC3yriBWQebZqJFgyj8J2W\n" +
"jPgwGPS3NcnevXuZRETLHG5dL4KniQaSjTcMUuv2OoC2zfK+SxylMNfJdP8h38bf\n" +
"4rzOYYR1urPtAjyMVYAlTzwAArFUxZttRzhy737MIXE=\n" +
"-----END RSA PRIVATE KEY-----\n";
var z1PrvP5EPass = "passwd";
var z1PrvP5PHex = "3082013a020100024100e8664dd2b40529121568f3b39bc97a62e7ba3c09babdc4f0dcd8df90eb790b9bb645a2b70e3112747b4d3c41b51424895115fef88f79d43eae5b1a4e3518fd590203010001024078bbc54c646795e9a623cb0f912c7f9f6861711560e57bade21ded2f7d9579f86272fab9e71ab27282c2760c404dae6ac8a3ab852cf6bcd562f9aff8247a264d022100fe9bd450866b3255614fde976a76ac0b1d5830dda64f5359b946d8512bc1239f022100e9ab680f5f05dbb0f4311b0e6f4368f4874a1238979d8bc600c35c6f20707c07022100d549cb698dc17d4fe30e5a84f3ade860033c1eeb7f67d286465c9fd817d45b3702201849b4bb44493b989d092da2c675df46eb790b83ce5e95d4b2e79b88017b2fa902207d261a96256d49b020cb1d587ecde127e093a4d2b34cdbff171f34125b5857a9";
test("getDecryptedKeyHex z1(DES-CBC)", function() {
var hex = KEYUTIL.getDecryptedKeyHex(z1PrvP5EPEM, z1PrvP5EPass);
equal(hex, z1PrvP5PHex, "z1 DES-CBC");
});
test("getKey z1(DES-CBC)", function() {
var key = KEYUTIL.getKey(z1PrvP5EPEM, z1PrvP5EPass);
expect(3);
equal(key.n.toString(16), "e8664dd2b40529121568f3b39bc97a62e7ba3c09babdc4f0dcd8df90eb790b9bb645a2b70e3112747b4d3c41b51424895115fef88f79d43eae5b1a4e3518fd59", "n");
equal(key.e, 65537, "e");
equal(key.d.toString(16), "78bbc54c646795e9a623cb0f912c7f9f6861711560e57bade21ded2f7d9579f86272fab9e71ab27282c2760c404dae6ac8a3ab852cf6bcd562f9aff8247a264d", "d");
});
});
-->
</script>
</head>
<body>
<div id="qunit"></div>
<div id="qunit-fixture">test markup</div>
QUnit for
<a href="qunit-do-keyutil.html">keyutil</a> |
<a href="qunit-do-keyutil-eprv.html">keyutil-eprv</a> |
<a href="qunit-do-keyutil-pub.html">keyutil-pub</a> |
</body>
</html>