Skip to content

Commit

Permalink
4.7.1 release
Browse files Browse the repository at this point in the history
  • Loading branch information
kjur committed May 14, 2015
1 parent 8f9cb39 commit cc1a86d
Show file tree
Hide file tree
Showing 14 changed files with 1,457 additions and 533 deletions.
7 changes: 7 additions & 0 deletions ChangeLog.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@

ChangeLog for jsrsasign

* Changes between 4.7.0 to 4.7.1 (2015-May-14)
- asn1x509 1.0.9 to 1.0.10
- certissuer and certsubj supported in GeneralName class
- x509 1.1.3 to 1.1.4
- getPublicKeyInfoPosOfCertHEX added
- tool_httpscfg.html added

* Changes between 4.6.0 to 4.7.0 (2014-Jul-07)
- RFC 5126 CAdES format supported
- CAdES-BES/EPES/T support in this version.
Expand Down
4 changes: 2 additions & 2 deletions api/files.html
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,7 @@ <h2><a href="symbols/src/asn1x509-1.0.js.html">asn1x509-1.0.js</a></h2>


<dt class="heading">Version:</dt>
<dd>1.0.9 (2014-May-17)</dd>
<dd>1.0.10 (2014-Jun-09)</dd>



Expand Down Expand Up @@ -683,7 +683,7 @@ <h2><a href="symbols/src/x509-1.1.js.html">x509-1.1.js</a></h2>


<dt class="heading">Version:</dt>
<dd>x509 1.1.3 (2014-May-17)</dd>
<dd>x509 1.1.4 (2015-May-14)</dd>



Expand Down
27 changes: 18 additions & 9 deletions api/symbols/KJUR.asn1.x509.GeneralName.html
Original file line number Diff line number Diff line change
Expand Up @@ -472,16 +472,14 @@ <h1 class="classTitle">
<li>rfc822 - rfc822Name[1] (ex. [email protected])</li>
<li>dns - dNSName[2] (ex. foo.com)</li>
<li>uri - uniformResourceIdentifier[6] (ex. http://foo.com/)</li>
<li>certissuer - directoryName[4] (PEM or hex string of cert)</li>
<li>certsubj - directoryName[4] (PEM or hex string of cert)</li>
</ul>
NOTE: Currently this only supports 'uniformResourceIdentifier'.
<h4>EXAMPLE AND ASN.1 SYNTAX</h4>

</div>



<pre class="code">var gn = new KJUR.asn1.x509.GeneralName({'uri': 'http://aaa.com/'});
NOTE1: certissuer and certsubj is supported since asn1x509 1.0.10.

Here is definition of the ASN.1 syntax:
<pre>
-- NOTE: under the CHOICE, it will always be explicit.
GeneralName ::= CHOICE {
otherName [0] OtherName,
rfc822Name [1] IA5String,
Expand All @@ -491,7 +489,18 @@ <h4>EXAMPLE AND ASN.1 SYNTAX</h4>
ediPartyName [5] EDIPartyName,
uniformResourceIdentifier [6] IA5String,
iPAddress [7] OCTET STRING,
registeredID [8] OBJECT IDENTIFIER }</pre>
registeredID [8] OBJECT IDENTIFIER }
</pre>

</div>



<pre class="code">gn = new KJUR.asn1.x509.GeneralName({rfc822: '[email protected]'});
gn = new KJUR.asn1.x509.GeneralName({dns: 'aaa.com'});
gn = new KJUR.asn1.x509.GeneralName({uri: 'http://aaa.com/'});
gn = new KJUR.asn1.x509.GeneralName({certissuer: certPEM});
gn = new KJUR.asn1.x509.GeneralName({certsubj: certPEM});</pre>



Expand Down
62 changes: 62 additions & 0 deletions api/symbols/X509.html
Original file line number Diff line number Diff line change
Expand Up @@ -562,6 +562,17 @@ <h1 class="classTitle">
</td>
</tr>

<tr>
<td class="attributes">&lt;static&gt; &nbsp;</td>
<td class="nameDescription">
<div class="fixedFont">X509.<b><a href="../symbols/X509.html#.getPublicKeyInfoPosOfCertHEX">getPublicKeyInfoPosOfCertHEX</a></b>(hCert)
</div>
<div class="description">get position of subjectPublicKeyInfo field from HEX certificate
get position for SubjectPublicKeyInfo field in the hexadecimal string of
certificate.</div>
</td>
</tr>

<tr>
<td class="attributes">&lt;static&gt; &nbsp;</td>
<td class="nameDescription">
Expand Down Expand Up @@ -909,6 +920,57 @@ <h1 class="classTitle">



<hr />

<a name=".getPublicKeyInfoPosOfCertHEX"> </a>
<div class="fixedFont">&lt;static&gt;

