diff --git a/ChangeLog.txt b/ChangeLog.txt index da39556b..1075ff0d 100755 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -2,6 +2,8 @@ ChangeLog for jsrsasign * Changes from 6.2.3 to next version + - asn1hex 1.1.7 to 1.1.8 + - ASN1HEX.dump also supports ASN1Object as argument - asn1x509 - API document update diff --git a/asn1hex-1.1.js b/asn1hex-1.1.js index 20d0697f..f0360926 100644 --- a/asn1hex-1.1.js +++ b/asn1hex-1.1.js @@ -1,4 +1,4 @@ -/*! asn1hex-1.1.7.js (c) 2012-2016 Kenji Urushima | kjur.github.com/jsrsasign/license +/*! asn1hex-1.1.8.js (c) 2012-2016 Kenji Urushima | kjur.github.com/jsrsasign/license */ /* * asn1hex.js - Hexadecimal represented ASN.1 string library @@ -16,7 +16,7 @@ * @fileOverview * @name asn1hex-1.1.js * @author Kenji Urushima kenji.urushima@gmail.com - * @version asn1hex 1.1.7 (2016-Oct-02) + * @version asn1hex 1.1.8 (2016-Dec-03) * @license MIT License */ @@ -405,14 +405,14 @@ ASN1HEX.hextooidstr = function(hex) { }; /** - * get string of simple ASN.1 dump from hexadecimal ASN.1 data + * get string of simple ASN.1 dump from hexadecimal ASN.1 data
* @name dump * @memberOf ASN1HEX * @function - * @param {String} hex hexadecmal string of ASN.1 data - * @param {Array} associative array of flags for dump (OPTION) + * @param {Object} hexOrObj hexadecmal string of ASN.1 data or ASN1Object object + * @param {Array} flags associative array of flags for dump (OPTION) * @param {Number} idx string index for starting dump (OPTION) - * @param {String} indent string (OPTION) + * @param {String} indent indent string (OPTION) * @return {String} string of simple ASN.1 dump * @since jsrsasign 4.8.3 asn1hex 1.1.6 * @description @@ -433,25 +433,34 @@ ASN1HEX.hextooidstr = function(hex) { * * * + * NOTE1: Argument {@link KJUR.asn1.ASN1Object} object is supported since + * jsrsasign 6.2.4 asn1hex 1.0.8 * @example - * // ASN.1 INTEGER + * // 1) ASN.1 INTEGER * ASN1HEX.dump('0203012345') * ↓ * INTEGER 012345 * - * // ASN.1 Object Identifier + * // 2) ASN.1 Object Identifier * ASN1HEX.dump('06052b0e03021a') * ↓ * ObjectIdentifier sha1 (1 3 14 3 2 26) * - * // ASN.1 SEQUENCE + * // 3) ASN.1 SEQUENCE * ASN1HEX.dump('3006020101020102') * ↓ * SEQUENCE * INTEGER 01 * INTEGER 02 * - * // ASN.1 DUMP FOR X.509 CERTIFICATE + * // 4) ASN.1 SEQUENCE since jsrsasign 6.2.4 + * o = KJUR.asn1.ASN1Util.newObject({seq: [{int: 1}, {int: 2}]}); + * ASN1HEX.dump(o) + * ↓ + * SEQUENCE + * INTEGER 01 + * INTEGER 02 + * // 5) ASN.1 DUMP FOR X.509 CERTIFICATE * ASN1HEX.dump(X509.pemToHex(certPEM)) * ↓ * SEQUENCE @@ -469,7 +478,11 @@ ASN1HEX.hextooidstr = function(hex) { * PrintableString 'US' * : */ -ASN1HEX.dump = function(hex, flags, idx, indent) { +ASN1HEX.dump = function(hexOrObj, flags, idx, indent) { + var hex = hexOrObj; + if (hexOrObj instanceof KJUR.asn1.ASN1Object) + hex = hexOrObj.getEncodedHex(); + var _skipLongHex = function(hex, limitNumOctet) { if (hex.length <= limitNumOctet * 2) { return hex; @@ -603,7 +616,8 @@ ASN1HEX.dump = function(hex, flags, idx, indent) { return s; } } - return indent + "UNKNOWN(" + hex.substr(idx, 2) + ") " + ASN1HEX.getHexOfV_AtObj(hex, idx) + "\n"; + return indent + "UNKNOWN(" + hex.substr(idx, 2) + ") " + + ASN1HEX.getHexOfV_AtObj(hex, idx) + "\n"; }; /** diff --git a/index.html b/index.html index 298407c1..a9f61226 100755 --- a/index.html +++ b/index.html @@ -44,6 +44,13 @@

opensource free pure JavaScript cryptographic library s
+
+ + + + +
+

FEATURES

The 'jsrsasign' library provides following features in pure JavaScript.