forked from kjur/jsrsasign
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tool_tsreq.html
executable file
·127 lines (110 loc) · 4.18 KB
/
tool_tsreq.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
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8' />
<meta http-equiv="X-UA-Compatible" content="chrome=1" />
<meta name="description" content="jsrsasign : The 'jsrsasign' (RSA-Sign JavaScript Library) is a open source free pure JavaScript implementation of PKCS#1 v2.1 RSASSA-PKCS1-v1_5 RSA signing and validation algorithm." />
<link rel="stylesheet" type="text/css" media="screen" href="stylesheets/stylesheet.css">
<title>Time Stamp Request Generator</title>
<!-- for pkcs5pkey -->
<script language="JavaScript" type="text/javascript" src="jsrsasign-latest-all-min.js"></script>
<script language="JavaScript" type="text/javascript">
function doIt() {
var f1 = document.form1;
var json = {
mi: { hashAlg: f1.hashalg1.value,
hashValue: f1.hashval1.value }
};
if (f1.policy1.value != "")
json.policy = {oid: f1.policy1.value};
if (f1.nonce1.value != "")
json.nonce = {hex: f1.nonce1.value};
if (f1.certreq1.checked) {
json.certreq = true;
} else {
json.certreq = false;
}
f1.newreq1.value = "generating ...";
var o = new KJUR.asn1.tsp.TimeStampReq(json);
var hex = o.getEncodedHex();
var b64 = hex2b64(hex);
var pemBody = b64.replace(/(.{64})/g, "$1\r\n");
pemBody = pemBody.replace(/\r\n$/, '');
f1.newreq1.value = pemBody;
}
</script>
</head>
<body>
<!-- HEADER -->
<div id="header_wrap" class="outer">
<header class="inner">
<h1 id="project_title">TimeStampReq Generator</h1>
<h2 id="project_tagline">RFC 3161 Time Stamp Request Generator</h2>
<a href="http://kjur.github.io/jsrsasign/">TOP</a> |
<a href="https://github.com/kjur/jsrsasign/tags/" target="_blank">DOWNLOADS</a> |
<a href="https://github.com/kjur/jsrsasign/wiki#programming-tutorial">TUTORIALS</a> |
<a href="http://kjur.github.io/jsrsasign/api/" target="_blank">API REFERENCE</a> |
<a href="http://kjur.github.io/jsrsasign/index.html#demo" target="_blank">DEMOS</a> |
</header>
</div>
<!-- MAIN CONTENT -->
<div id="main_content_wrap" class="outer">
<section id="main_content" class="inner">
<!-- now editing -->
<form name="form1">
<h4>(Step1) Fill Fields</h4>
<table>
<tr><th colspan="2">MessageImprint</th></tr>
<tr><td>hashAlg:</td><td>
<select name="hashalg1">
<option value="sha256">SHA-256
<option value="sha512">SHA-512
<option value="sha384">SHA-384
<option value="sha224">SHA-224
<option value="sha1">SHA-1
<option value="md5">MD5
<option value="ripemd160">RIPEMD160
</select>
</td></tr>
<tr><td>hashValue(hex):</td><td><input type="text" name="hashval1" value="9834876dcfb05cb167a5c24953eba58c4ac89b1adf57f28f2f9d09af107ee8f0" size="80"/><br/>
Fill hash value of document to be time-stamped. You can use sha256sum or 'openssl dgst -HASHALG FILE' command.
</td></tr>
<tr><th colspan="2">Other Optional Fields</th></tr>
<tr><td>ReqPolicy:</td>
<td><input type="text" name="policy1" value="1.2.3.4.5" size="80"/></td></tr>
<tr><td>Nonce:</td><td>
<input type="text" name="nonce1" value="1a1b1c1e1f2a2b2c2d2e2f" size="40"/>
</td></tr>
<tr><td>certReq:</td><td>
exists<input type="checkbox" name="certreq1" value="1" checked/>
</td></tr>
</table>
<h4>(Step2) Press "Generate" button</h4>
<input type="button" value="Generate Request" onClick="doIt();"/>
<input type="reset" name="reset" value="Reset"/>
<h2>Generated TimeStampReq</h2>
<textarea name="newreq1" cols="65" rows="8"></textarea>
<br/>
To see this request by openssl, save this to a file and:
<blockquote>
% openssl base64 -in FILE -out FILE2<br/>
% openssl ts -query -in FILE2 -text<br/>
</blockquote>
You can copy this request and generate time stamp token
for it at <a href="tool_tsres.html">another sample page.</a>
</form>
<!-- now editing -->
</section>
</div>
<!-- FOOTER -->
<div id="footer_wrap" class="outer">
<footer class="inner">
<p class="copyright">jsrsasign maintained by <a href="https://github.com/kjur">kjur</a></p>
<p>Published with <a href="http://pages.github.com">GitHub Pages</a></p>
<div align="center" style="color: white">
Copyright © 2010-2014 Kenji Urushima. All rights reserved.
</div>
</footer>
</div>
</body>
</html>