Skip to content

Commit

Permalink
web and sample update and fix
Browse files Browse the repository at this point in the history
  • Loading branch information
kjur committed Sep 4, 2016
1 parent 02a00c3 commit 66d4fbc
Show file tree
Hide file tree
Showing 11 changed files with 101 additions and 179 deletions.
49 changes: 10 additions & 39 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,13 @@ <h2 id="project_tagline">opensource free pure JavaScript cryptographic library s
<a href="https://github.com/kjur/jsrsasign/wiki#programming-tutorial">TUTORIALS</a> |
<a href="https://github.com/kjur/jsrsasign/wiki" target="_blank">Wiki</a> |
<a href="https://kjur.github.io/jsrsasign/api/" target="_blank">API REFERENCE</a> |
<a href="https://kjur.github.io/jsrsasign/index.html#demo" target="_blank">DEMOS</a> |
<a href="https://kjur.github.io/jsrsasign/sample/" target="_blank">NEW DEMOS</a> |
<a href="https://github.com/kjur/jsrsasign/wiki/jsrsasign-Online-Tools" target="_blank">Online Tool</a> |
<a href="https://github.com/kjur/jsrsasign/wiki/jsrsasign-Demo" target="_blank">DEMO</a> |
<a href="https://kjur.github.io/jsrsasign/sample/" target="_blank">NEW DEMO</a> |
<a href="https://github.com/kjur/jsrsasign/tree/master/sample_node">Node sample</a> |
<a href="https://npmjs.org/package/jsrsasign" target="_blank">NPM</a> |
<a href="https://kjur.github.io/jsrsasign/test/" target="_blank">TEST</a> |
<a href="https://kjur.github.io/jsrsasign/slide_e/" target="_blank">SLIDE</a> |
</header>
</div>

Expand All @@ -60,11 +62,16 @@ <h3>FEATURES</h3>
<a href="https://kjur.github.io/jsrsasign/api/symbols/KJUR.jws.JWS.html#.verifyJWT">JSON Web Token(JWT)</a> and
<a href="https://kjur.github.io/jsrsasign/api/symbols/KEYUTIL.html#.getKey">JSON Web Key(JWK)</a></li>
<li>Supported formats and algorithms are listed <a href="index_alg.html">here</a>.</li>

</ul>

<a href="slide_e/"><img src="slide_e/index1.png"/></a>
<br clear="all"/>

<h3>NEWS</h3>
<dl>
<dt><b>2016-Sep-03</b>:
<dd><a href="slide_e/">Slides for jsrsasign introduction</a> is available.

<dt><b>2016-Feb-28</b>:
<dd><a href="https://github.com/kjur/jsrsasign/releases/tag/5.0.6">
Release 5.0.6</a> is now available.
Expand All @@ -85,45 +92,9 @@ <h3>NEWS</h3>
<a href="api/symbols/global__.html">Some file read/save functions</a> added for Node.js
in <a href="api/symbols/src/nodeutil-1.0.js.html">nodeutil.js</a>.

<dt><b>2015-Oct-14</b>:
<dd><a href="https://github.com/kjur/jsrsasign/releases/tag/5.0.0">
Release 5.0.0</a> is now available.
<a href="api/symbols/KJUR.crypto.Mac.html">
Mac class</a> some issue fix and extra features for Mac passwords.
It is also affects to <a href="api/symbols/KJUR.jws.JWS.html">JWS class</a>.
<a href="api/symbols/KEYUTIL.html#getKey">KEYUTIL.getKey</a> supports
RSA JWK without P/Q/DP/DQ/COEFF. <br/>
NOTICE: Release 4.10.0 was declined because of semver violation.

<dt><b>2015-Sep-15</b>:
<dd><a href="tool_csr.html">Keypair and CSR generator demonstration page</a> is available.

