Skip to content

Commit

Permalink
10.1.11 release
Browse files Browse the repository at this point in the history
  • Loading branch information
kjur committed Feb 19, 2021
1 parent dbd30e0 commit cb31c13
Show file tree
Hide file tree
Showing 16 changed files with 3,100 additions and 3,016 deletions.
10 changes: 7 additions & 3 deletions ChangeLog.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@

ChangeLog for jsrsasign

TBD
* Changes from 10.1.10 to next release (2021-xx-xx)
- src/nodeutil.js
update X509.getVersion and add jsrsasign-util saveFileJSON
* Changes from 10.1.10 to 10.1.11 (2021-02-19)
- src/x509.js
- X509.getVersion supports other than
empty(DEFAULT =v1) and [0] {INTEGER 2} (=v3).
Thus version checking is relaxed. (#471)
- src/nodeutil.js (jsrsasign-util 1.0.4)
- add saveFileUTF8
- saveFileJSON API document fix

Expand Down
2 changes: 1 addition & 1 deletion api/files.html
Original file line number Diff line number Diff line change
Expand Up @@ -827,7 +827,7 @@ <h2><a href="symbols/src/nodeutil-1.0.js.html">nodeutil-1.0.js</a></h2>


<dt class="heading">Version:</dt>
<dd>jsrsasign-util 1.0.1 nodeutil 1.0.1 (2020-Oct-23)</dd>
<dd>jsrsasign-util 1.0.3 nodeutil 1.0.2 (2021-Feb-15)</dd>



Expand Down
58 changes: 57 additions & 1 deletion api/symbols/global__.html
Original file line number Diff line number Diff line change
Expand Up @@ -990,6 +990,16 @@ <h1 class="classTitle">
</td>
</tr>

<tr>
<td class="attributes">&nbsp;</td>
<td class="nameDescription">
<div class="fixedFont"><b><a href="../symbols/global__.html#saveFileUTF8">saveFileUTF8</a></b>(binFile, utf8String)
</div>
<div class="description">save UTF-8 string to file
This function only works in Node.js.</div>
</td>
</tr>

<tr>
<td class="attributes">&nbsp;</td>
<td class="nameDescription">
Expand Down Expand Up @@ -3625,7 +3635,7 @@ <h1 class="classTitle">


<pre class="code">var rsu = require("jsrsasign-util");
rsu.saveJSONC("aaa.jsonc", json);</pre>
rsu.saveFileJSON("aaa.jsonc", json);</pre>



Expand Down Expand Up @@ -3660,6 +3670,52 @@ <h1 class="classTitle">



<hr />

<a name="saveFileUTF8"> </a>
<div class="fixedFont">


<b>saveFileUTF8</b>(binFile, utf8String)

</div>
<div class="description">
save UTF-8 string to file
This function only works in Node.js.

<br />
<i>Defined in: </i> <a href="../symbols/src/nodeutil-1.0.js.html">nodeutil-1.0.js</a>.


</div>




<dl class="detailList">
<dt class="heading">Parameters:</dt>

<dt>
<span class="light fixedFont">{String}</span> <b>binFile</b>

</dt>
<dd>file name to save contents.</dd>

<dt>
<span class="light fixedFont">{String}</span> <b>utf8String</b>

</dt>
<dd>string contents to be saved.</dd>

</dl>








<hr />

<a name="stob64"> </a>
Expand Down
194 changes: 103 additions & 91 deletions api/symbols/src/nodeutil-1.0.js.html

Large diffs are not rendered by default.

5,810 changes: 2,908 additions & 2,902 deletions api/symbols/src/x509-1.1.js.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "kjur-jsrsasign",
"version": "10.1.10",
"version": "10.1.11",
"main": "jsrsasign-all-min.js",
"description": "The 'jsrsasign' (RSA-Sign JavaScript Library) is an opensource free cryptography library supporting RSA/RSAPSS/ECDSA/DSA signing/validation, ASN.1, PKCS#1/5/8 private/public key, X.509 certificate, CRL, OCSP, CMS SignedData, TimeStamp, CAdES, JWS and JWT in pure JavaScript.",
"license": "MIT",
Expand Down
4 changes: 2 additions & 2 deletions jsrsasign-all-min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion jsrsasign-jwths-min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion jsrsasign-rsa-min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion min/x509-1.1.min.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions npm/lib/jsrsasign-all-min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion npm/lib/jsrsasign-jwths-min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion npm/lib/jsrsasign-rsa-min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions npm/lib/jsrsasign.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion npm/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "jsrsasign",
"version": "10.1.10",
"version": "10.1.11",
"description": "opensource free pure JavaScript cryptographic library supports RSA/RSAPSS/ECDSA/DSA signing/validation, ASN.1, PKCS#1/5/8 private/public key, X.509 certificate, CRL, OCSP, CMS SignedData, TimeStamp and CAdES and JSON Web Signature(JWS)/Token(JWT)/Key(JWK).",
"main": "lib/jsrsasign.js",
"scripts": {
Expand Down
16 changes: 11 additions & 5 deletions src/x509-1.1.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ function X509(params) {
_getIdxbyList = _ASN1HEX.getIdxbyList,
_getIdxbyListEx = _ASN1HEX.getIdxbyListEx,
_getVidx = _ASN1HEX.getVidx,
_getInt = _ASN1HEX.getInt,
_oidname = _ASN1HEX.oidname,
_hextooidstr = _ASN1HEX.hextooidstr,
_X509 = X509,
Expand Down Expand Up @@ -150,15 +151,20 @@ function X509(params) {
if (this.hex === null || this.version !== 0) return this.version;

// check if the first item of tbsCertificate "[0] { INTEGER 2 }"
if (_getTLVbyList(this.hex, 0, [0, 0]) !==
"a003020102") {
var hFirstObj = _getTLVbyList(this.hex, 0, [0, 0]);
if (hFirstObj.substr(0, 2) == "a0") {
var hVersionTLV = _getTLVbyList(hFirstObj, 0, [0]);
var iVersion = _getInt(hVersionTLV, 0);
if (iVersion < 0 || 2 < iVersion) {
throw new Error("malformed version field");
}
this.version = iVersion + 1;
return this.version;
} else {
this.version = 1;
this.foffset = -1;
return 1;
}

this.version = 3;
return 3;
};

/**
Expand Down

0 comments on commit cb31c13

Please sign in to comment.