Permalink
Browse files

web update

  • Loading branch information...
1 parent ea94d71 commit 668e0e3bed5f7600bd4e561229b1faa009268933 @kjur committed Jul 31, 2013
Showing with 452 additions and 1 deletion.
  1. +1 −1 sample-rsasign.html
  2. +210 −0 tool_ca.html
  3. +117 −0 tool_certview.html
  4. +124 −0 tool_pkcs5view.html
View
@@ -21,7 +21,7 @@
<script language="JavaScript" type="text/javascript" src="rsasign-1.2.js"></script>
<script language="JavaScript" type="text/javascript" src="asn1hex-1.1.js"></script>
<script language="JavaScript" type="text/javascript" src="x509-1.1.js"></script>
-<script language="JavaScript" type="text/javascript" src="crypto-1.0.js"></script>
+<script language="JavaScript" type="text/javascript" src="crypto-1.1.js"></script>
<script language="JavaScript" type="text/javascript">
function doSign() {
var rsa = new RSAKey();
View
@@ -0,0 +1,210 @@
+<!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>JS Certification Authority :)</title>
+<!-- for pkcs5pkey -->
+<script src="http://crypto-js.googlecode.com/svn/tags/3.1.2/build/components/core.js"></script>
+<script src="http://crypto-js.googlecode.com/svn/tags/3.1.2/build/components/cipher-core.js"></script>
+<script src="http://crypto-js.googlecode.com/svn/tags/3.1.2/build/components/md5.js"></script>
+<script src="http://crypto-js.googlecode.com/svn/tags/3.1.2/build/components/tripledes.js"></script>
+<script src="http://crypto-js.googlecode.com/svn/tags/3.1.2/build/components/enc-base64.js"></script>
+<!-- for crypto -->
+<script src="http://crypto-js.googlecode.com/svn/tags/3.1.2/build/components/sha1.js"></script>
+<!-- for crypto, asn1, asn1x509 -->
+<script src="http://yui.yahooapis.com/2.9.0/build/yahoo/yahoo-min.js"></script>
+<!-- for asn1x509(stohex) -->
+
+<script language="JavaScript" type="text/javascript" src="ext/jsbn.js"></script>
+<script language="JavaScript" type="text/javascript" src="ext/jsbn2.js"></script>
+<script language="JavaScript" type="text/javascript" src="ext/rsa.js"></script>
+<script language="JavaScript" type="text/javascript" src="ext/rsa2.js"></script>
+<script language="JavaScript" type="text/javascript" src="ext/base64.js"></script>
+<script language="JavaScript" type="text/javascript" src="base64x-1.1.js"></script>
+<script language="JavaScript" type="text/javascript" src="asn1hex-1.1.js"></script>
+<script language="JavaScript" type="text/javascript" src="rsapem-1.1.js"></script>
+<script language="JavaScript" type="text/javascript" src="rsasign-1.2.js"></script>
+<script language="JavaScript" type="text/javascript" src="x509-1.1.js"></script>
+<script language="JavaScript" type="text/javascript" src="pkcs5pkey-1.0.js"></script>
+<script language="JavaScript" type="text/javascript" src="asn1-1.0.js"></script>
+<script language="JavaScript" type="text/javascript" src="asn1x509-1.0.js"></script>
+<script language="JavaScript" type="text/javascript" src="crypto-1.1.js"></script>
+<script language="JavaScript" type="text/javascript">
+function doIssue() {
+ var f1 = document.form1;
+
+ f1.newcert1.value = "issuing ...";
+
+ // 1. generate TBSCertificate
+ var tbsc = new KJUR.asn1.x509.TBSCertificate();
+ tbsc.setSerialNumberByParam({'int': parseInt(f1.serial1.value)});
+ tbsc.setSignatureAlgByParam({'name': 'SHA1withRSA'});
+ tbsc.setIssuerByParam({'str': f1.issuer1.value});
+ tbsc.setNotBeforeByParam({'str': f1.notbefore1.value});
+ tbsc.setNotAfterByParam({'str': f1.notafter1.value});
+ tbsc.setSubjectByParam({'str': f1.subject1.value});
+ tbsc.setSubjectPublicKeyByParam({'rsapem': f1.pubkey1.value});
+
+ if (f1.bc_exists.checked) {
+ var param = {};
+ param['critical'] = (f1.bc_critical.checked)? true : false;
+ param['cA'] = (f1.bc_ca.checked)? true : false;
+ if (f1.bc_pathlen.value != '') {
+ param['pathLen'] = parseInt(f1.bc_pathlen.value);
+ }
+ tbsc.appendExtension(new KJUR.asn1.x509.BasicConstraints(param));
+ }
+
+ if (f1.ku_exists.checked) {
+ var param = {};
+ param['critical'] = (f1.ku_critical.checked)? true : false;
+ var sBin = '';
+ sBin += (f1.ku_0dsig.checked) ? "1" : "0";
+ sBin += (f1.ku_1nonrep.checked) ? "1" : "0";
+ sBin += (f1.ku_2keyenc.checked) ? "1" : "0";
+ sBin += (f1.ku_3datenc.checked) ? "1" : "0";
+ sBin += (f1.ku_4keyagree.checked) ? "1" : "0";
+ sBin += (f1.ku_5keycertsign.checked) ? "1" : "0";
+ sBin += (f1.ku_6crlsign.checked) ? "1" : "0";
+ sBin += (f1.ku_7enconly.checked) ? "1" : "0";
+ sBin += (f1.ku_8deconly.checked) ? "1" : "0";
+ param['bin'] = sBin;
+ tbsc.appendExtension(new KJUR.asn1.x509.KeyUsage(param));
+ }
+
+ if (f1.cdp_exists.checked && f1.cdp_uri.value != '') {
+ var param = {};
+ param['critical'] = (f1.cdp_critical.checked)? true : false;
+ param['uri'] = f1.cdp_uri.value;
+ tbsc.appendExtension(new KJUR.asn1.x509.CRLDistributionPoints(param));
+ }
+
+ // generate and sign certificate
+ var cert = new KJUR.asn1.x509.Certificate({'tbscertobj': tbsc,
+ 'rsaprvpem': f1.cakey1.value,
+ 'rsaprvpas': f1.cakeypass1.value});
+ cert.sign();
+ f1.newcert1.value = cert.getPEMString();
+}
+</script>
+ </head>
+
+ <body>
+
+ <!-- HEADER -->
+ <div id="header_wrap" class="outer">
+ <header class="inner">
+ <h1 id="project_title">JS Certification Authority</h1>
+ <h2 id="project_tagline">This is the world's first test certification authority by pure JavaScript ;)</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 CA private key (PEM formatted PKCS#5 RSA key) and passcode</h4>
+<textarea name="cakey1" cols="65" rows="6">-----BEGIN RSA PRIVATE KEY-----
+Proc-Type: 4,ENCRYPTED
+DEK-Info: DES-EDE3-CBC,4626F2E5853E783F
+
+3vFpkrnbantC8RSzng2+jBw/VX95oi0VGKP0G8whENHUOVQXB/YOUSj+n80Y0Wwc
+GpeQi8U0FQdWyYv8b9aioeFB06r9t9mJsYscJ/wcIvv5tTMkr89cwN3+4GQQuqNg
+TmI9ekeoZ3NP26hTM4XTuFqHx4dzNNwjDLc8txc77WE/o4J4p8k9Py5yPZjs9EKy
+wy/yxtqQYQuFj90OMEG1G89iHTZRcq4YTZYdqg6P/XEUvyjifN+7Nym8f2N9TDDn
+RJtApPQlrgXvUDQKz6Lu1ZYMwe94E9YdutDGQMbxixbiyxlcxrkb/oEHH5WP5qPG
+w/xzh08Ce2Ftba2Q860S8nznjyZFiv+lqSKBahbujgP/63ZL+JbAd4cYBqgm4g1C
+YwMhHJbaVCzwYduxdyK2JBYEosDZiDfnOP4DqPhJYpg=
+-----END RSA PRIVATE KEY-----</textarea>
+<br/>
+CA KEY PASSCODE(=hoge): <input type="password" name="cakeypass1" value="hoge" size="0"/>
+<br/>
+
+<!-- ============================================================== -->
+
+<h4>(Step2) Fill Issuing Certificate Fields</h4>
+<table>
+<tr><td>Serial:</td><td><input type="text" name="serial1" value="76" size="20"/></td></tr>
+<tr><td>Issuer DN:</td><td><input type="text" name="issuer1" value="/C=US/O=JS-TEST-CA" size="80"/></td></tr>
+<tr><td>Validity:</td><td>
+From <input type="text" name="notbefore1" value="130501235959Z" size="20"/>
+To <input type="text" name="notafter1" value="230501235959Z" size="20"/>
+</td></tr>
+<tr><td>Subjec DN:</td><td><input type="text" name="subject1" value="/C=US/CN=Test User1" size="80"/></td></tr>
+<tr><td>Subject<br/>Public Key</td><td>
+<textarea name="pubkey1" cols="65" rows="3">-----BEGIN PUBLIC KEY-----
+MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAOtpGHibL8Ue+MXPPufkcrNES40rCT5L
+RIU9MjTZ8/7owG5bAsiFA9Xxh3uZK1T5QA64jNJVbp2ojHAtNyWPuwsCAwEAAQ==
+-----END PUBLIC KEY-----</textarea><br/>
+NOTE: This shall be 'BEGIN PUBLIC KEY', not 'BEGIN RSA PUBLIC KEY'.</td></tr>
+<tr><td colspan="2">
+Basic Constraints:
+exists<input type="checkbox" name="bc_exists" value="1" checked/>
+critical<input type="checkbox" name="bc_critical" value="1" checked/>
+cAflag<input type="checkbox" name="bc_ca" value="1"/>
+pathLen<input type="text" name="bc_pathlen" size="3"/>
+</td></tr>
+<tr><td colspan="2">
+Key Usage:
+exists<input type="checkbox" name="ku_exists" value="1" checked/>
+critical<input type="checkbox" name="ku_critical" value="1"/>
+<br/>
+<input type="checkbox" name="ku_0dsig" value="1" checked/> digitalSignature(0)
+<input type="checkbox" name="ku_1nonrep" value="1"/> nonRepudiation(1)
+<input type="checkbox" name="ku_2keyenc" value="1"/> keyEncipherment(2)<br/>
+<input type="checkbox" name="ku_3datenc" value="1"/> dataEncipherment(3)
+<input type="checkbox" name="ku_4keyagree" value="1"/> keyAgreement(4)
+<input type="checkbox" name="ku_5keycertsign" value="1"/> keyCertSign(5)<br/>
+<input type="checkbox" name="ku_6crlsign" value="1"/> keyEncipherment(6)
+<input type="checkbox" name="ku_7enconly" value="1"/> encipherOnly(7)
+<input type="checkbox" name="ku_8deconly" value="1"/> decipherOnly(8)<br/>
+</td></tr>
+<tr><td colspan="2">
+CRL DistributionPoints:
+exists<input type="checkbox" name="cdp_exists" value="1" checked/>
+critical<input type="checkbox" name="cdp_critical" value="1"/>
+<br/>
+URL<input type="text" name="cdp_uri" value="http://test.com/jsca.crl" size="80"/>
+</td></tr>
+</table>
+
+<h4>(Step3) Press "Issue Certificate" button</h4>
+<input type="button" value="Issue Certificate" onClick="doIssue();"/>
+<input type="reset" name="reset" value="Reset"/>
+
+<h2>Issued Certificate</h2>
+<textarea name="newcert1" cols="65" rows="8"></textarea>
+
+</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 &copy; 2010-2012 Kenji Urushima. All rights reserved.
+</div>
+ </footer>
+ </div>
+
+ </body>
+</html>
View
@@ -0,0 +1,117 @@
+<!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>Online Certificate Viewer</title>
+<script src="http://crypto-js.googlecode.com/svn/tags/3.1.2/build/components/core.js"></script>
+<script src="http://crypto-js.googlecode.com/svn/tags/3.1.2/build/components/sha1.js"></script>
+
+<script language="JavaScript" type="text/javascript" src="ext/jsbn.js"></script>
+<script language="JavaScript" type="text/javascript" src="ext/jsbn2.js"></script>
+<script language="JavaScript" type="text/javascript" src="ext/rsa.js"></script>
+<script language="JavaScript" type="text/javascript" src="ext/rsa2.js"></script>
+<script language="JavaScript" type="text/javascript" src="ext/sha1.js"></script>
+<script language="JavaScript" type="text/javascript" src="ext/base64.js"></script>
+<script language="JavaScript" type="text/javascript" src="crypto-1.1.min.js"></script>
+<script language="JavaScript" type="text/javascript" src="asn1hex-1.1.min.js"></script>
+<script language="JavaScript" type="text/javascript" src="rsapem-1.1.min.js"></script>
+<script language="JavaScript" type="text/javascript" src="rsasign-1.2.min.js"></script>
+<script language="JavaScript" type="text/javascript" src="x509-1.1.min.js"></script>
+<script language="JavaScript" type="text/javascript">
+function doView() {
+ var sCert = document.form1.cert1.value;
+ var c = new X509();
+ c.readCertPEM(sCert);
+ document.form1.serial1.value = c.getSerialNumberHex();
+ document.form1.issuer1.value = c.getIssuerString();
+ document.form1.notbefore1.value = c.getNotBefore();
+ document.form1.notafter1.value = c.getNotAfter();
+ document.form1.subject1.value = c.getSubjectString();
+ var f = function(s) { return KJUR.crypto.Util.hashString(s, 'sha1'); }
+ document.form1.thumb1.value = f(c.hex);
+}
+</script>
+ </head>
+
+ <body>
+
+ <!-- HEADER -->
+ <div id="header_wrap" class="outer">
+ <header class="inner">
+ <h1 id="project_title">Online Certificate Viewer</h1>
+ <h2 id="project_tagline">Basic field viewer for PEM formatted X.509 certificate.</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 PEM formatted X.509 certificate</h4>
+<textarea name="cert1" cols="65" rows="8">-----BEGIN CERTIFICATE-----
+MIIDMjCCAhqgAwIBAgIJAKMfG/B2MKd5MA0GCSqGSIb3DQEBBQUAMBoxCzAJBgNV
+BAYTAkpQMQswCQYDVQQKEwJ6MzAeFw0xMDA1MzEwNjE4MDhaFw0yMDA1MjgwNjE4
+MDhaMBoxCzAJBgNVBAYTAkpQMQswCQYDVQQKEwJ6MzCCASIwDQYJKoZIhvcNAQEB
+BQADggEPADCCAQoCggEBAOKosPD1rOz6Z5wtgVBKA0XMFxfKavF09f9x3N3LlCcF
+/6LTXn6/waJq93bTNBESzdw63qQl77sxFORXCVQ1Ad7CPqRbY4ywVw/8yZri9wH4
+PdSfae/fg5vuN3EesLissFSceQySHbMBeqEAw84cLvPXdlecdNmlwfS6nV5D8Ijt
+HkebP8R14AEpfoag3VS/YS6Hd4hmvZ1e3BJQm3JfFFVzTyZ0AH2oimsxfoQnZf7M
+qyIdCgmeaKYILEyYm6PKhVwZhuD5E+WG4RxNdcGCiC8GRUr2fYnXUT0CtwrYBYgZ
+121cFObeu7Z/aTIsx4MqYLHwaHqMga6U7nOHoEgqY7ECAwEAAaN7MHkwHQYDVR0O
+BBYEFKO4NcUDh3J5c7XD7j4pVXnzIfALMEoGA1UdIwRDMEGAFKO4NcUDh3J5c7XD
+7j4pVXnzIfALoR6kHDAaMQswCQYDVQQGEwJKUDELMAkGA1UEChMCejOCCQCjHxvw
+djCneTAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBBQUAA4IBAQC8JdiwJF22/3nB
+IxJT/gXXN10cub6O+x9q64ls7dpGpBvbi4/lJgZOsZqoJiswU5WOKZ4MTOmMHe4W
+e/MHuhcjsgf9EHHYZQ1reBYi/l9mBBbYFGs0zSv1CyjbwkyF36nr/8sWdYf4ZtXQ
+nzTGvoa6oTOOTmmj3Bwl3CHwonvgAJUCHY/UmWFzH8Sf0dDW7iJBj+ZWfjuSlSQe
+2ninrEpfA4v2V1p3LOH+layZLDMJHkNCq8eoU1MbJi07cHxLWtlwliNOiRboaiYl
+1wtWR7ZY4HZCPeyb0tanf58rBQAXElaCF3fmfHrlpxoJBsQP1NbFrBs2haOIEZ4E
+K3V9/Bpi
+-----END CERTIFICATE-----</textarea>
+
+<h4>(Step2) Press "View" button</h4>
+<input type="button" value="Analyze it!" onClick="doView();"/>
+
+<h2>Certificate Fields</h2>
+<table>
+<tr><td>SerialNumber:</td><td><input type="text" name="serial1" size="20"/></td></tr>
+<tr><td>Issuer:</td><td><input type="text" name="issuer1" size="80"/></td></tr>
+<tr><td>Validity:</td><td>
+From <input type="text" name="notbefore1" size="15"/>
+To <input type="text" name="notafter1" size="15"/>
+</td></tr>
+<tr><td>Subject:</td><td><input type="text" name="subject1" size="80"/></td></tr>
+<tr><td>SHA1 Thumb Print:</td><td><input type="text" name="thumb1" size="80"/></td></tr>
+</table>
+</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 &copy; 2010-2012 Kenji Urushima. All rights reserved.
+</div>
+ </footer>
+ </div>
+
+ </body>
+</html>
Oops, something went wrong.

0 comments on commit 668e0e3

Please sign in to comment.