<dt><b>2015-Sep-13</b>:
<dd><a href="https://github.com/kjur/jsrsasign/releases/tag/4.9.0">Release 4.9.0</a> is now available.
<a href="api/symbols/KJUR.asn1.csr.html#.dump">Certificate signing request (CSR/PKCS#10) support</a> is added.

</dl>
Old news is <a href="index_oldnews.html">here</a>.

<h3><a name="demo">ONLINE TOOL & DEMO</a></h3>
<ul>
<li><a href="tool_ca.html" target="_blank">JavaScript Certification Authority</a></li>
<li><a href="tool_pkcs5view.html" target="_blank">Encrypted PKCS#5 Private Key Viewer</a></li>
<li><a href="tool_certview.html" target="_blank">Online Certificate Viewer</a></li>
<li><a href="tool_forfact.html" target="_blank">Fake certificate converter from CSR for factorable.net checking</a></li>
<li><a href="tool_cmssign.html" target="_blank">Simple CMS SignedData generator</a></li>
<li><a href="tool_csr.html" target="_blank">Keypair and CSR/PKCS#10 generator demo</a></li>
</ul>

<ul>
<li><a href="sample-ecdsa.html">Sample Application for ECDSA signing with JavaScript(NEW!!!)</a>
<li><a href="sample-rsasign.html">Sample Application for RSA signing with JavaScript</a>
<br clear="all"/>
<img src="sample-rsasign.png" width="480px" style="border: 2px #dddddd solid;"/>
<br clear="all"/>
</li>
</ul>

<h3>DOWNLOAD</h3>

<ul>
Expand Down
49 changes: 20 additions & 29 deletions index_jws.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,26 +11,26 @@

<body>

<!-- HEADER -->
<div id="header_wrap" class="outer">
<header class="inner">
<a id="forkme_banner" href="https://github.com/kjur/jsjws">View on GitHub</a>

<h1 id="project_title">jsjws (now a part of jsjws)</h1>
<h2 id="project_tagline">jsjws : pure JavaScript implementation of JWT ( JSON Web Token ) and JWS ( JSON Web Signature )</h2>
<section id="downloads">
<a class="zip_download_link" href="https://github.com/kjur/jsjws/zipball/master">Download this project as a .zip file</a>
<a class="tar_download_link" href="https://github.com/kjur/jsjws/tarball/master">Download this project as a tar.gz file</a>
</section>
<a href="http://kjur.github.io/jsrsasign/">jsrsasign TOP</a> |
<a href="https://github.com/kjur/jsrsasign/releases" 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_jws.html#demo" target="_blank">DEMOS</a> |
<a href="http://kjur.github.io/jsrsasign/mobile/">MOBILE</a> |
<a href="https://npmjs.org/package/jsrsasign" target="_blank">NPM</a> |
</header>
</div>
<!-- HEADER -->
<div id="header_wrap" class="outer">
<header class="inner">
<a id="forkme_banner" href="https://github.com/kjur/jsjws">View on GitHub</a>

<h1 id="project_title">jsjws (now a part of jsjws)</h1>
<h2 id="project_tagline">jsjws : pure JavaScript implementation of JWT ( JSON Web Token ) and JWS ( JSON Web Signature )</h2>
<section id="downloads">
<a class="zip_download_link" href="https://github.com/kjur/jsjws/zipball/master">Download this project as a .zip file</a>
<a class="tar_download_link" href="https://github.com/kjur/jsjws/tarball/master">Download this project as a tar.gz file</a>
</section>
<a href="https://kjur.github.io/jsrsasign/">jsrsasign TOP</a> |
<a href="https://github.com/kjur/jsrsasign/releases" target="_blank">DOWNLOADS</a> |
<a href="https://github.com/kjur/jsrsasign/wiki#programming-tutorial">TUTORIALS</a> |
<a href="https://kjur.github.io/jsrsasign/api/" target="_blank">API REFERENCE</a> |
<a href="https://kjur.github.io/jsrsasign/index_jws.html#demo" target="_blank">DEMOS</a> |
<a href="https://kjur.github.io/jsrsasign/mobile/">MOBILE</a> |
<a href="https://npmjs.org/package/jsrsasign" target="_blank">NPM</a> |
</header>
</div>

<!-- MAIN CONTENT -->
<div id="main_content_wrap" class="outer">
Expand Down Expand Up @@ -131,15 +131,6 @@ <h3>NEWS</h3>
</ul>
</dl>

<h3><a name="demo">ONLINE TOOL</a></h3>
<ul>
<li><a href="tool_jwt.html" target="_blank">Online JWT generator/verifier (UPDATE)</a></li>
<li><a href="tool_jwtveri.html" target="_blank">Online JWT full verifier (NEW!!!)</a></li>
<li><a href="tool_jwsverifyanalyze.html" target="_blank">Online JWS verifier/analyzer</a></li>
<li><a href="tool_b64uenc.html" target="_blank">Online Base64URL encoder</a></li>
<li><a href="tool_b64udec.html" target="_blank">Online Base64URL decoder</a></li>
</ul>

<h3>DEMO</h3>
<ul>
<li><a href="sample_jwsgenerate.html" target="_blank">sign JWS with naked private key</a></li>
Expand Down
46 changes: 31 additions & 15 deletions index_oldnews.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,28 +10,44 @@
<title>jsrsasign Old News</title>
</head>

<body>
<!-- HEADER -->
<div id="header_wrap" class="outer">
<header class="inner">
<h1 id="project_title">jsrsasign Old News Archive</h1>
<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>
<body>
<!-- HEADER -->
<div id="header_wrap" class="outer">
<header class="inner">
<h1 id="project_title">jsrsasign Old News Archive</h1>
<a href="https://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="https://kjur.github.io/jsrsasign/api/" target="_blank">API REFERENCE</a> |
<a href="https://github.com/kjur/jsrsasign/wiki/jsrsasign-Demo" target="_blank">DEMO</a> |
</header>
</div>

<!-- MAIN CONTENT -->
<div id="main_content_wrap" class="outer">
<section id="main_content" class="inner">
<!-- MAIN CONTENT -->
<div id="main_content_wrap" class="outer">
<section id="main_content" class="inner">

<!-- now editing -->
<h1>Old News</h1>

<dl>

<dt><b>2015-Oct-14</b>:
<dd><a href="https://github.com/kjur/jsrsasign/releases/tag/5.0.0">
Release 5.0.0</a> is now available.
<a href="api/symbols/KJUR.crypto.Mac.html">
Mac class</a> some issue fix and extra features for Mac passwords.
It is also affects to <a href="api/symbols/KJUR.jws.JWS.html">JWS class</a>.
<a href="api/symbols/KEYUTIL.html#getKey">KEYUTIL.getKey</a> supports
RSA JWK without P/Q/DP/DQ/COEFF. <br/>
NOTICE: Release 4.10.0 was declined because of semver violation.

<dt><b>2015-Sep-15</b>:
<dd><a href="tool_csr.html">Keypair and CSR generator demonstration page</a> is available.

<dt><b>2015-Sep-13</b>:
<dd><a href="https://github.com/kjur/jsrsasign/releases/tag/4.9.0">Release 4.9.0</a> is now available.
<a href="api/symbols/KJUR.asn1.csr.html#.dump">Certificate signing request (CSR/PKCS#10) support</a> is added.
<dt><b>2015-Jun-11</b>:
<dd><a href="https://github.com/kjur/jsrsasign/releases/tag/4.8.3">Release 4.8.3</a> is now available.
<a href="api/symbols/ASN1HEX.html#.dump">ASN1HEX.dump() ASN.1 dump functionality</a> is added.
Expand Down
22 changes: 9 additions & 13 deletions sample_jwsgenerate.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,29 +9,33 @@
<script language="JavaScript" type="text/javascript">
function _genJWS() {
var sHead = newline_toDos(document.form1.jwshead1.value);
var head = KJUR.jws.JWS.readSafeJSONString(sHead);
var sPayload = newline_toDos(document.form1.jwspayload1.value);
var hN = document.form1.pubkey1_n.value;
var hE = document.form1.pubkey1_e.value;
var hD = document.form1.pubkey1_d.value;

var jws = new KJUR.jws.JWS();
var sResult = null;
var prv;
try {
sResult = jws.generateJWSByNED(sHead, sPayload, hN, hE, hD);
if (hN.match(/^[8-9,a-f]/)) hN = "00" + hN;
prv = KEYUTIL.getKey({n: hN, e: hE, d: hD});
sResult = KJUR.jws.JWS.sign(head.alg, sHead, sPayload, prv);
document.form1.jwsgenerated1.value = sResult;
} catch (ex) {
alert("Error: " + ex);
}
}

function _checkIfSame() {
var jws = new new KJUR.jws.JWS();
var jws1 = new KJUR.jws.JWS();
var sJWS = document.form1.jwsgenerated1.value;
var sExpectedEncodedSignatureValue = document.form1.jwsexpectedencsig1.value;
var sEncodedSignatureValueOfJWS = null;

try {
sEncodedSignatureValueOfJWS = jws.getEncodedSignatureValueFromJWS(sJWS);
var a = sJWS.split(/\./);
sEncodedSignatureValueOfJWS = a[2];
} catch (ex) {
alert("Error: " + ex);
return;
Expand Down Expand Up @@ -104,20 +108,12 @@ <h3>USAGE</h3>
</ol>

<center>
Copyright &copy; 2012-2015 Kenji Urushima, All Rights Reserved.
Copyright &copy; 2012-2016 Kenji Urushima, All Rights Reserved.
</center>

<div align="right">
<a href="index.html">Go back to index</a>
</div>

<div align="right">
<a href="http://twitter.com/kjur/" target="_blank" alt="kjur on twitter">
<img src="http://www9.atwiki.jp/kurushima/pub/icon/icon_twitter.gif" border="0" width="20"/>
</a>
<a href="http://x5.choumusubi.com/bin/gg?069823300">
<img src="http://x5.choumusubi.com/bin/ll?069823300" border="0" width="20"/>
</a>
</div>
</body>
</html>
17 changes: 6 additions & 11 deletions sample_jwsgenerate2.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,16 @@
<script language="JavaScript" type="text/javascript">
function _genJWS() {
var sHead = newline_toDos(document.form1.jwshead1.value);
var head = KJUR.jws.JWS.readSafeJSONString(sHead);
var sPayload = newline_toDos(document.form1.jwspayload1.value);
var sPemPrvKey = document.form1.pemprvkey1.value;

var jws = new KJUR.jws.JWS();
var sResult = null;
try {
sResult = jws.generateJWSByP1PrvKey(sHead, sPayload, sPemPrvKey);
prv = KEYUTIL.getKey(sPemPrvKey);

sResult = KJUR.jws.JWS.sign(head.alg, sHead, sPayload, prv);
document.form1.jwsgenerated1.value = sResult;
} catch (ex) {
alert("Error: " + ex);
Expand Down Expand Up @@ -43,7 +46,7 @@ <h1>Sample JWS Signing Application</h1>
"http://example.com/is_root":true}</textarea>
</td></tr>
<tr><td>Signing PKCS#1 RSA Private Key</td><td colspan="2">
<textarea name="pemprvkey1" rows="10" cols="65">-----BEGIN RSA PRIVATE KEY-----
<textarea name="pemprvkey1" rows="10" cols="80">-----BEGIN RSA PRIVATE KEY-----
MIIEogIBAAKCAQEA4qiw8PWs7PpnnC2BUEoDRcwXF8pq8XT1/3Hc3cuUJwX/otNe
fr/Bomr3dtM0ERLN3DrepCXvuzEU5FcJVDUB3sI+pFtjjLBXD/zJmuL3Afg91J9p
79+Dm+43cR6wuKywVJx5DJIdswF6oQDDzhwu89d2V5x02aXB9LqdXkPwiO0eR5s/
Expand Down Expand Up @@ -91,20 +94,12 @@ <h3>USAGE</h3>
</ol>

<center>
Copyright &copy; 2012-2015 Kenji Urushima, All Rights Reserved.
Copyright &copy; 2012-2016 Kenji Urushima, All Rights Reserved.
</center>

<div align="right">
<a href="index.html">Go back to index</a>
</div>

<div align="right">
<a href="http://twitter.com/kjur/" target="_blank" alt="kjur on twitter">
<img src="http://www9.atwiki.jp/kurushima/pub/icon/icon_twitter.gif" border="0" width="20"/>
</a>
<a href="http://x5.choumusubi.com/bin/gg?069823300">
<img src="http://x5.choumusubi.com/bin/ll?069823300" border="0" width="20"/>
</a>
</div>
</body>
</html>
30 changes: 5 additions & 25 deletions sample_jwsgenerate3.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,29 +8,17 @@
</style>
<script language="JavaScript" type="text/javascript">

function SecureRandom() { }

SecureRandom.prototype.nextBytes = function(ba) {
var ua = new Uint8Array(ba.length), i;

window.crypto.getRandomValues(ua);

for (i = 0; i < ba.length; i += 1) {
ba[i] = ua[i];
}
};

function _genJWS() {
var sHead = newline_toDos(document.form1.jwshead1.value);
var head = KJUR.jws.JWS.readSafeJSONString(sHead);
var sPayload = newline_toDos(document.form1.jwspayload1.value);
var sPemPrvKey = document.form1.pemprvkey1.value;

var jws = new KJUR.jws.JWS();
var sResult = null;
try {
var key = new RSAKey();
key.readPrivateKeyFromPEMString(sPemPrvKey);
sResult = jws.generateJWSByKey(sHead, sPayload, key);
var prv = KEYUTIL.getKey(sPemPrvKey);
sResult = KJUR.jws.JWS.sign(head.alg, sHead, sPayload, prv);
document.form1.jwsgenerated1.value = sResult;
} catch (ex) {
alert("Error: " + ex);
Expand Down Expand Up @@ -58,7 +46,7 @@ <h1>Sample JWS Signing Application</h1>
"http://example.com/is_root":true}</textarea>
</td></tr>
<tr><td>Signing PKCS#1 RSA Private Key</td><td colspan="2">
<textarea name="pemprvkey1" rows="10" cols="65">-----BEGIN RSA PRIVATE KEY-----
<textarea name="pemprvkey1" rows="10" cols="80">-----BEGIN RSA PRIVATE KEY-----
MIIEogIBAAKCAQEA4qiw8PWs7PpnnC2BUEoDRcwXF8pq8XT1/3Hc3cuUJwX/otNe
fr/Bomr3dtM0ERLN3DrepCXvuzEU5FcJVDUB3sI+pFtjjLBXD/zJmuL3Afg91J9p
79+Dm+43cR6wuKywVJx5DJIdswF6oQDDzhwu89d2V5x02aXB9LqdXkPwiO0eR5s/
Expand Down Expand Up @@ -106,20 +94,12 @@ <h3>USAGE</h3>
</ol>

<center>
Copyright &copy; 2013-2015 Kenji Urushima, Dave All Rights Reserved.
Copyright &copy; 2013-2016 Kenji Urushima, Dave All Rights Reserved.
</center>

<div align="right">
<a href="index.html">Go back to index</a>
</div>

<div align="right">
<a href="http://twitter.com/kjur/" target="_blank" alt="kjur on twitter">
<img src="http://www9.atwiki.jp/kurushima/pub/icon/icon_twitter.gif" border="0" width="20"/>
</a>
<a href="http://x5.choumusubi.com/bin/gg?069823300">
<img src="http://x5.choumusubi.com/bin/ll?069823300" border="0" width="20"/>
</a>
</div>
</body>
</html>
Loading

0 comments on commit 66d4fbc

Please sign in to comment.