<span class="light">{Integer}</span>
<span class="light">X509.</span><b>getPublicKeyInfoPosOfCertHEX</b>(hCert)

</div>
<div class="description">
get position of subjectPublicKeyInfo field from HEX certificate
get position for SubjectPublicKeyInfo field in the hexadecimal string of
certificate.


</div>




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

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

</dt>
<dd>hexadecimal string of certificate</dd>

</dl>



<dl class="detailList">
<dt class="heading">Since:</dt>
<dd>x509 1.1.4</dd>
</dl>
</dl>



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

<dd><span class="light fixedFont">{Integer}</span> position in hexadecimal string</dd>

</dl>




<hr />

<a name=".getPublicKeyInfoPropOfCertPEM"> </a>
Expand Down
1,021 changes: 536 additions & 485 deletions api/symbols/src/asn1x509-1.0.js.html

Large diffs are not rendered by default.

61 changes: 46 additions & 15 deletions api/symbols/src/x509-1.1.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
.STRN {color: #393;}
.REGX {color: #339;}
.line {border-right: 1px dotted #666; color: #666; font-style: normal;}
</style></head><body><pre><span class='line'> 1</span> <span class="COMM">/*! x509-1.1.3.js (c) 2012-2014 Kenji Urushima | kjur.github.com/jsrsasign/license
</style></head><body><pre><span class='line'> 1</span> <span class="COMM">/*! x509-1.1.4.js (c) 2012-2014 Kenji Urushima | kjur.github.com/jsrsasign/license
<span class='line'> 2</span> */</span><span class="WHIT">
<span class='line'> 3</span> </span><span class="COMM">/*
<span class='line'> 4</span> * x509.js - X509 class to read subject public key from certificate.
<span class='line'> 5</span> *
<span class='line'> 6</span> * Copyright (c) 2010-2014 Kenji Urushima ([email protected])
<span class='line'> 6</span> * Copyright (c) 2010-2015 Kenji Urushima ([email protected])
<span class='line'> 7</span> *
<span class='line'> 8</span> * This software is licensed under the terms of the MIT License.
<span class='line'> 9</span> * http://kjur.github.com/jsrsasign/license
Expand All @@ -23,7 +23,7 @@
<span class='line'> 16</span> * @fileOverview
<span class='line'> 17</span> * @name x509-1.1.js
<span class='line'> 18</span> * @author Kenji Urushima [email protected]
<span class='line'> 19</span> * @version x509 1.1.3 (2014-May-17)
<span class='line'> 19</span> * @version x509 1.1.4 (2015-May-14)
<span class='line'> 20</span> * @since jsrsasign 1.x.x
<span class='line'> 21</span> * @license &lt;a href="http://kjur.github.io/jsrsasign/license/">MIT License&lt;/a>
<span class='line'> 22</span> */</span><span class="WHIT">
Expand Down Expand Up @@ -365,15 +365,46 @@
<span class='line'>358</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">result</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>359</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>360</span>
<span class='line'>361</span> </span><span class="COMM">/*
<span class='line'>362</span> X509.prototype.readCertPEM = _x509_readCertPEM;
<span class='line'>363</span> X509.prototype.readCertPEMWithoutRSAInit = _x509_readCertPEMWithoutRSAInit;
<span class='line'>364</span> X509.prototype.getSerialNumberHex = _x509_getSerialNumberHex;
<span class='line'>365</span> X509.prototype.getIssuerHex = _x509_getIssuerHex;
<span class='line'>366</span> X509.prototype.getSubjectHex = _x509_getSubjectHex;
<span class='line'>367</span> X509.prototype.getIssuerString = _x509_getIssuerString;
<span class='line'>368</span> X509.prototype.getSubjectString = _x509_getSubjectString;
<span class='line'>369</span> X509.prototype.getNotBefore = _x509_getNotBefore;
<span class='line'>370</span> X509.prototype.getNotAfter = _x509_getNotAfter;
<span class='line'>371</span> */</span><span class="WHIT">
<span class='line'>372</span> </span></pre></body></html>
<span class='line'>361</span> </span><span class="COMM">/**
<span class='line'>362</span> * get position of subjectPublicKeyInfo field from HEX certificate
<span class='line'>363</span> * @name getPublicKeyInfoPosOfCertHEX
<span class='line'>364</span> * @memberOf X509
<span class='line'>365</span> * @function
<span class='line'>366</span> * @param {String} hCert hexadecimal string of certificate
<span class='line'>367</span> * @return {Integer} position in hexadecimal string
<span class='line'>368</span> * @since x509 1.1.4
<span class='line'>369</span> * @description
<span class='line'>370</span> * get position for SubjectPublicKeyInfo field in the hexadecimal string of
<span class='line'>371</span> * certificate.
<span class='line'>372</span> */</span><span class="WHIT">
<span class='line'>373</span> </span><span class="NAME">X509.getPublicKeyInfoPosOfCertHEX</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">hCert</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>374</span> </span><span class="WHIT"> </span><span class="COMM">// 1. Certificate ASN.1</span><span class="WHIT">
<span class='line'>375</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">a1</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">ASN1HEX.getPosArrayOfChildren_AtObj</span><span class="PUNC">(</span><span class="NAME">hCert</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>376</span> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">a1.length</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="NUMB">3</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>377</span> </span><span class="WHIT"> </span><span class="KEYW">throw</span><span class="WHIT"> </span><span class="STRN">"malformed X.509 certificate PEM (code:001)"</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="COMM">// not 3 item of seq Cert</span><span class="WHIT">
<span class='line'>378</span>
<span class='line'>379</span> </span><span class="WHIT"> </span><span class="COMM">// 2. tbsCertificate</span><span class="WHIT">
<span class='line'>380</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">hCert.substr</span><span class="PUNC">(</span><span class="NAME">a1</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">2</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="STRN">"30"</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>381</span> </span><span class="WHIT"> </span><span class="KEYW">throw</span><span class="WHIT"> </span><span class="STRN">"malformed X.509 certificate PEM (code:002)"</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="COMM">// tbsCert not seq </span><span class="WHIT">
<span class='line'>382</span>
<span class='line'>383</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">a2</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">ASN1HEX.getPosArrayOfChildren_AtObj</span><span class="PUNC">(</span><span class="NAME">hCert</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">a1</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>384</span>
<span class='line'>385</span> </span><span class="COMM">// 3. subjectPublicKeyInfo</span><span class="WHIT">
<span class='line'>386</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">a2.length</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NUMB">7</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>387</span> </span><span class="WHIT"> </span><span class="KEYW">throw</span><span class="WHIT"> </span><span class="STRN">"malformed X.509 certificate PEM (code:003)"</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="COMM">// no subjPubKeyInfo</span><span class="WHIT">
<span class='line'>388</span> </span><span class="WHIT">
<span class='line'>389</span> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">a2</span><span class="PUNC">[</span><span class="NUMB">6</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>390</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>391</span>
<span class='line'>392</span> </span><span class="COMM">/*
<span class='line'>393</span> X509.prototype.readCertPEM = _x509_readCertPEM;
<span class='line'>394</span> X509.prototype.readCertPEMWithoutRSAInit = _x509_readCertPEMWithoutRSAInit;
<span class='line'>395</span> X509.prototype.getSerialNumberHex = _x509_getSerialNumberHex;
<span class='line'>396</span> X509.prototype.getIssuerHex = _x509_getIssuerHex;
<span class='line'>397</span> X509.prototype.getSubjectHex = _x509_getSubjectHex;
<span class='line'>398</span> X509.prototype.getIssuerString = _x509_getIssuerString;
<span class='line'>399</span> X509.prototype.getSubjectString = _x509_getSubjectString;
<span class='line'>400</span> X509.prototype.getNotBefore = _x509_getNotBefore;
<span class='line'>401</span> X509.prototype.getNotAfter = _x509_getNotAfter;
<span class='line'>402</span> */</span><span class="WHIT">
<span class='line'>403</span> </span></pre></body></html>
73 changes: 62 additions & 11 deletions asn1x509-1.0.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! asn1x509-1.0.9.js (c) 2013-2014 Kenji Urushima | kjur.github.com/jsrsasign/license
/*! asn1x509-1.0.10.js (c) 2013-2014 Kenji Urushima | kjur.github.com/jsrsasign/license
*/
/*
* asn1x509.js - ASN.1 DER encoder classes for X.509 certificate
Expand All @@ -16,7 +16,7 @@
* @fileOverview
* @name asn1x509-1.0.js
* @author Kenji Urushima [email protected]
* @version 1.0.9 (2014-May-17)
* @version 1.0.10 (2014-Jun-09)
* @since jsrsasign 2.1
* @license <a href="http://kjur.github.io/jsrsasign/license/">MIT License</a>
*/
Expand Down Expand Up @@ -1525,12 +1525,14 @@ YAHOO.lang.extend(KJUR.asn1.x509.AlgorithmIdentifier, KJUR.asn1.ASN1Object);
* <li>rfc822 - rfc822Name[1] (ex. [email protected])</li>
* <li>dns - dNSName[2] (ex. foo.com)</li>
* <li>uri - uniformResourceIdentifier[6] (ex. http://foo.com/)</li>
* <li>certissuer - directoryName[4] (PEM or hex string of cert)</li>
* <li>certsubj - directoryName[4] (PEM or hex string of cert)</li>
* </ul>
* NOTE: Currently this only supports 'uniformResourceIdentifier'.
* <h4>EXAMPLE AND ASN.1 SYNTAX</h4>
* @example
* var gn = new KJUR.asn1.x509.GeneralName({'uri': 'http://aaa.com/'});
* NOTE1: certissuer and certsubj is supported since asn1x509 1.0.10.
*
* Here is definition of the ASN.1 syntax:
* <pre>
* -- NOTE: under the CHOICE, it will always be explicit.
* GeneralName ::= CHOICE {
* otherName [0] OtherName,
* rfc822Name [1] IA5String,
Expand All @@ -1541,33 +1543,82 @@ YAHOO.lang.extend(KJUR.asn1.x509.AlgorithmIdentifier, KJUR.asn1.ASN1Object);
* uniformResourceIdentifier [6] IA5String,
* iPAddress [7] OCTET STRING,
* registeredID [8] OBJECT IDENTIFIER }
* </pre>
*
*
*
* @example
* gn = new KJUR.asn1.x509.GeneralName({rfc822: '[email protected]'});
* gn = new KJUR.asn1.x509.GeneralName({dns: 'aaa.com'});
* gn = new KJUR.asn1.x509.GeneralName({uri: 'http://aaa.com/'});
* gn = new KJUR.asn1.x509.GeneralName({certissuer: certPEM});
* gn = new KJUR.asn1.x509.GeneralName({certsubj: certPEM});
*/
KJUR.asn1.x509.GeneralName = function(params) {
KJUR.asn1.x509.GeneralName.superclass.constructor.call(this);
var asn1Obj = null;
var type = null;
var pTag = {'rfc822': '81', 'dns': '82', 'uri': '86'};
var pTag = {rfc822: '81', dns: '82', dn: 'a4', uri: '86'};
this.explicit = false;

this.setByParam = function(params) {
var str = null;
var v = null;

if (typeof params['rfc822'] != "undefined") {
if (typeof params == "undefined") return;

if (typeof params.rfc822 != "undefined") {
this.type = 'rfc822';
v = new KJUR.asn1.DERIA5String({'str': params[this.type]});
}
if (typeof params['dns'] != "undefined") {
if (typeof params.dns != "undefined") {
this.type = 'dns';
v = new KJUR.asn1.DERIA5String({'str': params[this.type]});
}
if (typeof params['uri'] != "undefined") {
if (typeof params.uri != "undefined") {
this.type = 'uri';
v = new KJUR.asn1.DERIA5String({'str': params[this.type]});
}
if (typeof params.certissuer != "undefined") {
this.type = 'dn';
this.explicit = true;
var certStr = params.certissuer;
var certHex = null;
if (certStr.match(/^[0-9A-Fa-f]+$/)) {
certHex == certStr;
}
if (certStr.indexOf("-----BEGIN ") != -1) {
certHex = X509.pemToHex(certStr);
}
if (certHex == null) throw "certissuer param not cert";
var x = new X509();
x.hex = certHex;
var dnHex = x.getIssuerHex();
v = new KJUR.asn1.ASN1Object();
v.hTLV = dnHex;
}
if (typeof params.certsubj != "undefined") {
this.type = 'dn';
this.explicit = true;
var certStr = params.certsubj;
var certHex = null;
if (certStr.match(/^[0-9A-Fa-f]+$/)) {
certHex == certStr;
}
if (certStr.indexOf("-----BEGIN ") != -1) {
certHex = X509.pemToHex(certStr);
}
if (certHex == null) throw "certsubj param not cert";
var x = new X509();
x.hex = certHex;
var dnHex = x.getSubjectHex();
v = new KJUR.asn1.ASN1Object();
v.hTLV = dnHex;
}

if (this.type == null)
throw "unsupported type in params=" + params;
this.asn1Obj = new KJUR.asn1.DERTaggedObject({'explicit': false,
this.asn1Obj = new KJUR.asn1.DERTaggedObject({'explicit': this.explicit,
'tag': pTag[this.type],
'obj': v});
};
Expand Down
4 changes: 2 additions & 2 deletions asn1x509-1.0.min.js

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ <h3>FEATURES</h3>

<h3>NEWS</h3>
<dl>
<dt><b>2015-May-14</b>:
<dd>Release 4.7.1 is now available. This is a small update. Please see ChangeLog.

<dt><b>2014-Jun-08</b>:
<dd><a href="https://github.com/kjur/jsrsasign/archive/4.7.0.tar.gz">Release 4.7.0</a> is now available.
<ul>
Expand Down
Loading

0 comments on commit cc1a86d

Please sign in to comment.