/*! asn1hex-1.1.js (c) 2012 Kenji Urushima | kjur.github.com/jsrsasign/license
 */
function _asnhex_getByteLengthOfL_AtObj(b,c){if(b.substring(c+2,c+3)!="8"){return 1}var a=parseInt(b.substring(c+3,c+4));if(a==0){return -1}if(0<a&&a<10){return a+1}return -2}function _asnhex_getHexOfL_AtObj(b,c){var a=_asnhex_getByteLengthOfL_AtObj(b,c);if(a<1){return""}return b.substring(c+2,c+2+a*2)}function _asnhex_getIntOfL_AtObj(c,d){var b=_asnhex_getHexOfL_AtObj(c,d);if(b==""){return -1}var a;if(parseInt(b.substring(0,1))<8){a=parseBigInt(b,16)}else{a=parseBigInt(b.substring(2),16)}return a.intValue()}function _asnhex_getStartPosOfV_AtObj(b,c){var a=_asnhex_getByteLengthOfL_AtObj(b,c);if(a<0){return a}return c+(a+1)*2}function _asnhex_getHexOfV_AtObj(c,d){var b=_asnhex_getStartPosOfV_AtObj(c,d);var a=_asnhex_getIntOfL_AtObj(c,d);return c.substring(b,b+a*2)}function _asnhex_getHexOfTLV_AtObj(c,e){var b=c.substr(e,2);var d=_asnhex_getHexOfL_AtObj(c,e);var a=_asnhex_getHexOfV_AtObj(c,e);return b+d+a}function _asnhex_getPosOfNextSibling_AtObj(c,d){var b=_asnhex_getStartPosOfV_AtObj(c,d);var a=_asnhex_getIntOfL_AtObj(c,d);return b+a*2}function _asnhex_getPosArrayOfChildren_AtObj(f,j){var c=new Array();var i=_asnhex_getStartPosOfV_AtObj(f,j);c.push(i);var b=_asnhex_getIntOfL_AtObj(f,j);var g=i;var d=0;while(1){var e=_asnhex_getPosOfNextSibling_AtObj(f,g);if(e==null||(e-i>=(b*2))){break}if(d>=200){break}c.push(e);g=e;d++}return c}function _asnhex_getNthChildIndex_AtObj(d,b,e){var c=_asnhex_getPosArrayOfChildren_AtObj(d,b);return c[e]}function _asnhex_getDecendantIndexByNthList(e,d,c){if(c.length==0){return d}var f=c.shift();var b=_asnhex_getPosArrayOfChildren_AtObj(e,d);return _asnhex_getDecendantIndexByNthList(e,b[f],c)}function _asnhex_getDecendantHexTLVByNthList(d,c,b){var a=_asnhex_getDecendantIndexByNthList(d,c,b);return _asnhex_getHexOfTLV_AtObj(d,a)}function _asnhex_getDecendantHexVByNthList(d,c,b){var a=_asnhex_getDecendantIndexByNthList(d,c,b);return _asnhex_getHexOfV_AtObj(d,a)}function ASN1HEX(){return ASN1HEX}ASN1HEX.getByteLengthOfL_AtObj=_asnhex_getByteLengthOfL_AtObj;ASN1HEX.getHexOfL_AtObj=_asnhex_getHexOfL_AtObj;ASN1HEX.getIntOfL_AtObj=_asnhex_getIntOfL_AtObj;ASN1HEX.getStartPosOfV_AtObj=_asnhex_getStartPosOfV_AtObj;ASN1HEX.getHexOfV_AtObj=_asnhex_getHexOfV_AtObj;ASN1HEX.getHexOfTLV_AtObj=_asnhex_getHexOfTLV_AtObj;ASN1HEX.getPosOfNextSibling_AtObj=_asnhex_getPosOfNextSibling_AtObj;ASN1HEX.getPosArrayOfChildren_AtObj=_asnhex_getPosArrayOfChildren_AtObj;ASN1HEX.getNthChildIndex_AtObj=_asnhex_getNthChildIndex_AtObj;ASN1HEX.getDecendantIndexByNthList=_asnhex_getDecendantIndexByNthList;ASN1HEX.getDecendantHexVByNthList=_asnhex_getDecendantHexVByNthList;ASN1HEX.getDecendantHexTLVByNthList=_asnhex_getDecendantHexTLVByNthList;