Comparing version 1.3.0 to 1.3.1
@@ -1,2 +0,2 @@ | ||
var asn1=function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=6)}([function(t,e,n){"use strict";n.d(e,"c",function(){return r}),n.d(e,"d",function(){return i}),n.d(e,"g",function(){return o}),n.d(e,"i",function(){return s}),n.d(e,"e",function(){return u}),n.d(e,"h",function(){return a}),n.d(e,"f",function(){return c}),n.d(e,"j",function(){return h}),n.d(e,"a",function(){return f}),n.d(e,"b",function(){return l});class r extends Error{constructor(t){super(t),Object.setPrototypeOf(this,r.prototype)}}class i extends r{constructor(){super("Not yet implemented."),Object.setPrototypeOf(this,r.prototype)}}class o extends r{constructor(){super("Recursion was too deep."),Object.setPrototypeOf(this,r.prototype)}}class s extends r{constructor(t){super(t),Object.setPrototypeOf(this,r.prototype)}}class u extends r{constructor(t){super(t),Object.setPrototypeOf(this,r.prototype)}}class a extends r{constructor(t){super(t),Object.setPrototypeOf(this,r.prototype)}}class c extends r{constructor(t){super(t),Object.setPrototypeOf(this,r.prototype)}}class h extends r{constructor(t){super(t),Object.setPrototypeOf(this,r.prototype)}}class f extends r{constructor(t){super(t),Object.setPrototypeOf(this,r.prototype)}}class l extends r{constructor(t){super(t),Object.setPrototypeOf(this,r.prototype)}}},function(t,e,n){"use strict";n.d(e,"i",function(){return r}),n.d(e,"k",function(){return i}),n.d(e,"h",function(){return o}),n.d(e,"j",function(){return s}),n.d(e,"e",function(){return u}),n.d(e,"a",function(){return a}),n.d(e,"g",function(){return c}),n.d(e,"d",function(){return h}),n.d(e,"b",function(){return f}),n.d(e,"c",function(){return l}),n.d(e,"f",function(){return d}),n.d(e,"t",function(){return g}),n.d(e,"u",function(){return p}),n.d(e,"o",function(){return w}),n.d(e,"p",function(){return v}),n.d(e,"m",function(){return y}),n.d(e,"q",function(){return b}),n.d(e,"r",function(){return m}),n.d(e,"s",function(){return E}),n.d(e,"l",function(){return S}),n.d(e,"n",function(){return T});const r=4294967295,i=0,o=2147483647,s=-2147483648;var u,a,c,h,f,l,d;!function(t){t[t.universal=0]="universal",t[t.application=1]="application",t[t.context=3]="context",t[t.private=4]="private"}(u||(u={})),function(t){t[t.primitive=0]="primitive",t[t.constructed=1]="constructed"}(a||(a={})),function(t){t[t.definite=0]="definite",t[t.indefinite=1]="indefinite"}(c||(c={})),function(t){t[t.plusInfinity=64]="plusInfinity",t[t.minusInfinity=65]="minusInfinity",t[t.notANumber=66]="notANumber",t[t.minusZero=67]="minusZero"}(h||(h={})),function(t){t[t.base2=0]="base2",t[t.base8=16]="base8",t[t.base16=32]="base16"}(f||(f={})),function(t){t[t.scale0=0]="scale0",t[t.scale1=4]="scale1",t[t.scale2=8]="scale2",t[t.scale3=12]="scale3"}(l||(l={})),function(t){t[t.endOfContent=0]="endOfContent",t[t.boolean=1]="boolean",t[t.integer=2]="integer",t[t.bitString=3]="bitString",t[t.octetString=4]="octetString",t[t.nill=5]="nill",t[t.objectIdentifier=6]="objectIdentifier",t[t.objectDescriptor=7]="objectDescriptor",t[t.external=8]="external",t[t.realNumber=9]="realNumber",t[t.enumerated=10]="enumerated",t[t.embeddedPDV=11]="embeddedPDV",t[t.utf8String=12]="utf8String",t[t.relativeOID=13]="relativeOID",t[t.reserved14=14]="reserved14",t[t.reserved15=15]="reserved15",t[t.sequence=16]="sequence",t[t.set=17]="set",t[t.numericString=18]="numericString",t[t.printableString=19]="printableString",t[t.teletexString=20]="teletexString",t[t.videotexString=21]="videotexString",t[t.ia5String=22]="ia5String",t[t.utcTime=23]="utcTime",t[t.generalizedTime=24]="generalizedTime",t[t.graphicString=25]="graphicString",t[t.visibleString=26]="visibleString",t[t.generalString=27]="generalString",t[t.universalString=28]="universalString",t[t.characterString=29]="characterString",t[t.bmpString=30]="bmpString"}(d||(d={}));const g="etaoinsrhdlucmfywgpbvkxqjzETAOINSRHDLUCMFYWGPBVKXQJZ0123456789 '()+,-./:=?",p=/^(?<year>\d{2})(?<month>(?:1[0-2])|(?:0\d))(?<date>(?:3[01])|(?:[0-2]\d))(?<hour>(?:2[0-3])|(?:[01]\d))(?<minute>[0-5]\d)(?<second>[0-5]\d)?(?<offset>(?:(\+|\-)((?:2[0-3])|(?:[01]\d))[0-5]\d)|Z)$/,w=/^(?<year>\d{2})(?<month>(?:1[0-2])|(?:0\d))(?<date>(?:3[01])|(?:[0-2]\d))(?<hour>(?:2[0-3])|(?:[01]\d))(?<minute>[0-5]\d)(?<second>[0-5]\d)?Z$/,v=/^(?<year>\d{4})(?<month>(?:1[0-2])|(?:0\d))(?<date>(?:3[01])|(?:[0-2]\d))(?<hour>(?:2[0-3])|(?:[01]\d))(?<minute>[0-5]\d)?(?<second>[0-5]\d)?(?:(\.|,)(?<fraction>\d+))?(?<offset>(?:(\+|\-)((?:2[0-3])|(?:[01]\d))[0-5]\d)|Z)?$/,y=/^(?<year>\d{4})(?<month>(?:1[0-2])|(?:0\d))(?<date>(?:3[01])|(?:[0-2]\d))(?<hour>(?:2[0-3])|(?:[01]\d))(?<minute>[0-5]\d)(?<second>[0-5]\d)(?:(\.|,)(?<fraction>\d*[1-9]))?Z$/,b=/^\ *(\+|\-)?\d+$/,m=/^\ *(\+|\-)?(?:\d+(\.|,)\d*)|(?:\d*(\.|,)\d+)$/,E=/^\ *(\+|\-)?(?:\d+(\.|,)\d*)|(?:\d*(\.|,)\d+)(e|E)(\+|\-)?\d+$/,S=/^\ *\-?(?:[1-9]\d*)?[1-9]\.E(?:\+0)|(?:\-?[1-9]\d*)$/,T=/^\ *\-?(?:[1-9]\d*)?[1-9]\.E(?:\+0)|(?:\-?[1-9]\d*)$/},function(t,e,n){"use strict";n.d(e,"a",function(){return i});var r=n(0);class i{constructor(){this.recursionCount=0,this.tagClass=0,this.construction=0,this.tagNumber=0,this.value=new Uint8Array(0)}get length(){return this.value.length}static validateDateTime(t,e,n,i,o,s,u){switch(n){case 0:case 2:case 4:case 6:case 7:case 9:case 11:if(i>31)throw new r.c(`Day > 31 encountered in ${t} with 31-day month.`);break;case 3:case 5:case 8:case 10:if(i>30)throw new r.c(`Day > 31 encountered in ${t} with 30-day month.`);break;case 1:if(e%4==0&&e%100!=0||e%400==0){if(i>29)throw new r.c(`Day > 29 encountered in ${t} with month of February in leap year.`)}else if(i>28)throw new r.c(`Day > 28 encountered in ${t} with month of February and non leap year.`);break;default:throw new r.c(`Month greater than 12 encountered in ${t}.`)}if(o>23)throw new r.c(`Hours > 23 encountered in ${t}.`);if(s>59)throw new r.c(`Minutes > 60 encountered in ${t}.`);if(u>59)throw new r.c(`Seconds > 60 encountered in ${t}.`)}static decodeUnsignedBigEndianInteger(t){if(0===t.length)return 0;if(t.length>4)throw new r.e("Number too long to decode.");const e=new Uint8Array(4);return e.set(t,4-t.length),new Uint32Array(e.reverse().buffer)[0]}static decodeSignedBigEndianInteger(t){if(0===t.length)return 0;if(t.length>4)throw new r.e("Number too long to decode.");const e=new Uint8Array(4);return t[0]>=128&&e.fill(255),e.set(t,4-t.length),new Int32Array(e.reverse().buffer)[0]}}i.nestingRecursionLimit=5},function(t,e,n){"use strict";n.d(e,"a",function(){return r});class r{constructor(t){if(t.length<2)throw new Error("Cannot construct an OID with less than two nodes!");if(t.length>=1&&!(t[0]in[0,1,2]))throw new Error("OIDs first node must be 0, 1, or 2!");if(t[0]<2&&t[1]>39||2===t[0]&&t[1]>175)throw new Error(`OID Node #2 cannot exceed 39 if node #1 is 0 or 1, and 175 if node #1 is 2. Received these nodes: ${t}.`);t.forEach(t=>{if(t<0)throw new Error("OID node numbers cannot be negative!");if(t>Number.MAX_SAFE_INTEGER)throw new Error("OID number was too big!")}),this._nodes=t.slice(0)}get nodes(){return this._nodes.slice(0)}get dotDelimitedNotation(){return this._nodes.join(".")}toString(){return this.dotDelimitedNotation}}},function(t,e,n){"use strict";(function(t){n.d(e,"a",function(){return u});var r=n(2),i=n(0),o=n(1),s=n(5);class u extends s.a{constructor(t=0,e=0,n=0){super(),this.tagClass=t,this.construction=e,this.tagNumber=n,this.value=new Uint8Array(0)}set boolean(t){this.value=new Uint8Array(1),this.value[0]=t?255:0}get boolean(){if(0!==this.construction)throw new i.b("BOOLEAN cannot be constructed.");if(1!==this.value.length)throw new i.h("BOOLEAN not one byte");return 0!==this.value[0]}set bitString(t){0===t.length&&(this.value=new Uint8Array(0));let e=[];e.length=(t.length>>>3)+(t.length%8?1:0)+1;for(let n=0;n<t.length;n++)!1!==t[n]&&(e[1+(n>>>3)]|=128>>>n%8);e[0]=8-t.length%8,8===e[0]&&(e[0]=0),this.value=new Uint8Array(e)}get bitString(){if(0===this.construction){if(0===this.value.length)throw new i.c("ASN.1 BIT STRING cannot be encoded on zero bytes!");if(1===this.value.length&&0!==this.value[0])throw new i.c("ASN.1 BIT STRING encoded with deceptive first byte!");if(this.value[0]>7)throw new i.c("First byte of an ASN.1 BIT STRING must be <= 7!");let t=[];for(let e=1;e<this.value.length;e++)t=t.concat([!!(128&this.value[e]),!!(64&this.value[e]),!!(32&this.value[e]),!!(16&this.value[e]),!!(8&this.value[e]),!!(4&this.value[e]),!!(2&this.value[e]),!!(1&this.value[e])]);return t.length-=this.value[0],t}{if(this.recursionCount+1>u.nestingRecursionLimit)throw new i.g;let t=[];const e=this.sequence;return e.slice(0,e.length-1).forEach(t=>{if(0===t.construction&&t.value.length>0&&0!==t.value[0])throw new i.c("Only the last subelement of a constructed BIT STRING may have a non-zero first value byte.")}),e.forEach(e=>{if(e.tagClass!==this.tagClass)throw new i.b("Invalid tag class in recursively-encoded BIT STRING.");if(e.tagNumber!==this.tagNumber)throw new i.b("Invalid tag class in recursively-encoded BIT STRING.");e.recursionCount=this.recursionCount+1,t=t.concat(e.bitString)}),t}}set octetString(t){this.value=t.subarray(0)}get octetString(){return this.deconstruct("OCTET STRING")}set objectDescriptor(t){this.graphicString=t}get objectDescriptor(){return this.graphicString}set real(t){if(0===t)return void(this.value=new Uint8Array(0));if(isNaN(t))return void(this.value=new Uint8Array([66]));if(-0===t)return void(this.value=new Uint8Array([67]));if(t===1/0)return void(this.value=new Uint8Array([64]));if(t===-1/0)return void(this.value=new Uint8Array([65]));let e=t.toFixed(7);e=String.fromCharCode(3)+e,this.value=(new TextEncoder).encode(e)}get real(){if(0!==this.construction)throw new i.b("REAL cannot be constructed.");if(0===this.value.length)return 0;switch(192&this.value[0]){case 64:if(66===this.value[0])return NaN;if(67===this.value[0])return-0;if(64===this.value[0])return 1/0;if(65===this.value[0])return-1/0;throw new i.j("Unrecognized special REAL value!");case 0:{let e;if("undefined"!=typeof TextEncoder)e=new TextDecoder("utf-8").decode(this.value.slice(1));else{if(void 0===t)throw new i.c("No ability to decode bytes to string!");e=new t(this.value.slice(1)).toString("utf-8")}switch(63&this.value[0]){case 1:if(!o.q.test(e))throw new i.c("Malformed NR1 Base-10 REAL");return parseFloat(e);case 2:if(!o.r.test(e))throw new i.c("Malformed NR2 Base-10 REAL");return parseFloat(e.replace(",","."));case 3:if(!o.s.test(e))throw new i.c("Malformed NR3 Base-10 REAL");return parseFloat(e.replace(",","."));default:throw new i.j("Undefined Base-10 REAL encoding.")}}case 128:case 192:{const t=64&this.value[0]?-1:1,e=(t=>{switch(this.value[0]&48){case 0:return 2;case 16:return 8;case 32:return 16;default:throw new i.c("Impossible REAL encoding base encountered.")}})(),n=(t=>{switch(this.value[0]&12){case 0:return 0;case 4:return 1;case 8:return 2;case 12:return 3;default:throw new i.c("Impossible REAL encoding scale encountered.")}})();let o,s;switch(3&this.value[0]){case 0:if(this.value.length<3)throw new i.i("Binary-encoded REAL truncated.");o=r.a.decodeSignedBigEndianInteger(this.value.subarray(1,2)),s=r.a.decodeUnsignedBigEndianInteger(this.value.subarray(2));break;case 1:if(this.value.length<4)throw new i.i("Binary-encoded REAL truncated.");o=r.a.decodeSignedBigEndianInteger(this.value.subarray(1,3)),s=r.a.decodeUnsignedBigEndianInteger(this.value.subarray(3));break;case 2:if(this.value.length<5)throw new i.i("Binary-encoded REAL truncated.");o=r.a.decodeSignedBigEndianInteger(this.value.subarray(1,4)),s=r.a.decodeUnsignedBigEndianInteger(this.value.subarray(4));break;case 3:{if(this.value.length<3)throw new i.i("Binary-encoded REAL truncated.");let t=this.value[1];if(this.value.length<3+t)throw new i.i("Binary-encoded REAL truncated.");o=r.a.decodeSignedBigEndianInteger(this.value.subarray(2,2+t)),s=r.a.decodeUnsignedBigEndianInteger(this.value.subarray(2+t));break}default:throw new i.c("Impossible binary REAL exponent encoding encountered.")}return t*s*Math.pow(2,n)*Math.pow(e,o)}default:throw new i.c("Impossible REAL format encountered.")}}set utf8String(e){"undefined"!=typeof TextEncoder?this.value=(new TextEncoder).encode(e):void 0!==t&&(this.value=t.from(e,"utf-8"))}get utf8String(){const e=this.deconstruct("UTF8String");let n="";return"undefined"!=typeof TextEncoder?n=new TextDecoder("utf-8").decode(e.buffer):void 0!==t&&(n=new t(this.value).toString("utf-8")),n}set sequence(t){let e=[];t.forEach(t=>{e.push(t.toBytes())});let n=0;e.forEach(t=>{n+=t.length});const r=new Uint8Array(n);let i=0;e.forEach(t=>{r.set(t,i),i+=t.length}),this.value=r,this.construction=1}get sequence(){if(1!==this.construction)throw new i.b("SET or SEQUENCE cannot be primitively constructed.");let t=[];if(0===this.value.length)return[];let e=0;for(;e<this.value.length;){const n=new u;e+=n.fromBytes(this.value.slice(e)),t.push(n)}return t}set set(t){this.sequence=t}get set(){return this.sequence}set numericString(e){for(let t=0;t<e.length;t++){const n=e.charCodeAt(t);if(!(n>=48&&n<=57||32===n))throw new i.a("NumericString can only contain characters 0 - 9 and space.")}"undefined"!=typeof TextEncoder?this.value=(new TextEncoder).encode(e):void 0!==t&&(this.value=t.from(e,"utf-8"))}get numericString(){const e=this.deconstruct("NumericString");let n="";"undefined"!=typeof TextEncoder?n=new TextDecoder("utf-8").decode(e.buffer):void 0!==t&&(n=new t(this.value).toString("utf-8"));for(let t=0;t<n.length;t++){const e=n.charCodeAt(t);if(!(e>=48&&e<=57||32===e))throw new i.a("NumericString can only contain characters 0 - 9 and space.")}return n}set printableString(e){for(let t=0;t<e.length;t++)if(-1===o.t.indexOf(e.charAt(t)))throw new i.a(`PrintableString can only contain these characters: ${o.t}`);"undefined"!=typeof TextEncoder?this.value=(new TextEncoder).encode(e):void 0!==t&&(this.value=t.from(e,"utf-8"))}get printableString(){const e=this.deconstruct("PrintableString");let n="";"undefined"!=typeof TextEncoder?n=new TextDecoder("utf-8").decode(e.buffer):void 0!==t&&(n=new t(this.value).toString("utf-8"));for(let t=0;t<n.length;t++)if(-1===o.t.indexOf(n.charAt(t)))throw new i.a(`PrintableString can only contain these characters: ${o.t}`);return n}set teletexString(t){this.value=t.subarray(0)}get teletexString(){return this.deconstruct("TeletexString")}set videotexString(t){this.value=t.subarray(0)}get videotexString(){return this.deconstruct("VideotexString")}set ia5String(e){"undefined"!=typeof TextEncoder?this.value=(new TextEncoder).encode(e):void 0!==t&&(this.value=t.from(e,"utf-8"))}get ia5String(){const e=this.deconstruct("IA5String");let n="";return"undefined"!=typeof TextEncoder?n=new TextDecoder("utf-8").decode(e.buffer):void 0!==t&&(n=new t(this.value).toString("utf-8")),n}set utcTime(e){let n=e.getUTCFullYear().toString();const r=`${n=n.substring(n.length-2,n.length)}${e.getUTCMonth()<9?`0${e.getUTCMonth()+1}`:`${e.getUTCMonth()+1}`}${e.getUTCDate()<10?`0${e.getUTCDate()}`:`${e.getUTCDate()}`}${e.getUTCHours()<10?`0${e.getUTCHours()}`:`${e.getUTCHours()}`}${e.getUTCMinutes()<10?`0${e.getUTCMinutes()}`:`${e.getUTCMinutes()}`}${e.getUTCSeconds()<10?`0${e.getUTCSeconds()}`:`${e.getUTCSeconds()}`}Z`;"undefined"!=typeof TextEncoder?this.value=(new TextEncoder).encode(r):void 0!==t&&(this.value=t.from(r,"utf-8"))}get utcTime(){const e=this.deconstruct("UTCTime");let n="";"undefined"!=typeof TextEncoder?n=new TextDecoder("utf-8").decode(e.buffer):void 0!==t&&(n=new t(this.value).toString("utf-8"));const r=o.u.exec(n);if(null===r)throw new i.c("Malformed UTCTime string.");if(void 0===r.groups)throw new i.c("Malformed UTCTime string.");const s=new Date;let a=Number(r.groups.year);a=a<70?2e3+a:1900+a;const c=Number(r.groups.month)-1,h=Number(r.groups.date),f=Number(r.groups.hour),l=Number(r.groups.minute),d=Number(r.groups.second);return u.validateDateTime("UTCTime",a,c,h,f,l,d),s.setUTCFullYear(a),s.setUTCMonth(c),s.setUTCDate(h),s.setUTCHours(f),s.setUTCMinutes(l),s.setUTCSeconds(d),s}set generalizedTime(e){const n=`${e.getUTCFullYear().toString()}${e.getUTCMonth()<9?`0${e.getUTCMonth()+1}`:`${e.getUTCMonth()+1}`}${e.getUTCDate()<10?`0${e.getUTCDate()}`:`${e.getUTCDate()}`}${e.getUTCHours()<10?`0${e.getUTCHours()}`:`${e.getUTCHours()}`}${e.getUTCMinutes()<10?`0${e.getUTCMinutes()}`:`${e.getUTCMinutes()}`}${e.getUTCSeconds()<10?`0${e.getUTCSeconds()}`:`${e.getUTCSeconds()}`}Z`;"undefined"!=typeof TextEncoder?this.value=(new TextEncoder).encode(n):void 0!==t&&(this.value=t.from(n,"utf-8"))}get generalizedTime(){const e=this.deconstruct("GeneralizedTime");let n="";"undefined"!=typeof TextEncoder?n=new TextDecoder("utf-8").decode(e.buffer):void 0!==t&&(n=new t(this.value).toString("utf-8"));const r=o.p.exec(n);if(null===r)throw new i.c("Malformed GeneralizedTime string.");if(void 0===r.groups)throw new i.c("Malformed GeneralizedTime string.");const s=new Date,a=Number(r.groups.year),c=Number(r.groups.month)-1,h=Number(r.groups.date),f=Number(r.groups.hour),l=Number(r.groups.minute),d=Number(r.groups.second);return u.validateDateTime("GeneralizedTime",a,c,h,f,l,d),s.setUTCFullYear(a),s.setUTCMonth(c),s.setUTCDate(h),s.setUTCHours(f),s.setUTCMinutes(l),s.setUTCSeconds(d),s}set graphicString(e){for(let t=0;t<e.length;t++){const n=e.charCodeAt(t);if(n<32||n>126)throw new i.a("GraphicString, VisibleString, or ObjectDescriptor can only contain characters between 0x20 and 0x7E.")}"undefined"!=typeof TextEncoder?this.value=(new TextEncoder).encode(e):void 0!==t&&(this.value=t.from(e,"utf-8"))}get graphicString(){const e=this.deconstruct("GraphicString, VisibleString, or ObjectDescriptor");let n="";"undefined"!=typeof TextEncoder?n=new TextDecoder("utf-8").decode(e.buffer):void 0!==t&&(n=new t(this.value).toString("utf-8"));for(let t=0;t<n.length;t++){const e=n.charCodeAt(t);if(e<32||e>126)throw new i.a("GraphicString, VisibleString, or ObjectDescriptor can only contain characters between 0x20 and 0x7E.")}return n}set visibleString(t){this.graphicString=t}get visibleString(){return this.graphicString}set generalString(e){for(let t=0;t<e.length;t++)if(e.charCodeAt(t)>127)throw new i.a("GeneralString can only contain ASCII characters.");"undefined"!=typeof TextEncoder?this.value=(new TextEncoder).encode(e):void 0!==t&&(this.value=t.from(e,"ascii"))}get generalString(){const e=this.deconstruct("GeneralString");let n="";"undefined"!=typeof TextEncoder?n=new TextDecoder("windows-1252").decode(e.buffer):void 0!==t&&(n=new t(this.value).toString("ascii"));for(let t=0;t<n.length;t++)if(n.charCodeAt(t)>127)throw new i.a("GeneralString can only contain ASCII characters.");return n}set universalString(t){const e=new Uint8Array(t.length<<2);for(let n=0;n<t.length;n++)e[n<<2]=t.charCodeAt(n)>>>24,e[1+(n<<2)]=t.charCodeAt(n)>>>16,e[2+(n<<2)]=t.charCodeAt(n)>>>8,e[3+(n<<2)]=t.charCodeAt(n);this.value=e}get universalString(){const t=this.deconstruct("UniversalString");if(t.length%4)throw new i.c("UniversalString encoded on non-mulitple of four bytes.");let e="";for(let n=0;n<t.length;n+=4)e+=String.fromCharCode((t[n+0]<<24)+(t[n+1]<<16)+(t[n+2]<<8)+(t[n+3]<<0));return e}set bmpString(t){const e=new Uint8Array(t.length<<1);for(let n=0,r=t.length;n<r;n++)e[n<<1]=t.charCodeAt(n)>>>8,e[1+(n<<1)]=t.charCodeAt(n);this.value=e}get bmpString(){const e=this.deconstruct("BMPString");if(e.length%2)throw new i.c("BMPString encoded on non-mulitple of two bytes.");let n="";if("undefined"!=typeof TextEncoder)n=new TextDecoder("utf-16be").decode(e.buffer);else if(void 0!==t){const r=new Uint8Array(e.length);for(let t=0;t<e.length;t+=2)r[t]=e[t+1],r[t+1]=e[t];n=new t(r).toString("utf-16le")}return n}fromBytes(t){if(t.length<2)throw new i.i("Tried to decode a BER element that is less than two bytes.");if(this.recursionCount+1>u.nestingRecursionLimit)throw new i.g;let e=0;switch(192&t[e]){case 0:this.tagClass=0;break;case 64:this.tagClass=1;break;case 128:this.tagClass=3;break;case 192:this.tagClass=4;break;default:this.tagClass=0}if(this.construction=32&t[e]?1:0,this.tagNumber=31&t[e],e++,this.tagNumber>=31){if(128===t[e])throw new i.f("Leading padding byte on long tag number encoding.");this.tagNumber=0;const n=t.length-1>=4?4:t.length-1;for(;e<n&&128&t[e++];);if(128&t[e-1])throw n===t.length-1?new i.i("ASN.1 tag number appears to have been truncated."):new i.e("ASN.1 tag number too large.");for(let n=1;n<e;n++)this.tagNumber<<=7,this.tagNumber|=127&t[n];if(this.tagNumber<=31)throw new i.c("ASN.1 tag number could have been encoded in short form.")}if(128==(128&t[e])){const n=127&t[e];if(n){if(127===n)throw new i.j("Length byte with undefined meaning encountered.");if(n>4)throw new i.e("Element length too long to decode to an integer.");if(e+n>=t.length)throw new i.i("Element length bytes appear to have been truncated.");e++;const r=new Uint8Array(4);for(let i=n;i>0;i--)r[4-i]=t[e+n-i];let o=0;if(r.forEach(t=>{o<<=8,o+=t}),e+o<e)throw new i.e("ASN.1 element too large.");if((e+=n)+o>t.length)throw new i.i("ASN.1 element truncated.");return this.value=t.slice(e,e+o),e+o}{if(1!==this.construction)throw new i.b("Indefinite length ASN.1 element was not of constructed construction.");const n=++e;let r=e;for(;r<t.length;){const e=new u;if(e.recursionCount=this.recursionCount+1,r+=e.fromBytes(t.slice(r)),0===e.tagClass&&0===e.construction&&0===e.tagNumber&&0===e.value.length)break}if(r===t.length&&(0!==t[r-1]||0!==t[r-2]))throw new i.i("No END OF CONTENT element found at the end of indefinite length ASN.1 element.");return this.value=t.slice(n,r-2),r}}{const n=127&t[e++];if(e+n>t.length)throw new i.i("ASN.1 element was truncated.");return this.value=t.slice(e,e+n),e+n}}toBytes(){let t=[0];if(t[0]|=this.tagClass,t[0]|=this.construction,this.tagNumber<31)t[0]|=this.tagNumber;else{t[0]|=31;let e=this.tagNumber,n=[];for(;0!==e;)n.unshift(127&e),e>>>=7,n[0]|=128;n[n.length-1]&=127,t=t.concat(n)}let e=[0];switch(u.lengthEncodingPreference){case 0:if(this.value.length<127)e=[this.value.length];else{let t=this.value.length;e=[0,0,0,0];for(let n=0;n<4;n++)e[n]=t>>>(3-n<<3)&255;let n=0;for(let t=0;t<e.length-1;t++)0===e[t]&&n++;(e=e.slice(n)).unshift(128|e.length)}break;case 1:e=[128];break;default:throw new i.j("Invalid LengthEncodingPreference encountered!")}const n=new Uint8Array(t.length+e.length+this.value.length+(1===u.lengthEncodingPreference?2:0));return n.set(t,0),n.set(e,t.length),n.set(this.value,t.length+e.length),n}deconstruct(t){if(0===this.construction)return this.value.subarray(0);{if(this.recursionCount+1>u.nestingRecursionLimit)throw new i.g;let e=[];this.sequence.forEach(n=>{if(n.tagClass!==this.tagClass)throw new i.b(`Invalid tag class in recursively-encoded ${t}.`);if(n.tagNumber!==this.tagNumber)throw new i.b(`Invalid tag class in recursively-encoded ${t}.`);n.recursionCount=this.recursionCount+1,e=e.concat(n.deconstruct(t))});let n=0;e.forEach(t=>{n+=t.length});const r=new Uint8Array(n);let o=0;return e.forEach(t=>{r.set(t,o),o+=t.length}),r}}}u.lengthEncodingPreference=0}).call(this,n(8).Buffer)},function(t,e,n){"use strict";n.d(e,"a",function(){return u});var r=n(2),i=n(0),o=n(3),s=n(1);class u extends r.a{validateTag(t,e,n){return t.includes(this.tagClass)?e.includes(this.construction)?n.includes(this.tagNumber)?0:-3:-2:-1}set integer(t){if(t<s.j)throw new i.e(`Number ${t} too small to be converted.`);if(t>s.h)throw new i.e(`Number ${t} too big to be converted.`);return t<=127&&t>=-128?void(this.value=new Uint8Array([255&t])):t<=32767&&t>=-32768?void(this.value=new Uint8Array([t>>8&255,255&t])):t<=8388607&&t>=-8388608?void(this.value=new Uint8Array([t>>16&255,t>>8&255,255&t])):void(this.value=new Uint8Array([t>>24&255,t>>16&255,t>>8&255,255&t]))}get integer(){if(0!==this.construction)throw new i.b("INTEGER cannot be constructed.");if(0===this.value.length)throw new i.h("Number encoded on zero bytes!");if(this.value.length>4)throw new i.e("Number too long to decode.");if(this.value.length>2&&(255===this.value[0]&&this.value[1]>=128||0===this.value[0]&&this.value[1]<128))throw new i.f("Unnecessary padding bytes on INTEGER or ENUMERATED.");return r.a.decodeSignedBigEndianInteger(this.value.subarray(0))}set objectIdentifier(t){const e=t.nodes;let n=[40*e[0]+e[1]],r=u.encodeObjectIdentifierNodes(e.slice(2));this.value=new Uint8Array(n.concat(r))}get objectIdentifier(){if(0!==this.construction)throw new i.b("OBJECT IDENTIFIER cannot be constructed.");if(0===this.value.length)throw new i.i("Encoded value was too short to be an OBJECT IDENTIFIER!");let t=[0,0];return this.value[0]>=80?(t[0]=2,t[1]=this.value[0]-80):this.value[0]>=40?(t[0]=1,t[1]=this.value[0]-40):(t[0]=0,t[1]=this.value[0]),1===this.value.length?new o.a(t):(t=t.concat(u.decodeObjectIdentifierNodes(this.value.slice(1))),new o.a(t))}set enumerated(t){this.integer=t}get enumerated(){return this.integer}set relativeObjectIdentifier(t){this.value=new Uint8Array(u.encodeObjectIdentifierNodes(t))}get relativeObjectIdentifier(){if(0!==this.construction)throw new i.b("Relative OID cannot be constructed.");return u.decodeObjectIdentifierNodes(this.value.slice(0))}static decodeObjectIdentifierNodes(t){if(0===t.length)return[];let e=[];if(t.length>0&&128==(128&t[t.length-1]))throw new i.i("OID truncated");let n=0;t.forEach(t=>{128&t||n++}),e.length=n;let r=0,o=0;return t.forEach(t=>{if(0===o&&128===t)throw new i.f("OID had invalid padding byte.");if(e[r]>Number.MAX_SAFE_INTEGER>>>7)throw new i.e("OID node too big");e[r]<<=7,e[r]|=127&t,128&t?o++:(r++,o=0)}),e}static encodeObjectIdentifierNodes(t){let e=[];for(let n=0;n<t.length;n++){let r=t[n];if(r<128){e.push(r);continue}let i=[];for(;0!==r;){let t=[255&r,r>>>8&255,r>>>16&255,r>>>24&255];0==(128&t[0])&&(t[0]|=128),i.unshift(t[0]),r>>=7}i[i.length-1]&=127,e=e.concat(i)}return e}}},function(t,e,n){t.exports=n(7)},function(t,e,n){"use strict";n.r(e);var r=n(2);n.d(e,"ASN1Element",function(){return r.a});var i=n(4);n.d(e,"BERElement",function(){return i.a});var o=n(0);n.d(e,"ASN1Error",function(){return o.c}),n.d(e,"ASN1NotImplementedError",function(){return o.d}),n.d(e,"ASN1RecursionError",function(){return o.g}),n.d(e,"ASN1TruncationError",function(){return o.i}),n.d(e,"ASN1OverflowError",function(){return o.e}),n.d(e,"ASN1SizeError",function(){return o.h}),n.d(e,"ASN1PaddingError",function(){return o.f}),n.d(e,"ASN1UndefinedError",function(){return o.j}),n.d(e,"ASN1CharactersError",function(){return o.a}),n.d(e,"ASN1ConstructionError",function(){return o.b});var s=n(3);n.d(e,"ObjectIdentifier",function(){return s.a});var u=n(1);n.d(e,"MAX_UINT_32",function(){return u.i}),n.d(e,"MIN_UINT_32",function(){return u.k}),n.d(e,"MAX_SINT_32",function(){return u.h}),n.d(e,"MIN_SINT_32",function(){return u.j}),n.d(e,"ASN1TagClass",function(){return u.e}),n.d(e,"ASN1Construction",function(){return u.a}),n.d(e,"LengthEncodingPreference",function(){return u.g}),n.d(e,"ASN1SpecialRealValue",function(){return u.d}),n.d(e,"ASN1RealEncodingBase",function(){return u.b}),n.d(e,"ASN1RealEncodingScale",function(){return u.c}),n.d(e,"ASN1UniversalType",function(){return u.f}),n.d(e,"printableStringCharacters",function(){return u.t}),n.d(e,"utcTimeRegex",function(){return u.u}),n.d(e,"distinguishedUTCTimeRegex",function(){return u.o}),n.d(e,"generalizedTimeRegex",function(){return u.p}),n.d(e,"distinguishedGeneralizedTimeRegex",function(){return u.m}),n.d(e,"nr1Regex",function(){return u.q}),n.d(e,"nr2Regex",function(){return u.r}),n.d(e,"nr3Regex",function(){return u.s}),n.d(e,"canonicalNR3Regex",function(){return u.l}),n.d(e,"distinguishedNR3Regex",function(){return u.n})},function(t,e,n){"use strict";(function(t){ | ||
var asn1=function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=6)}([function(t,e,n){"use strict";n.d(e,"c",function(){return r}),n.d(e,"d",function(){return i}),n.d(e,"g",function(){return o}),n.d(e,"i",function(){return s}),n.d(e,"e",function(){return u}),n.d(e,"h",function(){return a}),n.d(e,"f",function(){return c}),n.d(e,"j",function(){return h}),n.d(e,"a",function(){return f}),n.d(e,"b",function(){return l});class r extends Error{constructor(t){super(t),Object.setPrototypeOf(this,r.prototype)}}class i extends r{constructor(){super("Not yet implemented."),Object.setPrototypeOf(this,r.prototype)}}class o extends r{constructor(){super("Recursion was too deep."),Object.setPrototypeOf(this,r.prototype)}}class s extends r{constructor(t){super(t),Object.setPrototypeOf(this,r.prototype)}}class u extends r{constructor(t){super(t),Object.setPrototypeOf(this,r.prototype)}}class a extends r{constructor(t){super(t),Object.setPrototypeOf(this,r.prototype)}}class c extends r{constructor(t){super(t),Object.setPrototypeOf(this,r.prototype)}}class h extends r{constructor(t){super(t),Object.setPrototypeOf(this,r.prototype)}}class f extends r{constructor(t){super(t),Object.setPrototypeOf(this,r.prototype)}}class l extends r{constructor(t){super(t),Object.setPrototypeOf(this,r.prototype)}}},function(t,e,n){"use strict";n.d(e,"i",function(){return r}),n.d(e,"k",function(){return i}),n.d(e,"h",function(){return o}),n.d(e,"j",function(){return s}),n.d(e,"e",function(){return u}),n.d(e,"a",function(){return a}),n.d(e,"g",function(){return c}),n.d(e,"d",function(){return h}),n.d(e,"b",function(){return f}),n.d(e,"c",function(){return l}),n.d(e,"f",function(){return d}),n.d(e,"t",function(){return g}),n.d(e,"u",function(){return p}),n.d(e,"o",function(){return w}),n.d(e,"p",function(){return v}),n.d(e,"m",function(){return y}),n.d(e,"q",function(){return b}),n.d(e,"r",function(){return m}),n.d(e,"s",function(){return E}),n.d(e,"l",function(){return S}),n.d(e,"n",function(){return T});const r=4294967295,i=0,o=2147483647,s=-2147483648;var u,a,c,h,f,l,d;!function(t){t[t.universal=0]="universal",t[t.application=1]="application",t[t.context=3]="context",t[t.private=4]="private"}(u||(u={})),function(t){t[t.primitive=0]="primitive",t[t.constructed=1]="constructed"}(a||(a={})),function(t){t[t.definite=0]="definite",t[t.indefinite=1]="indefinite"}(c||(c={})),function(t){t[t.plusInfinity=64]="plusInfinity",t[t.minusInfinity=65]="minusInfinity",t[t.notANumber=66]="notANumber",t[t.minusZero=67]="minusZero"}(h||(h={})),function(t){t[t.base2=0]="base2",t[t.base8=16]="base8",t[t.base16=32]="base16"}(f||(f={})),function(t){t[t.scale0=0]="scale0",t[t.scale1=4]="scale1",t[t.scale2=8]="scale2",t[t.scale3=12]="scale3"}(l||(l={})),function(t){t[t.endOfContent=0]="endOfContent",t[t.boolean=1]="boolean",t[t.integer=2]="integer",t[t.bitString=3]="bitString",t[t.octetString=4]="octetString",t[t.nill=5]="nill",t[t.objectIdentifier=6]="objectIdentifier",t[t.objectDescriptor=7]="objectDescriptor",t[t.external=8]="external",t[t.realNumber=9]="realNumber",t[t.enumerated=10]="enumerated",t[t.embeddedPDV=11]="embeddedPDV",t[t.utf8String=12]="utf8String",t[t.relativeOID=13]="relativeOID",t[t.reserved14=14]="reserved14",t[t.reserved15=15]="reserved15",t[t.sequence=16]="sequence",t[t.set=17]="set",t[t.numericString=18]="numericString",t[t.printableString=19]="printableString",t[t.teletexString=20]="teletexString",t[t.videotexString=21]="videotexString",t[t.ia5String=22]="ia5String",t[t.utcTime=23]="utcTime",t[t.generalizedTime=24]="generalizedTime",t[t.graphicString=25]="graphicString",t[t.visibleString=26]="visibleString",t[t.generalString=27]="generalString",t[t.universalString=28]="universalString",t[t.characterString=29]="characterString",t[t.bmpString=30]="bmpString"}(d||(d={}));const g="etaoinsrhdlucmfywgpbvkxqjzETAOINSRHDLUCMFYWGPBVKXQJZ0123456789 '()+,-./:=?",p=/^(?<year>\d{2})(?<month>(?:1[0-2])|(?:0\d))(?<date>(?:3[01])|(?:[0-2]\d))(?<hour>(?:2[0-3])|(?:[01]\d))(?<minute>[0-5]\d)(?<second>[0-5]\d)?(?<offset>(?:(\+|\-)((?:2[0-3])|(?:[01]\d))[0-5]\d)|Z)$/,w=/^(?<year>\d{2})(?<month>(?:1[0-2])|(?:0\d))(?<date>(?:3[01])|(?:[0-2]\d))(?<hour>(?:2[0-3])|(?:[01]\d))(?<minute>[0-5]\d)(?<second>[0-5]\d)?Z$/,v=/^(?<year>\d{4})(?<month>(?:1[0-2])|(?:0\d))(?<date>(?:3[01])|(?:[0-2]\d))(?<hour>(?:2[0-3])|(?:[01]\d))(?<minute>[0-5]\d)?(?<second>[0-5]\d)?(?:(\.|,)(?<fraction>\d+))?(?<offset>(?:(\+|\-)((?:2[0-3])|(?:[01]\d))[0-5]\d)|Z)?$/,y=/^(?<year>\d{4})(?<month>(?:1[0-2])|(?:0\d))(?<date>(?:3[01])|(?:[0-2]\d))(?<hour>(?:2[0-3])|(?:[01]\d))(?<minute>[0-5]\d)(?<second>[0-5]\d)(?:(\.|,)(?<fraction>\d*[1-9]))?Z$/,b=/^\ *(\+|\-)?\d+$/,m=/^\ *(\+|\-)?(?:\d+(\.|,)\d*)|(?:\d*(\.|,)\d+)$/,E=/^\ *(\+|\-)?(?:\d+(\.|,)\d*)|(?:\d*(\.|,)\d+)(e|E)(\+|\-)?\d+$/,S=/^\ *\-?(?:[1-9]\d*)?[1-9]\.E(?:\+0)|(?:\-?[1-9]\d*)$/,T=/^\ *\-?(?:[1-9]\d*)?[1-9]\.E(?:\+0)|(?:\-?[1-9]\d*)$/},function(t,e,n){"use strict";n.d(e,"a",function(){return i});var r=n(0);class i{constructor(){this.recursionCount=0,this.tagClass=0,this.construction=0,this.tagNumber=0,this.value=new Uint8Array(0)}get length(){return this.value.length}static validateDateTime(t,e,n,i,o,s,u){switch(n){case 0:case 2:case 4:case 6:case 7:case 9:case 11:if(i>31)throw new r.c(`Day > 31 encountered in ${t} with 31-day month.`);break;case 3:case 5:case 8:case 10:if(i>30)throw new r.c(`Day > 31 encountered in ${t} with 30-day month.`);break;case 1:if(e%4==0&&e%100!=0||e%400==0){if(i>29)throw new r.c(`Day > 29 encountered in ${t} with month of February in leap year.`)}else if(i>28)throw new r.c(`Day > 28 encountered in ${t} with month of February and non leap year.`);break;default:throw new r.c(`Month greater than 12 encountered in ${t}.`)}if(o>23)throw new r.c(`Hours > 23 encountered in ${t}.`);if(s>59)throw new r.c(`Minutes > 60 encountered in ${t}.`);if(u>59)throw new r.c(`Seconds > 60 encountered in ${t}.`)}static decodeUnsignedBigEndianInteger(t){if(0===t.length)return 0;if(t.length>4)throw new r.e("Number too long to decode.");const e=new Uint8Array(4);return e.set(t,4-t.length),new Uint32Array(e.reverse().buffer)[0]}static decodeSignedBigEndianInteger(t){if(0===t.length)return 0;if(t.length>4)throw new r.e("Number too long to decode.");const e=new Uint8Array(4);return t[0]>=128&&e.fill(255),e.set(t,4-t.length),new Int32Array(e.reverse().buffer)[0]}}i.nestingRecursionLimit=5},function(t,e,n){"use strict";n.d(e,"a",function(){return r});class r{constructor(t){if(t.length<2)throw new Error("Cannot construct an OID with less than two nodes!");if(t.length>=1&&!(t[0]in[0,1,2]))throw new Error("OIDs first node must be 0, 1, or 2!");if(t[0]<2&&t[1]>39||2===t[0]&&t[1]>175)throw new Error(`OID Node #2 cannot exceed 39 if node #1 is 0 or 1, and 175 if node #1 is 2. Received these nodes: ${t}.`);t.forEach(t=>{if(t<0)throw new Error("OID node numbers cannot be negative!");if(t>Number.MAX_SAFE_INTEGER)throw new Error("OID number was too big!")}),this._nodes=t.slice(0)}get nodes(){return this._nodes.slice(0)}get dotDelimitedNotation(){return this._nodes.join(".")}toString(){return this.dotDelimitedNotation}}},function(t,e,n){"use strict";(function(t){n.d(e,"a",function(){return u});var r=n(2),i=n(0),o=n(1),s=n(5);class u extends s.a{constructor(t=0,e=0,n=0){super(),this.tagClass=t,this.construction=e,this.tagNumber=n,this.value=new Uint8Array(0)}set boolean(t){this.value=new Uint8Array(1),this.value[0]=t?255:0}get boolean(){if(0!==this.construction)throw new i.b("BOOLEAN cannot be constructed.");if(1!==this.value.length)throw new i.h("BOOLEAN not one byte");return 0!==this.value[0]}set bitString(t){0===t.length&&(this.value=new Uint8Array(0));let e=[];e.length=(t.length>>>3)+(t.length%8?1:0)+1;for(let n=0;n<t.length;n++)!1!==t[n]&&(e[1+(n>>>3)]|=128>>>n%8);e[0]=8-t.length%8,8===e[0]&&(e[0]=0),this.value=new Uint8Array(e)}get bitString(){if(0===this.construction){if(0===this.value.length)throw new i.c("ASN.1 BIT STRING cannot be encoded on zero bytes!");if(1===this.value.length&&0!==this.value[0])throw new i.c("ASN.1 BIT STRING encoded with deceptive first byte!");if(this.value[0]>7)throw new i.c("First byte of an ASN.1 BIT STRING must be <= 7!");let t=[];for(let e=1;e<this.value.length;e++)t=t.concat([!!(128&this.value[e]),!!(64&this.value[e]),!!(32&this.value[e]),!!(16&this.value[e]),!!(8&this.value[e]),!!(4&this.value[e]),!!(2&this.value[e]),!!(1&this.value[e])]);return t.length-=this.value[0],t}{if(this.recursionCount+1>u.nestingRecursionLimit)throw new i.g;let t=[];const e=this.sequence;return e.slice(0,e.length-1).forEach(t=>{if(0===t.construction&&t.value.length>0&&0!==t.value[0])throw new i.c("Only the last subelement of a constructed BIT STRING may have a non-zero first value byte.")}),e.forEach(e=>{if(e.tagClass!==this.tagClass)throw new i.b("Invalid tag class in recursively-encoded BIT STRING.");if(e.tagNumber!==this.tagNumber)throw new i.b("Invalid tag class in recursively-encoded BIT STRING.");e.recursionCount=this.recursionCount+1,t=t.concat(e.bitString)}),t}}set octetString(t){this.value=t.subarray(0)}get octetString(){return this.deconstruct("OCTET STRING")}set objectDescriptor(t){this.graphicString=t}get objectDescriptor(){return this.graphicString}set real(t){if(0===t)return void(this.value=new Uint8Array(0));if(isNaN(t))return void(this.value=new Uint8Array([66]));if(-0===t)return void(this.value=new Uint8Array([67]));if(t===1/0)return void(this.value=new Uint8Array([64]));if(t===-1/0)return void(this.value=new Uint8Array([65]));let e=t.toFixed(7);e=String.fromCharCode(3)+e,this.value=(new TextEncoder).encode(e)}get real(){if(0!==this.construction)throw new i.b("REAL cannot be constructed.");if(0===this.value.length)return 0;switch(192&this.value[0]){case 64:if(66===this.value[0])return NaN;if(67===this.value[0])return-0;if(64===this.value[0])return 1/0;if(65===this.value[0])return-1/0;throw new i.j("Unrecognized special REAL value!");case 0:{let e;if("undefined"!=typeof TextEncoder)e=new TextDecoder("utf-8").decode(this.value.slice(1));else{if(void 0===t)throw new i.c("No ability to decode bytes to string!");e=new t(this.value.slice(1)).toString("utf-8")}switch(63&this.value[0]){case 1:if(!o.q.test(e))throw new i.c("Malformed NR1 Base-10 REAL");return parseFloat(e);case 2:if(!o.r.test(e))throw new i.c("Malformed NR2 Base-10 REAL");return parseFloat(e.replace(",","."));case 3:if(!o.s.test(e))throw new i.c("Malformed NR3 Base-10 REAL");return parseFloat(e.replace(",","."));default:throw new i.j("Undefined Base-10 REAL encoding.")}}case 128:case 192:{const t=64&this.value[0]?-1:1,e=(t=>{switch(this.value[0]&48){case 0:return 2;case 16:return 8;case 32:return 16;default:throw new i.c("Impossible REAL encoding base encountered.")}})(),n=(t=>{switch(this.value[0]&12){case 0:return 0;case 4:return 1;case 8:return 2;case 12:return 3;default:throw new i.c("Impossible REAL encoding scale encountered.")}})();let o,s;switch(3&this.value[0]){case 0:if(this.value.length<3)throw new i.i("Binary-encoded REAL truncated.");o=r.a.decodeSignedBigEndianInteger(this.value.subarray(1,2)),s=r.a.decodeUnsignedBigEndianInteger(this.value.subarray(2));break;case 1:if(this.value.length<4)throw new i.i("Binary-encoded REAL truncated.");o=r.a.decodeSignedBigEndianInteger(this.value.subarray(1,3)),s=r.a.decodeUnsignedBigEndianInteger(this.value.subarray(3));break;case 2:if(this.value.length<5)throw new i.i("Binary-encoded REAL truncated.");o=r.a.decodeSignedBigEndianInteger(this.value.subarray(1,4)),s=r.a.decodeUnsignedBigEndianInteger(this.value.subarray(4));break;case 3:{if(this.value.length<3)throw new i.i("Binary-encoded REAL truncated.");let t=this.value[1];if(this.value.length<3+t)throw new i.i("Binary-encoded REAL truncated.");o=r.a.decodeSignedBigEndianInteger(this.value.subarray(2,2+t)),s=r.a.decodeUnsignedBigEndianInteger(this.value.subarray(2+t));break}default:throw new i.c("Impossible binary REAL exponent encoding encountered.")}return t*s*Math.pow(2,n)*Math.pow(e,o)}default:throw new i.c("Impossible REAL format encountered.")}}set utf8String(e){"undefined"!=typeof TextEncoder?this.value=(new TextEncoder).encode(e):void 0!==t&&(this.value=t.from(e,"utf-8"))}get utf8String(){const e=this.deconstruct("UTF8String");let n="";return"undefined"!=typeof TextEncoder?n=new TextDecoder("utf-8").decode(e.buffer):void 0!==t&&(n=new t(this.value).toString("utf-8")),n}set sequence(t){let e=[];t.forEach(t=>{e.push(t.toBytes())});let n=0;e.forEach(t=>{n+=t.length});const r=new Uint8Array(n);let i=0;e.forEach(t=>{r.set(t,i),i+=t.length}),this.value=r,this.construction=1}get sequence(){if(1!==this.construction)throw new i.b("SET or SEQUENCE cannot be primitively constructed.");let t=[];if(0===this.value.length)return[];let e=0;for(;e<this.value.length;){const n=new u;e+=n.fromBytes(this.value.slice(e)),t.push(n)}return t}set set(t){this.sequence=t}get set(){return this.sequence}set numericString(e){for(let t=0;t<e.length;t++){const n=e.charCodeAt(t);if(!(n>=48&&n<=57||32===n))throw new i.a("NumericString can only contain characters 0 - 9 and space.")}"undefined"!=typeof TextEncoder?this.value=(new TextEncoder).encode(e):void 0!==t&&(this.value=t.from(e,"utf-8"))}get numericString(){const e=this.deconstruct("NumericString");let n="";"undefined"!=typeof TextEncoder?n=new TextDecoder("utf-8").decode(e.buffer):void 0!==t&&(n=new t(this.value).toString("utf-8"));for(let t=0;t<n.length;t++){const e=n.charCodeAt(t);if(!(e>=48&&e<=57||32===e))throw new i.a("NumericString can only contain characters 0 - 9 and space.")}return n}set printableString(e){for(let t=0;t<e.length;t++)if(-1===o.t.indexOf(e.charAt(t)))throw new i.a(`PrintableString can only contain these characters: ${o.t}`);"undefined"!=typeof TextEncoder?this.value=(new TextEncoder).encode(e):void 0!==t&&(this.value=t.from(e,"utf-8"))}get printableString(){const e=this.deconstruct("PrintableString");let n="";"undefined"!=typeof TextEncoder?n=new TextDecoder("utf-8").decode(e.buffer):void 0!==t&&(n=new t(this.value).toString("utf-8"));for(let t=0;t<n.length;t++)if(-1===o.t.indexOf(n.charAt(t)))throw new i.a(`PrintableString can only contain these characters: ${o.t}`);return n}set teletexString(t){this.value=t.subarray(0)}get teletexString(){return this.deconstruct("TeletexString")}set videotexString(t){this.value=t.subarray(0)}get videotexString(){return this.deconstruct("VideotexString")}set ia5String(e){"undefined"!=typeof TextEncoder?this.value=(new TextEncoder).encode(e):void 0!==t&&(this.value=t.from(e,"utf-8"))}get ia5String(){const e=this.deconstruct("IA5String");let n="";return"undefined"!=typeof TextEncoder?n=new TextDecoder("utf-8").decode(e.buffer):void 0!==t&&(n=new t(this.value).toString("utf-8")),n}set utcTime(e){let n=e.getUTCFullYear().toString();const r=`${n=n.substring(n.length-2,n.length)}${e.getUTCMonth()<9?`0${e.getUTCMonth()+1}`:`${e.getUTCMonth()+1}`}${e.getUTCDate()<10?`0${e.getUTCDate()}`:`${e.getUTCDate()}`}${e.getUTCHours()<10?`0${e.getUTCHours()}`:`${e.getUTCHours()}`}${e.getUTCMinutes()<10?`0${e.getUTCMinutes()}`:`${e.getUTCMinutes()}`}${e.getUTCSeconds()<10?`0${e.getUTCSeconds()}`:`${e.getUTCSeconds()}`}Z`;"undefined"!=typeof TextEncoder?this.value=(new TextEncoder).encode(r):void 0!==t&&(this.value=t.from(r,"utf-8"))}get utcTime(){const e=this.deconstruct("UTCTime");let n="";"undefined"!=typeof TextEncoder?n=new TextDecoder("utf-8").decode(e.buffer):void 0!==t&&(n=new t(this.value).toString("utf-8"));const r=o.u.exec(n);if(null===r)throw new i.c("Malformed UTCTime string.");if(void 0===r.groups)throw new i.c("Malformed UTCTime string.");const s=new Date;let a=Number(r.groups.year);a=a<70?2e3+a:1900+a;const c=Number(r.groups.month)-1,h=Number(r.groups.date),f=Number(r.groups.hour),l=Number(r.groups.minute),d=Number(r.groups.second);return u.validateDateTime("UTCTime",a,c,h,f,l,d),s.setUTCFullYear(a),s.setUTCMonth(c),s.setUTCDate(h),s.setUTCHours(f),s.setUTCMinutes(l),s.setUTCSeconds(d),s}set generalizedTime(e){const n=`${e.getUTCFullYear().toString()}${e.getUTCMonth()<9?`0${e.getUTCMonth()+1}`:`${e.getUTCMonth()+1}`}${e.getUTCDate()<10?`0${e.getUTCDate()}`:`${e.getUTCDate()}`}${e.getUTCHours()<10?`0${e.getUTCHours()}`:`${e.getUTCHours()}`}${e.getUTCMinutes()<10?`0${e.getUTCMinutes()}`:`${e.getUTCMinutes()}`}${e.getUTCSeconds()<10?`0${e.getUTCSeconds()}`:`${e.getUTCSeconds()}`}Z`;"undefined"!=typeof TextEncoder?this.value=(new TextEncoder).encode(n):void 0!==t&&(this.value=t.from(n,"utf-8"))}get generalizedTime(){const e=this.deconstruct("GeneralizedTime");let n="";"undefined"!=typeof TextEncoder?n=new TextDecoder("utf-8").decode(e.buffer):void 0!==t&&(n=new t(this.value).toString("utf-8"));const r=o.p.exec(n);if(null===r)throw new i.c("Malformed GeneralizedTime string.");if(void 0===r.groups)throw new i.c("Malformed GeneralizedTime string.");const s=new Date,a=Number(r.groups.year),c=Number(r.groups.month)-1,h=Number(r.groups.date),f=Number(r.groups.hour),l=Number(r.groups.minute),d=Number(r.groups.second);return u.validateDateTime("GeneralizedTime",a,c,h,f,l,d),s.setUTCFullYear(a),s.setUTCMonth(c),s.setUTCDate(h),s.setUTCHours(f),s.setUTCMinutes(l),s.setUTCSeconds(d),s}set graphicString(e){for(let t=0;t<e.length;t++){const n=e.charCodeAt(t);if(n<32||n>126)throw new i.a("GraphicString, VisibleString, or ObjectDescriptor can only contain characters between 0x20 and 0x7E.")}"undefined"!=typeof TextEncoder?this.value=(new TextEncoder).encode(e):void 0!==t&&(this.value=t.from(e,"utf-8"))}get graphicString(){const e=this.deconstruct("GraphicString, VisibleString, or ObjectDescriptor");let n="";"undefined"!=typeof TextEncoder?n=new TextDecoder("utf-8").decode(e.buffer):void 0!==t&&(n=new t(this.value).toString("utf-8"));for(let t=0;t<n.length;t++){const e=n.charCodeAt(t);if(e<32||e>126)throw new i.a("GraphicString, VisibleString, or ObjectDescriptor can only contain characters between 0x20 and 0x7E.")}return n}set visibleString(t){this.graphicString=t}get visibleString(){return this.graphicString}set generalString(e){for(let t=0;t<e.length;t++)if(e.charCodeAt(t)>127)throw new i.a("GeneralString can only contain ASCII characters.");"undefined"!=typeof TextEncoder?this.value=(new TextEncoder).encode(e):void 0!==t&&(this.value=t.from(e,"ascii"))}get generalString(){const e=this.deconstruct("GeneralString");let n="";"undefined"!=typeof TextEncoder?n=new TextDecoder("windows-1252").decode(e.buffer):void 0!==t&&(n=new t(this.value).toString("ascii"));for(let t=0;t<n.length;t++)if(n.charCodeAt(t)>127)throw new i.a("GeneralString can only contain ASCII characters.");return n}set universalString(t){const e=new Uint8Array(t.length<<2);for(let n=0;n<t.length;n++)e[n<<2]=t.charCodeAt(n)>>>24,e[1+(n<<2)]=t.charCodeAt(n)>>>16,e[2+(n<<2)]=t.charCodeAt(n)>>>8,e[3+(n<<2)]=t.charCodeAt(n);this.value=e}get universalString(){const t=this.deconstruct("UniversalString");if(t.length%4)throw new i.c("UniversalString encoded on non-mulitple of four bytes.");let e="";for(let n=0;n<t.length;n+=4)e+=String.fromCharCode((t[n+0]<<24)+(t[n+1]<<16)+(t[n+2]<<8)+(t[n+3]<<0));return e}set bmpString(t){const e=new Uint8Array(t.length<<1);for(let n=0,r=t.length;n<r;n++)e[n<<1]=t.charCodeAt(n)>>>8,e[1+(n<<1)]=t.charCodeAt(n);this.value=e}get bmpString(){const e=this.deconstruct("BMPString");if(e.length%2)throw new i.c("BMPString encoded on non-mulitple of two bytes.");let n="";if("undefined"!=typeof TextEncoder)n=new TextDecoder("utf-16be").decode(e.buffer);else if(void 0!==t){const r=new Uint8Array(e.length);for(let t=0;t<e.length;t+=2)r[t]=e[t+1],r[t+1]=e[t];n=new t(r).toString("utf-16le")}return n}fromBytes(t){if(t.length<2)throw new i.i("Tried to decode a BER element that is less than two bytes.");if(this.recursionCount+1>u.nestingRecursionLimit)throw new i.g;let e=0;switch(192&t[e]){case 0:this.tagClass=0;break;case 64:this.tagClass=1;break;case 128:this.tagClass=3;break;case 192:this.tagClass=4;break;default:this.tagClass=0}if(this.construction=32&t[e]?1:0,this.tagNumber=31&t[e],e++,this.tagNumber>=31){if(128===t[e])throw new i.f("Leading padding byte on long tag number encoding.");this.tagNumber=0;const n=t.length-1>=4?4:t.length-1;for(;e<n&&128&t[e++];);if(128&t[e-1])throw n===t.length-1?new i.i("ASN.1 tag number appears to have been truncated."):new i.e("ASN.1 tag number too large.");for(let n=1;n<e;n++)this.tagNumber<<=7,this.tagNumber|=127&t[n];if(this.tagNumber<=31)throw new i.c("ASN.1 tag number could have been encoded in short form.")}if(128==(128&t[e])){const n=127&t[e];if(n){if(127===n)throw new i.j("Length byte with undefined meaning encountered.");if(n>4)throw new i.e("Element length too long to decode to an integer.");if(e+n>=t.length)throw new i.i("Element length bytes appear to have been truncated.");e++;const r=new Uint8Array(4);for(let i=n;i>0;i--)r[4-i]=t[e+n-i];let o=0;if(r.forEach(t=>{o<<=8,o+=t}),e+o<e)throw new i.e("ASN.1 element too large.");if((e+=n)+o>t.length)throw new i.i("ASN.1 element truncated.");return this.value=t.slice(e,e+o),e+o}{if(1!==this.construction)throw new i.b("Indefinite length ASN.1 element was not of constructed construction.");const n=++e;let r=e;for(;r<t.length;){const e=new u;if(e.recursionCount=this.recursionCount+1,r+=e.fromBytes(t.slice(r)),0===e.tagClass&&0===e.construction&&0===e.tagNumber&&0===e.value.length)break}if(r===t.length&&(0!==t[r-1]||0!==t[r-2]))throw new i.i("No END OF CONTENT element found at the end of indefinite length ASN.1 element.");return this.value=t.slice(n,r-2),r}}{const n=127&t[e++];if(e+n>t.length)throw new i.i("ASN.1 element was truncated.");return this.value=t.slice(e,e+n),e+n}}toBytes(){let t=[0];if(t[0]|=this.tagClass<<6,t[0]|=this.construction<<5,this.tagNumber<31)t[0]|=this.tagNumber;else{t[0]|=31;let e=this.tagNumber,n=[];for(;0!==e;)n.unshift(127&e),e>>>=7,n[0]|=128;n[n.length-1]&=127,t=t.concat(n)}let e=[0];switch(u.lengthEncodingPreference){case 0:if(this.value.length<127)e=[this.value.length];else{let t=this.value.length;e=[0,0,0,0];for(let n=0;n<4;n++)e[n]=t>>>(3-n<<3)&255;let n=0;for(let t=0;t<e.length-1;t++)0===e[t]&&n++;(e=e.slice(n)).unshift(128|e.length)}break;case 1:e=[128];break;default:throw new i.j("Invalid LengthEncodingPreference encountered!")}const n=new Uint8Array(t.length+e.length+this.value.length+(1===u.lengthEncodingPreference?2:0));return n.set(t,0),n.set(e,t.length),n.set(this.value,t.length+e.length),n}deconstruct(t){if(0===this.construction)return this.value.subarray(0);{if(this.recursionCount+1>u.nestingRecursionLimit)throw new i.g;let e=[];this.sequence.forEach(n=>{if(n.tagClass!==this.tagClass)throw new i.b(`Invalid tag class in recursively-encoded ${t}.`);if(n.tagNumber!==this.tagNumber)throw new i.b(`Invalid tag class in recursively-encoded ${t}.`);n.recursionCount=this.recursionCount+1,e=e.concat(n.deconstruct(t))});let n=0;e.forEach(t=>{n+=t.length});const r=new Uint8Array(n);let o=0;return e.forEach(t=>{r.set(t,o),o+=t.length}),r}}}u.lengthEncodingPreference=0}).call(this,n(8).Buffer)},function(t,e,n){"use strict";n.d(e,"a",function(){return u});var r=n(2),i=n(0),o=n(3),s=n(1);class u extends r.a{validateTag(t,e,n){return t.includes(this.tagClass)?e.includes(this.construction)?n.includes(this.tagNumber)?0:-3:-2:-1}set integer(t){if(t<s.j)throw new i.e(`Number ${t} too small to be converted.`);if(t>s.h)throw new i.e(`Number ${t} too big to be converted.`);return t<=127&&t>=-128?void(this.value=new Uint8Array([255&t])):t<=32767&&t>=-32768?void(this.value=new Uint8Array([t>>8&255,255&t])):t<=8388607&&t>=-8388608?void(this.value=new Uint8Array([t>>16&255,t>>8&255,255&t])):void(this.value=new Uint8Array([t>>24&255,t>>16&255,t>>8&255,255&t]))}get integer(){if(0!==this.construction)throw new i.b("INTEGER cannot be constructed.");if(0===this.value.length)throw new i.h("Number encoded on zero bytes!");if(this.value.length>4)throw new i.e("Number too long to decode.");if(this.value.length>2&&(255===this.value[0]&&this.value[1]>=128||0===this.value[0]&&this.value[1]<128))throw new i.f("Unnecessary padding bytes on INTEGER or ENUMERATED.");return r.a.decodeSignedBigEndianInteger(this.value.subarray(0))}set objectIdentifier(t){const e=t.nodes;let n=[40*e[0]+e[1]],r=u.encodeObjectIdentifierNodes(e.slice(2));this.value=new Uint8Array(n.concat(r))}get objectIdentifier(){if(0!==this.construction)throw new i.b("OBJECT IDENTIFIER cannot be constructed.");if(0===this.value.length)throw new i.i("Encoded value was too short to be an OBJECT IDENTIFIER!");let t=[0,0];return this.value[0]>=80?(t[0]=2,t[1]=this.value[0]-80):this.value[0]>=40?(t[0]=1,t[1]=this.value[0]-40):(t[0]=0,t[1]=this.value[0]),1===this.value.length?new o.a(t):(t=t.concat(u.decodeObjectIdentifierNodes(this.value.slice(1))),new o.a(t))}set enumerated(t){this.integer=t}get enumerated(){return this.integer}set relativeObjectIdentifier(t){this.value=new Uint8Array(u.encodeObjectIdentifierNodes(t))}get relativeObjectIdentifier(){if(0!==this.construction)throw new i.b("Relative OID cannot be constructed.");return u.decodeObjectIdentifierNodes(this.value.slice(0))}static decodeObjectIdentifierNodes(t){if(0===t.length)return[];let e=[];if(t.length>0&&128==(128&t[t.length-1]))throw new i.i("OID truncated");let n=0;t.forEach(t=>{128&t||n++}),e.length=n;let r=0,o=0;return t.forEach(t=>{if(0===o&&128===t)throw new i.f("OID had invalid padding byte.");if(e[r]>Number.MAX_SAFE_INTEGER>>>7)throw new i.e("OID node too big");e[r]<<=7,e[r]|=127&t,128&t?o++:(r++,o=0)}),e}static encodeObjectIdentifierNodes(t){let e=[];for(let n=0;n<t.length;n++){let r=t[n];if(r<128){e.push(r);continue}let i=[];for(;0!==r;){let t=[255&r,r>>>8&255,r>>>16&255,r>>>24&255];0==(128&t[0])&&(t[0]|=128),i.unshift(t[0]),r>>=7}i[i.length-1]&=127,e=e.concat(i)}return e}}},function(t,e,n){t.exports=n(7)},function(t,e,n){"use strict";n.r(e);var r=n(2);n.d(e,"ASN1Element",function(){return r.a});var i=n(4);n.d(e,"BERElement",function(){return i.a});var o=n(0);n.d(e,"ASN1Error",function(){return o.c}),n.d(e,"ASN1NotImplementedError",function(){return o.d}),n.d(e,"ASN1RecursionError",function(){return o.g}),n.d(e,"ASN1TruncationError",function(){return o.i}),n.d(e,"ASN1OverflowError",function(){return o.e}),n.d(e,"ASN1SizeError",function(){return o.h}),n.d(e,"ASN1PaddingError",function(){return o.f}),n.d(e,"ASN1UndefinedError",function(){return o.j}),n.d(e,"ASN1CharactersError",function(){return o.a}),n.d(e,"ASN1ConstructionError",function(){return o.b});var s=n(3);n.d(e,"ObjectIdentifier",function(){return s.a});var u=n(1);n.d(e,"MAX_UINT_32",function(){return u.i}),n.d(e,"MIN_UINT_32",function(){return u.k}),n.d(e,"MAX_SINT_32",function(){return u.h}),n.d(e,"MIN_SINT_32",function(){return u.j}),n.d(e,"ASN1TagClass",function(){return u.e}),n.d(e,"ASN1Construction",function(){return u.a}),n.d(e,"LengthEncodingPreference",function(){return u.g}),n.d(e,"ASN1SpecialRealValue",function(){return u.d}),n.d(e,"ASN1RealEncodingBase",function(){return u.b}),n.d(e,"ASN1RealEncodingScale",function(){return u.c}),n.d(e,"ASN1UniversalType",function(){return u.f}),n.d(e,"printableStringCharacters",function(){return u.t}),n.d(e,"utcTimeRegex",function(){return u.u}),n.d(e,"distinguishedUTCTimeRegex",function(){return u.o}),n.d(e,"generalizedTimeRegex",function(){return u.p}),n.d(e,"distinguishedGeneralizedTimeRegex",function(){return u.m}),n.d(e,"nr1Regex",function(){return u.q}),n.d(e,"nr2Regex",function(){return u.r}),n.d(e,"nr3Regex",function(){return u.s}),n.d(e,"canonicalNR3Regex",function(){return u.l}),n.d(e,"distinguishedNR3Regex",function(){return u.n})},function(t,e,n){"use strict";(function(t){ | ||
/*! | ||
@@ -3,0 +3,0 @@ * The buffer module from node.js, for the browser. |
@@ -1,2 +0,2 @@ | ||
var asn1=function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=6)}([function(t,e,n){"use strict";n.d(e,"c",function(){return r}),n.d(e,"d",function(){return i}),n.d(e,"g",function(){return o}),n.d(e,"i",function(){return u}),n.d(e,"e",function(){return s}),n.d(e,"h",function(){return a}),n.d(e,"f",function(){return c}),n.d(e,"j",function(){return h}),n.d(e,"a",function(){return f}),n.d(e,"b",function(){return l});class r extends Error{constructor(t){super(t),Object.setPrototypeOf(this,r.prototype)}}class i extends r{constructor(){super("Not yet implemented."),Object.setPrototypeOf(this,r.prototype)}}class o extends r{constructor(){super("Recursion was too deep."),Object.setPrototypeOf(this,r.prototype)}}class u extends r{constructor(t){super(t),Object.setPrototypeOf(this,r.prototype)}}class s extends r{constructor(t){super(t),Object.setPrototypeOf(this,r.prototype)}}class a extends r{constructor(t){super(t),Object.setPrototypeOf(this,r.prototype)}}class c extends r{constructor(t){super(t),Object.setPrototypeOf(this,r.prototype)}}class h extends r{constructor(t){super(t),Object.setPrototypeOf(this,r.prototype)}}class f extends r{constructor(t){super(t),Object.setPrototypeOf(this,r.prototype)}}class l extends r{constructor(t){super(t),Object.setPrototypeOf(this,r.prototype)}}},function(t,e,n){"use strict";n.d(e,"i",function(){return r}),n.d(e,"k",function(){return i}),n.d(e,"h",function(){return o}),n.d(e,"j",function(){return u}),n.d(e,"e",function(){return s}),n.d(e,"a",function(){return a}),n.d(e,"g",function(){return c}),n.d(e,"d",function(){return h}),n.d(e,"b",function(){return f}),n.d(e,"c",function(){return l}),n.d(e,"f",function(){return d}),n.d(e,"t",function(){return g}),n.d(e,"u",function(){return w}),n.d(e,"o",function(){return p}),n.d(e,"p",function(){return v}),n.d(e,"m",function(){return y}),n.d(e,"q",function(){return b}),n.d(e,"r",function(){return m}),n.d(e,"s",function(){return E}),n.d(e,"l",function(){return S}),n.d(e,"n",function(){return T});const r=4294967295,i=0,o=2147483647,u=-2147483648;var s,a,c,h,f,l,d;!function(t){t[t.universal=0]="universal",t[t.application=1]="application",t[t.context=3]="context",t[t.private=4]="private"}(s||(s={})),function(t){t[t.primitive=0]="primitive",t[t.constructed=1]="constructed"}(a||(a={})),function(t){t[t.definite=0]="definite",t[t.indefinite=1]="indefinite"}(c||(c={})),function(t){t[t.plusInfinity=64]="plusInfinity",t[t.minusInfinity=65]="minusInfinity",t[t.notANumber=66]="notANumber",t[t.minusZero=67]="minusZero"}(h||(h={})),function(t){t[t.base2=0]="base2",t[t.base8=16]="base8",t[t.base16=32]="base16"}(f||(f={})),function(t){t[t.scale0=0]="scale0",t[t.scale1=4]="scale1",t[t.scale2=8]="scale2",t[t.scale3=12]="scale3"}(l||(l={})),function(t){t[t.endOfContent=0]="endOfContent",t[t.boolean=1]="boolean",t[t.integer=2]="integer",t[t.bitString=3]="bitString",t[t.octetString=4]="octetString",t[t.nill=5]="nill",t[t.objectIdentifier=6]="objectIdentifier",t[t.objectDescriptor=7]="objectDescriptor",t[t.external=8]="external",t[t.realNumber=9]="realNumber",t[t.enumerated=10]="enumerated",t[t.embeddedPDV=11]="embeddedPDV",t[t.utf8String=12]="utf8String",t[t.relativeOID=13]="relativeOID",t[t.reserved14=14]="reserved14",t[t.reserved15=15]="reserved15",t[t.sequence=16]="sequence",t[t.set=17]="set",t[t.numericString=18]="numericString",t[t.printableString=19]="printableString",t[t.teletexString=20]="teletexString",t[t.videotexString=21]="videotexString",t[t.ia5String=22]="ia5String",t[t.utcTime=23]="utcTime",t[t.generalizedTime=24]="generalizedTime",t[t.graphicString=25]="graphicString",t[t.visibleString=26]="visibleString",t[t.generalString=27]="generalString",t[t.universalString=28]="universalString",t[t.characterString=29]="characterString",t[t.bmpString=30]="bmpString"}(d||(d={}));const g="etaoinsrhdlucmfywgpbvkxqjzETAOINSRHDLUCMFYWGPBVKXQJZ0123456789 '()+,-./:=?",w=/^(?<year>\d{2})(?<month>(?:1[0-2])|(?:0\d))(?<date>(?:3[01])|(?:[0-2]\d))(?<hour>(?:2[0-3])|(?:[01]\d))(?<minute>[0-5]\d)(?<second>[0-5]\d)?(?<offset>(?:(\+|\-)((?:2[0-3])|(?:[01]\d))[0-5]\d)|Z)$/,p=/^(?<year>\d{2})(?<month>(?:1[0-2])|(?:0\d))(?<date>(?:3[01])|(?:[0-2]\d))(?<hour>(?:2[0-3])|(?:[01]\d))(?<minute>[0-5]\d)(?<second>[0-5]\d)?Z$/,v=/^(?<year>\d{4})(?<month>(?:1[0-2])|(?:0\d))(?<date>(?:3[01])|(?:[0-2]\d))(?<hour>(?:2[0-3])|(?:[01]\d))(?<minute>[0-5]\d)?(?<second>[0-5]\d)?(?:(\.|,)(?<fraction>\d+))?(?<offset>(?:(\+|\-)((?:2[0-3])|(?:[01]\d))[0-5]\d)|Z)?$/,y=/^(?<year>\d{4})(?<month>(?:1[0-2])|(?:0\d))(?<date>(?:3[01])|(?:[0-2]\d))(?<hour>(?:2[0-3])|(?:[01]\d))(?<minute>[0-5]\d)(?<second>[0-5]\d)(?:(\.|,)(?<fraction>\d*[1-9]))?Z$/,b=/^\ *(\+|\-)?\d+$/,m=/^\ *(\+|\-)?(?:\d+(\.|,)\d*)|(?:\d*(\.|,)\d+)$/,E=/^\ *(\+|\-)?(?:\d+(\.|,)\d*)|(?:\d*(\.|,)\d+)(e|E)(\+|\-)?\d+$/,S=/^\ *\-?(?:[1-9]\d*)?[1-9]\.E(?:\+0)|(?:\-?[1-9]\d*)$/,T=/^\ *\-?(?:[1-9]\d*)?[1-9]\.E(?:\+0)|(?:\-?[1-9]\d*)$/},function(t,e,n){"use strict";n.d(e,"a",function(){return i});var r=n(0);class i{constructor(){this.recursionCount=0,this.tagClass=0,this.construction=0,this.tagNumber=0,this.value=new Uint8Array(0)}get length(){return this.value.length}static validateDateTime(t,e,n,i,o,u,s){switch(n){case 0:case 2:case 4:case 6:case 7:case 9:case 11:if(i>31)throw new r.c(`Day > 31 encountered in ${t} with 31-day month.`);break;case 3:case 5:case 8:case 10:if(i>30)throw new r.c(`Day > 31 encountered in ${t} with 30-day month.`);break;case 1:if(e%4==0&&e%100!=0||e%400==0){if(i>29)throw new r.c(`Day > 29 encountered in ${t} with month of February in leap year.`)}else if(i>28)throw new r.c(`Day > 28 encountered in ${t} with month of February and non leap year.`);break;default:throw new r.c(`Month greater than 12 encountered in ${t}.`)}if(o>23)throw new r.c(`Hours > 23 encountered in ${t}.`);if(u>59)throw new r.c(`Minutes > 60 encountered in ${t}.`);if(s>59)throw new r.c(`Seconds > 60 encountered in ${t}.`)}static decodeUnsignedBigEndianInteger(t){if(0===t.length)return 0;if(t.length>4)throw new r.e("Number too long to decode.");const e=new Uint8Array(4);return e.set(t,4-t.length),new Uint32Array(e.reverse().buffer)[0]}static decodeSignedBigEndianInteger(t){if(0===t.length)return 0;if(t.length>4)throw new r.e("Number too long to decode.");const e=new Uint8Array(4);return t[0]>=128&&e.fill(255),e.set(t,4-t.length),new Int32Array(e.reverse().buffer)[0]}}i.nestingRecursionLimit=5},function(t,e,n){"use strict";n.d(e,"a",function(){return r});class r{constructor(t){if(t.length<2)throw new Error("Cannot construct an OID with less than two nodes!");if(t.length>=1&&!(t[0]in[0,1,2]))throw new Error("OIDs first node must be 0, 1, or 2!");if(t[0]<2&&t[1]>39||2===t[0]&&t[1]>175)throw new Error(`OID Node #2 cannot exceed 39 if node #1 is 0 or 1, and 175 if node #1 is 2. Received these nodes: ${t}.`);t.forEach(t=>{if(t<0)throw new Error("OID node numbers cannot be negative!");if(t>Number.MAX_SAFE_INTEGER)throw new Error("OID number was too big!")}),this._nodes=t.slice(0)}get nodes(){return this._nodes.slice(0)}get dotDelimitedNotation(){return this._nodes.join(".")}toString(){return this.dotDelimitedNotation}}},function(t,e,n){"use strict";(function(t){n.d(e,"a",function(){return s});var r=n(2),i=n(0),o=n(1),u=n(5);class s extends u.a{set boolean(t){this.value=new Uint8Array(1),this.value[0]=t?255:0}get boolean(){if(0!==this.construction)throw new i.b("BOOLEAN cannot be constructed.");if(1!==this.value.length)throw new i.h("BOOLEAN not one byte");if(0!==this.value[0]&&255!==this.value[0])throw new i.c("BOOLEAN must be encoded as 0xFF or 0x00.");return 0!==this.value[0]}set bitString(t){0===t.length&&(this.value=new Uint8Array(0));let e=[];e.length=(t.length>>>3)+(t.length%8?1:0)+1;for(let n=0;n<t.length;n++)!1!==t[n]&&(e[1+(n>>>3)]|=128>>>n%8);e[0]=8-t.length%8,8===e[0]&&(e[0]=0),this.value=new Uint8Array(e)}get bitString(){if(0!==this.construction)throw new i.b("BIT STRING cannot be constructed.");if(0===this.value.length)throw new i.c("ASN.1 BIT STRING cannot be encoded on zero bytes!");if(1===this.value.length&&0!==this.value[0])throw new i.c("ASN.1 BIT STRING encoded with deceptive first byte!");if(this.value[0]>7)throw new i.c("First byte of an ASN.1 BIT STRING must be <= 7!");let t=[];for(let e=1;e<this.value.length;e++)t=t.concat([!!(128&this.value[e]),!!(64&this.value[e]),!!(32&this.value[e]),!!(16&this.value[e]),!!(8&this.value[e]),!!(4&this.value[e]),!!(2&this.value[e]),!!(1&this.value[e])]);return t.slice(t.length-this.value[0]).forEach(t=>{if(t)throw new i.c("BIT STRING had a trailing set bit.")}),t.length-=this.value[0],t}set octetString(t){this.value=t.subarray(0)}get octetString(){if(0!==this.construction)throw new i.b("OCTET STRING cannot be constructed.");return this.value.subarray(0)}set objectDescriptor(t){this.graphicString=t}get objectDescriptor(){return this.graphicString}set real(t){if(0===t)return void(this.value=new Uint8Array(0));if(isNaN(t))return void(this.value=new Uint8Array([66]));if(-0===t)return void(this.value=new Uint8Array([67]));if(t===1/0)return void(this.value=new Uint8Array([64]));if(t===-1/0)return void(this.value=new Uint8Array([65]));let e=t.toFixed(7);e=String.fromCharCode(3)+e,this.value=(new TextEncoder).encode(e)}get real(){if(0!==this.construction)throw new i.b("REAL cannot be constructed.");if(0===this.value.length)return 0;switch(192&this.value[0]){case 64:if(66===this.value[0])return NaN;if(67===this.value[0])return-0;if(64===this.value[0])return 1/0;if(65===this.value[0])return-1/0;throw new i.j("Unrecognized special REAL value!");case 0:{let e;if("undefined"!=typeof TextEncoder)e=new TextDecoder("utf-8").decode(this.value.slice(1));else{if(void 0===t)throw new i.c("No ability to decode bytes to string!");e=new t(this.value.slice(1)).toString("utf-8")}switch(63&this.value[0]){case 1:case 2:throw new i.c("DER prohibits NR1 and NR2 Base-10 REAL");case 3:if(!o.s.test(e))throw new i.c("Malformed NR3 Base-10 REAL");return parseFloat(e.replace(",","."));default:throw new i.j("Undefined Base-10 REAL encoding.")}}case 128:case 192:{const t=64&this.value[0]?-1:1,e=(t=>{switch(this.value[0]&48){case 0:return 2;case 16:return 8;case 32:return 16;default:throw new i.c("Impossible REAL encoding base encountered.")}})(),n=(t=>{switch(this.value[0]&12){case 0:return 0;case 4:return 1;case 8:return 2;case 12:return 3;default:throw new i.c("Impossible REAL encoding scale encountered.")}})();let o,u;switch(3&this.value[0]){case 0:if(this.value.length<3)throw new i.i("Binary-encoded REAL truncated.");o=r.a.decodeSignedBigEndianInteger(this.value.subarray(1,2)),u=r.a.decodeUnsignedBigEndianInteger(this.value.subarray(2));break;case 1:if(this.value.length<4)throw new i.i("Binary-encoded REAL truncated.");if(o=r.a.decodeSignedBigEndianInteger(this.value.subarray(1,3)),u=r.a.decodeUnsignedBigEndianInteger(this.value.subarray(3)),o<=127&&o>=-128)throw new i.c("DER-encoded binary-encoded REAL could have encoded exponent on fewer octets.");break;case 2:case 3:throw new i.c("DER-encoded binary REAL encoded in a way that would either overflow or encode on too many octets.");default:throw new i.c("Impossible binary REAL exponent encoding encountered.")}if(0!==u&&!(u%2))throw new i.c("DER-encoded REAL may not have an even non-zero mantissa.");return t*u*Math.pow(2,n)*Math.pow(e,o)}default:throw new i.c("Impossible REAL format encountered.")}}set utf8String(e){"undefined"!=typeof TextEncoder?this.value=(new TextEncoder).encode(e):void 0!==t&&(this.value=t.from(e,"utf-8"))}get utf8String(){if(0!==this.construction)throw new i.b("UTF8String cannot be constructed.");let e="";return"undefined"!=typeof TextEncoder?e=new TextDecoder("utf-8").decode(this.value.subarray(0).buffer):void 0!==t&&(e=new t(this.value).toString("utf-8")),e}set sequence(t){let e=[];t.forEach(t=>{e.push(t.toBytes())});let n=0;e.forEach(t=>{n+=t.length});const r=new Uint8Array(n);let i=0;e.forEach(t=>{r.set(t,i),i+=t.length}),this.value=r,this.construction=1}get sequence(){if(1!==this.construction)throw new i.b("SET or SEQUENCE cannot be primitively constructed.");let t=[];if(0===this.value.length)return[];let e=0;for(;e<this.value.length;){const n=new s;e+=n.fromBytes(this.value.slice(e)),t.push(n)}return t}set set(t){this.sequence=t}get set(){return this.sequence}set numericString(e){for(let t=0;t<e.length;t++){const n=e.charCodeAt(t);if(!(n>=48&&n<=57||32===n))throw new i.a("NumericString can only contain characters 0 - 9 and space.")}"undefined"!=typeof TextEncoder?this.value=(new TextEncoder).encode(e):void 0!==t&&(this.value=t.from(e,"utf-8"))}get numericString(){if(0!==this.construction)throw new i.b("NumericString cannot be constructed.");let e="";"undefined"!=typeof TextEncoder?e=new TextDecoder("utf-8").decode(this.value.subarray(0).buffer):void 0!==t&&(e=new t(this.value).toString("utf-8"));for(let t=0;t<e.length;t++){const n=e.charCodeAt(t);if(!(n>=48&&n<=57||32===n))throw new i.a("NumericString can only contain characters 0 - 9 and space.")}return e}set printableString(e){for(let t=0;t<e.length;t++)if(-1===o.t.indexOf(e.charAt(t)))throw new i.a(`PrintableString can only contain these characters: ${o.t}`);"undefined"!=typeof TextEncoder?this.value=(new TextEncoder).encode(e):void 0!==t&&(this.value=t.from(e,"utf-8"))}get printableString(){if(0!==this.construction)throw new i.b("PrintableString cannot be constructed.");let e="";"undefined"!=typeof TextEncoder?e=new TextDecoder("utf-8").decode(this.value.subarray(0).buffer):void 0!==t&&(e=new t(this.value).toString("utf-8"));for(let t=0;t<e.length;t++)if(-1===o.t.indexOf(e.charAt(t)))throw new i.a(`PrintableString can only contain these characters: ${o.t}`);return e}set teletexString(t){this.value=t.subarray(0)}get teletexString(){return this.octetString}set videotexString(t){this.value=t.subarray(0)}get videotexString(){return this.octetString}set ia5String(e){"undefined"!=typeof TextEncoder?this.value=(new TextEncoder).encode(e):void 0!==t&&(this.value=t.from(e,"utf-8"))}get ia5String(){if(0!==this.construction)throw new i.b("IA5String cannot be constructed.");let e="";return"undefined"!=typeof TextEncoder?e=new TextDecoder("utf-8").decode(this.value.subarray(0).buffer):void 0!==t&&(e=new t(this.value).toString("utf-8")),e}set utcTime(e){let n=e.getUTCFullYear().toString();const r=`${n=n.substring(n.length-2,n.length)}${e.getUTCMonth()<9?`0${e.getUTCMonth()+1}`:`${e.getUTCMonth()+1}`}${e.getUTCDate()<10?`0${e.getUTCDate()}`:`${e.getUTCDate()}`}${e.getUTCHours()<10?`0${e.getUTCHours()}`:`${e.getUTCHours()}`}${e.getUTCMinutes()<10?`0${e.getUTCMinutes()}`:`${e.getUTCMinutes()}`}${e.getUTCSeconds()<10?`0${e.getUTCSeconds()}`:`${e.getUTCSeconds()}`}Z`;"undefined"!=typeof TextEncoder?this.value=(new TextEncoder).encode(r):void 0!==t&&(this.value=t.from(r,"utf-8"))}get utcTime(){if(0!==this.construction)throw new i.b("UTCTime cannot be constructed.");let e="";"undefined"!=typeof TextEncoder?e=new TextDecoder("utf-8").decode(this.value.subarray(0).buffer):void 0!==t&&(e=new t(this.value).toString("utf-8"));const n=o.u.exec(e);if(null===n)throw new i.c("Malformed UTCTime string.");if(void 0===n.groups)throw new i.c("Malformed UTCTime string.");const r=new Date;let u=Number(n.groups.year);u=u<70?2e3+u:1900+u;const a=Number(n.groups.month)-1,c=Number(n.groups.date),h=Number(n.groups.hour),f=Number(n.groups.minute),l=Number(n.groups.second);return s.validateDateTime("UTCTime",u,a,c,h,f,l),r.setUTCFullYear(u),r.setUTCMonth(a),r.setUTCDate(c),r.setUTCHours(h),r.setUTCMinutes(f),r.setUTCSeconds(l),r}set generalizedTime(e){const n=`${e.getUTCFullYear().toString()}${e.getUTCMonth()<9?`0${e.getUTCMonth()+1}`:`${e.getUTCMonth()+1}`}${e.getUTCDate()<10?`0${e.getUTCDate()}`:`${e.getUTCDate()}`}${e.getUTCHours()<10?`0${e.getUTCHours()}`:`${e.getUTCHours()}`}${e.getUTCMinutes()<10?`0${e.getUTCMinutes()}`:`${e.getUTCMinutes()}`}${e.getUTCSeconds()<10?`0${e.getUTCSeconds()}`:`${e.getUTCSeconds()}`}Z`;"undefined"!=typeof TextEncoder?this.value=(new TextEncoder).encode(n):void 0!==t&&(this.value=t.from(n,"utf-8"))}get generalizedTime(){if(0!==this.construction)throw new i.b("GeneralizedTime cannot be constructed.");let e="";"undefined"!=typeof TextEncoder?e=new TextDecoder("utf-8").decode(this.value.subarray(0).buffer):void 0!==t&&(e=new t(this.value).toString("utf-8"));const n=o.p.exec(e);if(null===n)throw new i.c("Malformed GeneralizedTime string.");if(void 0===n.groups)throw new i.c("Malformed GeneralizedTime string.");const r=new Date,u=Number(n.groups.year),a=Number(n.groups.month)-1,c=Number(n.groups.date),h=Number(n.groups.hour),f=Number(n.groups.minute),l=Number(n.groups.second);return s.validateDateTime("GeneralizedTime",u,a,c,h,f,l),r.setUTCFullYear(u),r.setUTCMonth(a),r.setUTCDate(c),r.setUTCHours(h),r.setUTCMinutes(f),r.setUTCSeconds(l),r}set graphicString(e){for(let t=0;t<e.length;t++){const n=e.charCodeAt(t);if(n<32||n>126)throw new i.a("GraphicString, VisibleString, or ObjectDescriptor can only contain characters between 0x20 and 0x7E.")}"undefined"!=typeof TextEncoder?this.value=(new TextEncoder).encode(e):void 0!==t&&(this.value=t.from(e,"utf-8"))}get graphicString(){if(0!==this.construction)throw new i.b("GraphicString cannot be constructed.");let e="";"undefined"!=typeof TextEncoder?e=new TextDecoder("utf-8").decode(this.value.subarray(0).buffer):void 0!==t&&(e=new t(this.value).toString("utf-8"));for(let t=0;t<e.length;t++){const n=e.charCodeAt(t);if(n<32||n>126)throw new i.a("GraphicString, VisibleString, or ObjectDescriptor can only contain characters between 0x20 and 0x7E.")}return e}set visibleString(t){this.graphicString=t}get visibleString(){return this.graphicString}set generalString(e){for(let t=0;t<e.length;t++)if(e.charCodeAt(t)>127)throw new i.a("GeneralString can only contain ASCII characters.");"undefined"!=typeof TextEncoder?this.value=(new TextEncoder).encode(e):void 0!==t&&(this.value=t.from(e,"ascii"))}get generalString(){if(0!==this.construction)throw new i.b("GeneralString cannot be constructed.");let e="";"undefined"!=typeof TextEncoder?e=new TextDecoder("windows-1252").decode(this.value.subarray(0).buffer):void 0!==t&&(e=new t(this.value).toString("ascii"));for(let t=0;t<e.length;t++)if(e.charCodeAt(t)>127)throw new i.a("GeneralString can only contain ASCII characters.");return e}set universalString(t){const e=new Uint8Array(t.length<<2);for(let n=0;n<t.length;n++)e[n<<2]=t.charCodeAt(n)>>>24,e[1+(n<<2)]=t.charCodeAt(n)>>>16,e[2+(n<<2)]=t.charCodeAt(n)>>>8,e[3+(n<<2)]=t.charCodeAt(n);this.value=e}get universalString(){if(0!==this.construction)throw new i.b("UniversalString cannot be constructed.");if(this.value.length%4)throw new i.c("UniversalString encoded on non-mulitple of four bytes.");let t="";for(let e=0;e<this.value.length;e+=4)t+=String.fromCharCode((this.value[e+0]<<24)+(this.value[e+1]<<16)+(this.value[e+2]<<8)+(this.value[e+3]<<0));return t}set bmpString(t){const e=new Uint8Array(t.length<<1);for(let n=0,r=t.length;n<r;n++)e[n<<1]=t.charCodeAt(n)>>>8,e[1+(n<<1)]=t.charCodeAt(n);this.value=e}get bmpString(){if(0!==this.construction)throw new i.b("BMPString cannot be constructed.");if(this.value.length%2)throw new i.c("BMPString encoded on non-mulitple of two bytes.");let e="";if("undefined"!=typeof TextEncoder)e=new TextDecoder("utf-16be").decode(this.value.subarray(0).buffer);else if(void 0!==t){const n=new Uint8Array(this.value.length);for(let t=0;t<this.value.length;t+=2)n[t]=this.value[t+1],n[t+1]=this.value[t];e=new t(n).toString("utf-16le")}return e}constructor(t=0,e=0,n=0){super(),this.tagClass=t,this.construction=e,this.tagNumber=n,this.value=new Uint8Array(0)}fromBytes(t){if(t.length<2)throw new i.i("Tried to decode a DER element that is less than two bytes.");if(this.recursionCount+1>s.nestingRecursionLimit)throw new i.g;let e=0;switch(192&t[e]){case 0:this.tagClass=0;break;case 64:this.tagClass=1;break;case 128:this.tagClass=3;break;case 192:this.tagClass=4;break;default:this.tagClass=0}if(this.construction=32&t[e]?1:0,this.tagNumber=31&t[e],e++,this.tagNumber>=31){if(128===t[e])throw new i.f("Leading padding byte on long tag number encoding.");this.tagNumber=0;const n=t.length-1>=4?4:t.length-1;for(;e<n&&128&t[e++];);if(128&t[e-1])throw n===t.length-1?new i.i("ASN.1 tag number appears to have been truncated."):new i.e("ASN.1 tag number too large.");for(let n=1;n<e;n++)this.tagNumber<<=7,this.tagNumber|=127&t[n];if(this.tagNumber<=31)throw new i.c("ASN.1 tag number could have been encoded in short form.")}if(128==(128&t[e])){const n=127&t[e];if(127===n)throw new i.j("Length byte with undefined meaning encountered.");if(n>4)throw new i.e("Element length too long to decode to an integer.");if(e+n>=t.length)throw new i.i("Element length bytes appear to have been truncated.");e++;const r=new Uint8Array(4);for(let i=n;i>0;i--)r[4-i]=t[e+n-i];let o=0;if(r.forEach(t=>{o<<=8,o+=t}),e+o<e)throw new i.e("ASN.1 element too large.");if((e+=n)+o>t.length)throw new i.i("ASN.1 element truncated.");if(o<=127&&o>=-128&&n>1||o<=32767&&o>=-32768&&n>2||o<=8388607&&o>=-8388608&&n>3)throw new i.f("DER-encoded long-form length encoded on more octets than necessary");return this.value=t.slice(e,e+o),e+o}{const n=127&t[e++];if(e+n>t.length)throw new i.i("ASN.1 element was truncated.");return this.value=t.slice(e,e+n),e+n}}toBytes(){let t=[0];if(t[0]|=this.tagClass,t[0]|=this.construction,this.tagNumber<31)t[0]|=this.tagNumber;else{t[0]|=31;let e=this.tagNumber,n=[];for(;0!==e;)n.unshift(127&e),e>>>=7,n[0]|=128;n[n.length-1]&=127,t=t.concat(n)}let e=[0];if(this.value.length<127)e=[this.value.length];else{let t=this.value.length;e=[0,0,0,0];for(let n=0;n<4;n++)e[n]=t>>>(3-n<<3)&255;let n=0;for(let t=0;t<e.length-1;t++)0===e[t]&&n++;(e=e.slice(n)).unshift(128|e.length)}const n=new Uint8Array(t.length+e.length+this.value.length);return n.set(t,0),n.set(e,t.length),n.set(this.value,t.length+e.length),n}}}).call(this,n(8).Buffer)},function(t,e,n){"use strict";n.d(e,"a",function(){return s});var r=n(2),i=n(0),o=n(3),u=n(1);class s extends r.a{validateTag(t,e,n){return t.includes(this.tagClass)?e.includes(this.construction)?n.includes(this.tagNumber)?0:-3:-2:-1}set integer(t){if(t<u.j)throw new i.e(`Number ${t} too small to be converted.`);if(t>u.h)throw new i.e(`Number ${t} too big to be converted.`);return t<=127&&t>=-128?void(this.value=new Uint8Array([255&t])):t<=32767&&t>=-32768?void(this.value=new Uint8Array([t>>8&255,255&t])):t<=8388607&&t>=-8388608?void(this.value=new Uint8Array([t>>16&255,t>>8&255,255&t])):void(this.value=new Uint8Array([t>>24&255,t>>16&255,t>>8&255,255&t]))}get integer(){if(0!==this.construction)throw new i.b("INTEGER cannot be constructed.");if(0===this.value.length)throw new i.h("Number encoded on zero bytes!");if(this.value.length>4)throw new i.e("Number too long to decode.");if(this.value.length>2&&(255===this.value[0]&&this.value[1]>=128||0===this.value[0]&&this.value[1]<128))throw new i.f("Unnecessary padding bytes on INTEGER or ENUMERATED.");return r.a.decodeSignedBigEndianInteger(this.value.subarray(0))}set objectIdentifier(t){const e=t.nodes;let n=[40*e[0]+e[1]],r=s.encodeObjectIdentifierNodes(e.slice(2));this.value=new Uint8Array(n.concat(r))}get objectIdentifier(){if(0!==this.construction)throw new i.b("OBJECT IDENTIFIER cannot be constructed.");if(0===this.value.length)throw new i.i("Encoded value was too short to be an OBJECT IDENTIFIER!");let t=[0,0];return this.value[0]>=80?(t[0]=2,t[1]=this.value[0]-80):this.value[0]>=40?(t[0]=1,t[1]=this.value[0]-40):(t[0]=0,t[1]=this.value[0]),1===this.value.length?new o.a(t):(t=t.concat(s.decodeObjectIdentifierNodes(this.value.slice(1))),new o.a(t))}set enumerated(t){this.integer=t}get enumerated(){return this.integer}set relativeObjectIdentifier(t){this.value=new Uint8Array(s.encodeObjectIdentifierNodes(t))}get relativeObjectIdentifier(){if(0!==this.construction)throw new i.b("Relative OID cannot be constructed.");return s.decodeObjectIdentifierNodes(this.value.slice(0))}static decodeObjectIdentifierNodes(t){if(0===t.length)return[];let e=[];if(t.length>0&&128==(128&t[t.length-1]))throw new i.i("OID truncated");let n=0;t.forEach(t=>{128&t||n++}),e.length=n;let r=0,o=0;return t.forEach(t=>{if(0===o&&128===t)throw new i.f("OID had invalid padding byte.");if(e[r]>Number.MAX_SAFE_INTEGER>>>7)throw new i.e("OID node too big");e[r]<<=7,e[r]|=127&t,128&t?o++:(r++,o=0)}),e}static encodeObjectIdentifierNodes(t){let e=[];for(let n=0;n<t.length;n++){let r=t[n];if(r<128){e.push(r);continue}let i=[];for(;0!==r;){let t=[255&r,r>>>8&255,r>>>16&255,r>>>24&255];0==(128&t[0])&&(t[0]|=128),i.unshift(t[0]),r>>=7}i[i.length-1]&=127,e=e.concat(i)}return e}}},function(t,e,n){t.exports=n(7)},function(t,e,n){"use strict";n.r(e);var r=n(2);n.d(e,"ASN1Element",function(){return r.a});var i=n(4);n.d(e,"DERElement",function(){return i.a});var o=n(0);n.d(e,"ASN1Error",function(){return o.c}),n.d(e,"ASN1NotImplementedError",function(){return o.d}),n.d(e,"ASN1RecursionError",function(){return o.g}),n.d(e,"ASN1TruncationError",function(){return o.i}),n.d(e,"ASN1OverflowError",function(){return o.e}),n.d(e,"ASN1SizeError",function(){return o.h}),n.d(e,"ASN1PaddingError",function(){return o.f}),n.d(e,"ASN1UndefinedError",function(){return o.j}),n.d(e,"ASN1CharactersError",function(){return o.a}),n.d(e,"ASN1ConstructionError",function(){return o.b});var u=n(3);n.d(e,"ObjectIdentifier",function(){return u.a});var s=n(1);n.d(e,"MAX_UINT_32",function(){return s.i}),n.d(e,"MIN_UINT_32",function(){return s.k}),n.d(e,"MAX_SINT_32",function(){return s.h}),n.d(e,"MIN_SINT_32",function(){return s.j}),n.d(e,"ASN1TagClass",function(){return s.e}),n.d(e,"ASN1Construction",function(){return s.a}),n.d(e,"LengthEncodingPreference",function(){return s.g}),n.d(e,"ASN1SpecialRealValue",function(){return s.d}),n.d(e,"ASN1RealEncodingBase",function(){return s.b}),n.d(e,"ASN1RealEncodingScale",function(){return s.c}),n.d(e,"ASN1UniversalType",function(){return s.f}),n.d(e,"printableStringCharacters",function(){return s.t}),n.d(e,"utcTimeRegex",function(){return s.u}),n.d(e,"distinguishedUTCTimeRegex",function(){return s.o}),n.d(e,"generalizedTimeRegex",function(){return s.p}),n.d(e,"distinguishedGeneralizedTimeRegex",function(){return s.m}),n.d(e,"nr1Regex",function(){return s.q}),n.d(e,"nr2Regex",function(){return s.r}),n.d(e,"nr3Regex",function(){return s.s}),n.d(e,"canonicalNR3Regex",function(){return s.l}),n.d(e,"distinguishedNR3Regex",function(){return s.n})},function(t,e,n){"use strict";(function(t){ | ||
var asn1=function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=6)}([function(t,e,n){"use strict";n.d(e,"c",function(){return r}),n.d(e,"d",function(){return i}),n.d(e,"g",function(){return o}),n.d(e,"i",function(){return u}),n.d(e,"e",function(){return s}),n.d(e,"h",function(){return a}),n.d(e,"f",function(){return c}),n.d(e,"j",function(){return h}),n.d(e,"a",function(){return f}),n.d(e,"b",function(){return l});class r extends Error{constructor(t){super(t),Object.setPrototypeOf(this,r.prototype)}}class i extends r{constructor(){super("Not yet implemented."),Object.setPrototypeOf(this,r.prototype)}}class o extends r{constructor(){super("Recursion was too deep."),Object.setPrototypeOf(this,r.prototype)}}class u extends r{constructor(t){super(t),Object.setPrototypeOf(this,r.prototype)}}class s extends r{constructor(t){super(t),Object.setPrototypeOf(this,r.prototype)}}class a extends r{constructor(t){super(t),Object.setPrototypeOf(this,r.prototype)}}class c extends r{constructor(t){super(t),Object.setPrototypeOf(this,r.prototype)}}class h extends r{constructor(t){super(t),Object.setPrototypeOf(this,r.prototype)}}class f extends r{constructor(t){super(t),Object.setPrototypeOf(this,r.prototype)}}class l extends r{constructor(t){super(t),Object.setPrototypeOf(this,r.prototype)}}},function(t,e,n){"use strict";n.d(e,"i",function(){return r}),n.d(e,"k",function(){return i}),n.d(e,"h",function(){return o}),n.d(e,"j",function(){return u}),n.d(e,"e",function(){return s}),n.d(e,"a",function(){return a}),n.d(e,"g",function(){return c}),n.d(e,"d",function(){return h}),n.d(e,"b",function(){return f}),n.d(e,"c",function(){return l}),n.d(e,"f",function(){return d}),n.d(e,"t",function(){return g}),n.d(e,"u",function(){return w}),n.d(e,"o",function(){return p}),n.d(e,"p",function(){return v}),n.d(e,"m",function(){return y}),n.d(e,"q",function(){return b}),n.d(e,"r",function(){return m}),n.d(e,"s",function(){return E}),n.d(e,"l",function(){return S}),n.d(e,"n",function(){return T});const r=4294967295,i=0,o=2147483647,u=-2147483648;var s,a,c,h,f,l,d;!function(t){t[t.universal=0]="universal",t[t.application=1]="application",t[t.context=3]="context",t[t.private=4]="private"}(s||(s={})),function(t){t[t.primitive=0]="primitive",t[t.constructed=1]="constructed"}(a||(a={})),function(t){t[t.definite=0]="definite",t[t.indefinite=1]="indefinite"}(c||(c={})),function(t){t[t.plusInfinity=64]="plusInfinity",t[t.minusInfinity=65]="minusInfinity",t[t.notANumber=66]="notANumber",t[t.minusZero=67]="minusZero"}(h||(h={})),function(t){t[t.base2=0]="base2",t[t.base8=16]="base8",t[t.base16=32]="base16"}(f||(f={})),function(t){t[t.scale0=0]="scale0",t[t.scale1=4]="scale1",t[t.scale2=8]="scale2",t[t.scale3=12]="scale3"}(l||(l={})),function(t){t[t.endOfContent=0]="endOfContent",t[t.boolean=1]="boolean",t[t.integer=2]="integer",t[t.bitString=3]="bitString",t[t.octetString=4]="octetString",t[t.nill=5]="nill",t[t.objectIdentifier=6]="objectIdentifier",t[t.objectDescriptor=7]="objectDescriptor",t[t.external=8]="external",t[t.realNumber=9]="realNumber",t[t.enumerated=10]="enumerated",t[t.embeddedPDV=11]="embeddedPDV",t[t.utf8String=12]="utf8String",t[t.relativeOID=13]="relativeOID",t[t.reserved14=14]="reserved14",t[t.reserved15=15]="reserved15",t[t.sequence=16]="sequence",t[t.set=17]="set",t[t.numericString=18]="numericString",t[t.printableString=19]="printableString",t[t.teletexString=20]="teletexString",t[t.videotexString=21]="videotexString",t[t.ia5String=22]="ia5String",t[t.utcTime=23]="utcTime",t[t.generalizedTime=24]="generalizedTime",t[t.graphicString=25]="graphicString",t[t.visibleString=26]="visibleString",t[t.generalString=27]="generalString",t[t.universalString=28]="universalString",t[t.characterString=29]="characterString",t[t.bmpString=30]="bmpString"}(d||(d={}));const g="etaoinsrhdlucmfywgpbvkxqjzETAOINSRHDLUCMFYWGPBVKXQJZ0123456789 '()+,-./:=?",w=/^(?<year>\d{2})(?<month>(?:1[0-2])|(?:0\d))(?<date>(?:3[01])|(?:[0-2]\d))(?<hour>(?:2[0-3])|(?:[01]\d))(?<minute>[0-5]\d)(?<second>[0-5]\d)?(?<offset>(?:(\+|\-)((?:2[0-3])|(?:[01]\d))[0-5]\d)|Z)$/,p=/^(?<year>\d{2})(?<month>(?:1[0-2])|(?:0\d))(?<date>(?:3[01])|(?:[0-2]\d))(?<hour>(?:2[0-3])|(?:[01]\d))(?<minute>[0-5]\d)(?<second>[0-5]\d)?Z$/,v=/^(?<year>\d{4})(?<month>(?:1[0-2])|(?:0\d))(?<date>(?:3[01])|(?:[0-2]\d))(?<hour>(?:2[0-3])|(?:[01]\d))(?<minute>[0-5]\d)?(?<second>[0-5]\d)?(?:(\.|,)(?<fraction>\d+))?(?<offset>(?:(\+|\-)((?:2[0-3])|(?:[01]\d))[0-5]\d)|Z)?$/,y=/^(?<year>\d{4})(?<month>(?:1[0-2])|(?:0\d))(?<date>(?:3[01])|(?:[0-2]\d))(?<hour>(?:2[0-3])|(?:[01]\d))(?<minute>[0-5]\d)(?<second>[0-5]\d)(?:(\.|,)(?<fraction>\d*[1-9]))?Z$/,b=/^\ *(\+|\-)?\d+$/,m=/^\ *(\+|\-)?(?:\d+(\.|,)\d*)|(?:\d*(\.|,)\d+)$/,E=/^\ *(\+|\-)?(?:\d+(\.|,)\d*)|(?:\d*(\.|,)\d+)(e|E)(\+|\-)?\d+$/,S=/^\ *\-?(?:[1-9]\d*)?[1-9]\.E(?:\+0)|(?:\-?[1-9]\d*)$/,T=/^\ *\-?(?:[1-9]\d*)?[1-9]\.E(?:\+0)|(?:\-?[1-9]\d*)$/},function(t,e,n){"use strict";n.d(e,"a",function(){return i});var r=n(0);class i{constructor(){this.recursionCount=0,this.tagClass=0,this.construction=0,this.tagNumber=0,this.value=new Uint8Array(0)}get length(){return this.value.length}static validateDateTime(t,e,n,i,o,u,s){switch(n){case 0:case 2:case 4:case 6:case 7:case 9:case 11:if(i>31)throw new r.c(`Day > 31 encountered in ${t} with 31-day month.`);break;case 3:case 5:case 8:case 10:if(i>30)throw new r.c(`Day > 31 encountered in ${t} with 30-day month.`);break;case 1:if(e%4==0&&e%100!=0||e%400==0){if(i>29)throw new r.c(`Day > 29 encountered in ${t} with month of February in leap year.`)}else if(i>28)throw new r.c(`Day > 28 encountered in ${t} with month of February and non leap year.`);break;default:throw new r.c(`Month greater than 12 encountered in ${t}.`)}if(o>23)throw new r.c(`Hours > 23 encountered in ${t}.`);if(u>59)throw new r.c(`Minutes > 60 encountered in ${t}.`);if(s>59)throw new r.c(`Seconds > 60 encountered in ${t}.`)}static decodeUnsignedBigEndianInteger(t){if(0===t.length)return 0;if(t.length>4)throw new r.e("Number too long to decode.");const e=new Uint8Array(4);return e.set(t,4-t.length),new Uint32Array(e.reverse().buffer)[0]}static decodeSignedBigEndianInteger(t){if(0===t.length)return 0;if(t.length>4)throw new r.e("Number too long to decode.");const e=new Uint8Array(4);return t[0]>=128&&e.fill(255),e.set(t,4-t.length),new Int32Array(e.reverse().buffer)[0]}}i.nestingRecursionLimit=5},function(t,e,n){"use strict";n.d(e,"a",function(){return r});class r{constructor(t){if(t.length<2)throw new Error("Cannot construct an OID with less than two nodes!");if(t.length>=1&&!(t[0]in[0,1,2]))throw new Error("OIDs first node must be 0, 1, or 2!");if(t[0]<2&&t[1]>39||2===t[0]&&t[1]>175)throw new Error(`OID Node #2 cannot exceed 39 if node #1 is 0 or 1, and 175 if node #1 is 2. Received these nodes: ${t}.`);t.forEach(t=>{if(t<0)throw new Error("OID node numbers cannot be negative!");if(t>Number.MAX_SAFE_INTEGER)throw new Error("OID number was too big!")}),this._nodes=t.slice(0)}get nodes(){return this._nodes.slice(0)}get dotDelimitedNotation(){return this._nodes.join(".")}toString(){return this.dotDelimitedNotation}}},function(t,e,n){"use strict";(function(t){n.d(e,"a",function(){return s});var r=n(2),i=n(0),o=n(1),u=n(5);class s extends u.a{set boolean(t){this.value=new Uint8Array(1),this.value[0]=t?255:0}get boolean(){if(0!==this.construction)throw new i.b("BOOLEAN cannot be constructed.");if(1!==this.value.length)throw new i.h("BOOLEAN not one byte");if(0!==this.value[0]&&255!==this.value[0])throw new i.c("BOOLEAN must be encoded as 0xFF or 0x00.");return 0!==this.value[0]}set bitString(t){0===t.length&&(this.value=new Uint8Array(0));let e=[];e.length=(t.length>>>3)+(t.length%8?1:0)+1;for(let n=0;n<t.length;n++)!1!==t[n]&&(e[1+(n>>>3)]|=128>>>n%8);e[0]=8-t.length%8,8===e[0]&&(e[0]=0),this.value=new Uint8Array(e)}get bitString(){if(0!==this.construction)throw new i.b("BIT STRING cannot be constructed.");if(0===this.value.length)throw new i.c("ASN.1 BIT STRING cannot be encoded on zero bytes!");if(1===this.value.length&&0!==this.value[0])throw new i.c("ASN.1 BIT STRING encoded with deceptive first byte!");if(this.value[0]>7)throw new i.c("First byte of an ASN.1 BIT STRING must be <= 7!");let t=[];for(let e=1;e<this.value.length;e++)t=t.concat([!!(128&this.value[e]),!!(64&this.value[e]),!!(32&this.value[e]),!!(16&this.value[e]),!!(8&this.value[e]),!!(4&this.value[e]),!!(2&this.value[e]),!!(1&this.value[e])]);return t.slice(t.length-this.value[0]).forEach(t=>{if(t)throw new i.c("BIT STRING had a trailing set bit.")}),t.length-=this.value[0],t}set octetString(t){this.value=t.subarray(0)}get octetString(){if(0!==this.construction)throw new i.b("OCTET STRING cannot be constructed.");return this.value.subarray(0)}set objectDescriptor(t){this.graphicString=t}get objectDescriptor(){return this.graphicString}set real(t){if(0===t)return void(this.value=new Uint8Array(0));if(isNaN(t))return void(this.value=new Uint8Array([66]));if(-0===t)return void(this.value=new Uint8Array([67]));if(t===1/0)return void(this.value=new Uint8Array([64]));if(t===-1/0)return void(this.value=new Uint8Array([65]));let e=t.toFixed(7);e=String.fromCharCode(3)+e,this.value=(new TextEncoder).encode(e)}get real(){if(0!==this.construction)throw new i.b("REAL cannot be constructed.");if(0===this.value.length)return 0;switch(192&this.value[0]){case 64:if(66===this.value[0])return NaN;if(67===this.value[0])return-0;if(64===this.value[0])return 1/0;if(65===this.value[0])return-1/0;throw new i.j("Unrecognized special REAL value!");case 0:{let e;if("undefined"!=typeof TextEncoder)e=new TextDecoder("utf-8").decode(this.value.slice(1));else{if(void 0===t)throw new i.c("No ability to decode bytes to string!");e=new t(this.value.slice(1)).toString("utf-8")}switch(63&this.value[0]){case 1:case 2:throw new i.c("DER prohibits NR1 and NR2 Base-10 REAL");case 3:if(!o.s.test(e))throw new i.c("Malformed NR3 Base-10 REAL");return parseFloat(e.replace(",","."));default:throw new i.j("Undefined Base-10 REAL encoding.")}}case 128:case 192:{const t=64&this.value[0]?-1:1,e=(t=>{switch(this.value[0]&48){case 0:return 2;case 16:return 8;case 32:return 16;default:throw new i.c("Impossible REAL encoding base encountered.")}})(),n=(t=>{switch(this.value[0]&12){case 0:return 0;case 4:return 1;case 8:return 2;case 12:return 3;default:throw new i.c("Impossible REAL encoding scale encountered.")}})();let o,u;switch(3&this.value[0]){case 0:if(this.value.length<3)throw new i.i("Binary-encoded REAL truncated.");o=r.a.decodeSignedBigEndianInteger(this.value.subarray(1,2)),u=r.a.decodeUnsignedBigEndianInteger(this.value.subarray(2));break;case 1:if(this.value.length<4)throw new i.i("Binary-encoded REAL truncated.");if(o=r.a.decodeSignedBigEndianInteger(this.value.subarray(1,3)),u=r.a.decodeUnsignedBigEndianInteger(this.value.subarray(3)),o<=127&&o>=-128)throw new i.c("DER-encoded binary-encoded REAL could have encoded exponent on fewer octets.");break;case 2:case 3:throw new i.c("DER-encoded binary REAL encoded in a way that would either overflow or encode on too many octets.");default:throw new i.c("Impossible binary REAL exponent encoding encountered.")}if(0!==u&&!(u%2))throw new i.c("DER-encoded REAL may not have an even non-zero mantissa.");return t*u*Math.pow(2,n)*Math.pow(e,o)}default:throw new i.c("Impossible REAL format encountered.")}}set utf8String(e){"undefined"!=typeof TextEncoder?this.value=(new TextEncoder).encode(e):void 0!==t&&(this.value=t.from(e,"utf-8"))}get utf8String(){if(0!==this.construction)throw new i.b("UTF8String cannot be constructed.");let e="";return"undefined"!=typeof TextEncoder?e=new TextDecoder("utf-8").decode(this.value.subarray(0).buffer):void 0!==t&&(e=new t(this.value).toString("utf-8")),e}set sequence(t){let e=[];t.forEach(t=>{e.push(t.toBytes())});let n=0;e.forEach(t=>{n+=t.length});const r=new Uint8Array(n);let i=0;e.forEach(t=>{r.set(t,i),i+=t.length}),this.value=r,this.construction=1}get sequence(){if(1!==this.construction)throw new i.b("SET or SEQUENCE cannot be primitively constructed.");let t=[];if(0===this.value.length)return[];let e=0;for(;e<this.value.length;){const n=new s;e+=n.fromBytes(this.value.slice(e)),t.push(n)}return t}set set(t){this.sequence=t}get set(){return this.sequence}set numericString(e){for(let t=0;t<e.length;t++){const n=e.charCodeAt(t);if(!(n>=48&&n<=57||32===n))throw new i.a("NumericString can only contain characters 0 - 9 and space.")}"undefined"!=typeof TextEncoder?this.value=(new TextEncoder).encode(e):void 0!==t&&(this.value=t.from(e,"utf-8"))}get numericString(){if(0!==this.construction)throw new i.b("NumericString cannot be constructed.");let e="";"undefined"!=typeof TextEncoder?e=new TextDecoder("utf-8").decode(this.value.subarray(0).buffer):void 0!==t&&(e=new t(this.value).toString("utf-8"));for(let t=0;t<e.length;t++){const n=e.charCodeAt(t);if(!(n>=48&&n<=57||32===n))throw new i.a("NumericString can only contain characters 0 - 9 and space.")}return e}set printableString(e){for(let t=0;t<e.length;t++)if(-1===o.t.indexOf(e.charAt(t)))throw new i.a(`PrintableString can only contain these characters: ${o.t}`);"undefined"!=typeof TextEncoder?this.value=(new TextEncoder).encode(e):void 0!==t&&(this.value=t.from(e,"utf-8"))}get printableString(){if(0!==this.construction)throw new i.b("PrintableString cannot be constructed.");let e="";"undefined"!=typeof TextEncoder?e=new TextDecoder("utf-8").decode(this.value.subarray(0).buffer):void 0!==t&&(e=new t(this.value).toString("utf-8"));for(let t=0;t<e.length;t++)if(-1===o.t.indexOf(e.charAt(t)))throw new i.a(`PrintableString can only contain these characters: ${o.t}`);return e}set teletexString(t){this.value=t.subarray(0)}get teletexString(){return this.octetString}set videotexString(t){this.value=t.subarray(0)}get videotexString(){return this.octetString}set ia5String(e){"undefined"!=typeof TextEncoder?this.value=(new TextEncoder).encode(e):void 0!==t&&(this.value=t.from(e,"utf-8"))}get ia5String(){if(0!==this.construction)throw new i.b("IA5String cannot be constructed.");let e="";return"undefined"!=typeof TextEncoder?e=new TextDecoder("utf-8").decode(this.value.subarray(0).buffer):void 0!==t&&(e=new t(this.value).toString("utf-8")),e}set utcTime(e){let n=e.getUTCFullYear().toString();const r=`${n=n.substring(n.length-2,n.length)}${e.getUTCMonth()<9?`0${e.getUTCMonth()+1}`:`${e.getUTCMonth()+1}`}${e.getUTCDate()<10?`0${e.getUTCDate()}`:`${e.getUTCDate()}`}${e.getUTCHours()<10?`0${e.getUTCHours()}`:`${e.getUTCHours()}`}${e.getUTCMinutes()<10?`0${e.getUTCMinutes()}`:`${e.getUTCMinutes()}`}${e.getUTCSeconds()<10?`0${e.getUTCSeconds()}`:`${e.getUTCSeconds()}`}Z`;"undefined"!=typeof TextEncoder?this.value=(new TextEncoder).encode(r):void 0!==t&&(this.value=t.from(r,"utf-8"))}get utcTime(){if(0!==this.construction)throw new i.b("UTCTime cannot be constructed.");let e="";"undefined"!=typeof TextEncoder?e=new TextDecoder("utf-8").decode(this.value.subarray(0).buffer):void 0!==t&&(e=new t(this.value).toString("utf-8"));const n=o.u.exec(e);if(null===n)throw new i.c("Malformed UTCTime string.");if(void 0===n.groups)throw new i.c("Malformed UTCTime string.");const r=new Date;let u=Number(n.groups.year);u=u<70?2e3+u:1900+u;const a=Number(n.groups.month)-1,c=Number(n.groups.date),h=Number(n.groups.hour),f=Number(n.groups.minute),l=Number(n.groups.second);return s.validateDateTime("UTCTime",u,a,c,h,f,l),r.setUTCFullYear(u),r.setUTCMonth(a),r.setUTCDate(c),r.setUTCHours(h),r.setUTCMinutes(f),r.setUTCSeconds(l),r}set generalizedTime(e){const n=`${e.getUTCFullYear().toString()}${e.getUTCMonth()<9?`0${e.getUTCMonth()+1}`:`${e.getUTCMonth()+1}`}${e.getUTCDate()<10?`0${e.getUTCDate()}`:`${e.getUTCDate()}`}${e.getUTCHours()<10?`0${e.getUTCHours()}`:`${e.getUTCHours()}`}${e.getUTCMinutes()<10?`0${e.getUTCMinutes()}`:`${e.getUTCMinutes()}`}${e.getUTCSeconds()<10?`0${e.getUTCSeconds()}`:`${e.getUTCSeconds()}`}Z`;"undefined"!=typeof TextEncoder?this.value=(new TextEncoder).encode(n):void 0!==t&&(this.value=t.from(n,"utf-8"))}get generalizedTime(){if(0!==this.construction)throw new i.b("GeneralizedTime cannot be constructed.");let e="";"undefined"!=typeof TextEncoder?e=new TextDecoder("utf-8").decode(this.value.subarray(0).buffer):void 0!==t&&(e=new t(this.value).toString("utf-8"));const n=o.p.exec(e);if(null===n)throw new i.c("Malformed GeneralizedTime string.");if(void 0===n.groups)throw new i.c("Malformed GeneralizedTime string.");const r=new Date,u=Number(n.groups.year),a=Number(n.groups.month)-1,c=Number(n.groups.date),h=Number(n.groups.hour),f=Number(n.groups.minute),l=Number(n.groups.second);return s.validateDateTime("GeneralizedTime",u,a,c,h,f,l),r.setUTCFullYear(u),r.setUTCMonth(a),r.setUTCDate(c),r.setUTCHours(h),r.setUTCMinutes(f),r.setUTCSeconds(l),r}set graphicString(e){for(let t=0;t<e.length;t++){const n=e.charCodeAt(t);if(n<32||n>126)throw new i.a("GraphicString, VisibleString, or ObjectDescriptor can only contain characters between 0x20 and 0x7E.")}"undefined"!=typeof TextEncoder?this.value=(new TextEncoder).encode(e):void 0!==t&&(this.value=t.from(e,"utf-8"))}get graphicString(){if(0!==this.construction)throw new i.b("GraphicString cannot be constructed.");let e="";"undefined"!=typeof TextEncoder?e=new TextDecoder("utf-8").decode(this.value.subarray(0).buffer):void 0!==t&&(e=new t(this.value).toString("utf-8"));for(let t=0;t<e.length;t++){const n=e.charCodeAt(t);if(n<32||n>126)throw new i.a("GraphicString, VisibleString, or ObjectDescriptor can only contain characters between 0x20 and 0x7E.")}return e}set visibleString(t){this.graphicString=t}get visibleString(){return this.graphicString}set generalString(e){for(let t=0;t<e.length;t++)if(e.charCodeAt(t)>127)throw new i.a("GeneralString can only contain ASCII characters.");"undefined"!=typeof TextEncoder?this.value=(new TextEncoder).encode(e):void 0!==t&&(this.value=t.from(e,"ascii"))}get generalString(){if(0!==this.construction)throw new i.b("GeneralString cannot be constructed.");let e="";"undefined"!=typeof TextEncoder?e=new TextDecoder("windows-1252").decode(this.value.subarray(0).buffer):void 0!==t&&(e=new t(this.value).toString("ascii"));for(let t=0;t<e.length;t++)if(e.charCodeAt(t)>127)throw new i.a("GeneralString can only contain ASCII characters.");return e}set universalString(t){const e=new Uint8Array(t.length<<2);for(let n=0;n<t.length;n++)e[n<<2]=t.charCodeAt(n)>>>24,e[1+(n<<2)]=t.charCodeAt(n)>>>16,e[2+(n<<2)]=t.charCodeAt(n)>>>8,e[3+(n<<2)]=t.charCodeAt(n);this.value=e}get universalString(){if(0!==this.construction)throw new i.b("UniversalString cannot be constructed.");if(this.value.length%4)throw new i.c("UniversalString encoded on non-mulitple of four bytes.");let t="";for(let e=0;e<this.value.length;e+=4)t+=String.fromCharCode((this.value[e+0]<<24)+(this.value[e+1]<<16)+(this.value[e+2]<<8)+(this.value[e+3]<<0));return t}set bmpString(t){const e=new Uint8Array(t.length<<1);for(let n=0,r=t.length;n<r;n++)e[n<<1]=t.charCodeAt(n)>>>8,e[1+(n<<1)]=t.charCodeAt(n);this.value=e}get bmpString(){if(0!==this.construction)throw new i.b("BMPString cannot be constructed.");if(this.value.length%2)throw new i.c("BMPString encoded on non-mulitple of two bytes.");let e="";if("undefined"!=typeof TextEncoder)e=new TextDecoder("utf-16be").decode(this.value.subarray(0).buffer);else if(void 0!==t){const n=new Uint8Array(this.value.length);for(let t=0;t<this.value.length;t+=2)n[t]=this.value[t+1],n[t+1]=this.value[t];e=new t(n).toString("utf-16le")}return e}constructor(t=0,e=0,n=0){super(),this.tagClass=t,this.construction=e,this.tagNumber=n,this.value=new Uint8Array(0)}fromBytes(t){if(t.length<2)throw new i.i("Tried to decode a DER element that is less than two bytes.");if(this.recursionCount+1>s.nestingRecursionLimit)throw new i.g;let e=0;switch(192&t[e]){case 0:this.tagClass=0;break;case 64:this.tagClass=1;break;case 128:this.tagClass=3;break;case 192:this.tagClass=4;break;default:this.tagClass=0}if(this.construction=32&t[e]?1:0,this.tagNumber=31&t[e],e++,this.tagNumber>=31){if(128===t[e])throw new i.f("Leading padding byte on long tag number encoding.");this.tagNumber=0;const n=t.length-1>=4?4:t.length-1;for(;e<n&&128&t[e++];);if(128&t[e-1])throw n===t.length-1?new i.i("ASN.1 tag number appears to have been truncated."):new i.e("ASN.1 tag number too large.");for(let n=1;n<e;n++)this.tagNumber<<=7,this.tagNumber|=127&t[n];if(this.tagNumber<=31)throw new i.c("ASN.1 tag number could have been encoded in short form.")}if(128==(128&t[e])){const n=127&t[e];if(127===n)throw new i.j("Length byte with undefined meaning encountered.");if(n>4)throw new i.e("Element length too long to decode to an integer.");if(e+n>=t.length)throw new i.i("Element length bytes appear to have been truncated.");e++;const r=new Uint8Array(4);for(let i=n;i>0;i--)r[4-i]=t[e+n-i];let o=0;if(r.forEach(t=>{o<<=8,o+=t}),e+o<e)throw new i.e("ASN.1 element too large.");if((e+=n)+o>t.length)throw new i.i("ASN.1 element truncated.");if(o<=127&&o>=-128&&n>1||o<=32767&&o>=-32768&&n>2||o<=8388607&&o>=-8388608&&n>3)throw new i.f("DER-encoded long-form length encoded on more octets than necessary");return this.value=t.slice(e,e+o),e+o}{const n=127&t[e++];if(e+n>t.length)throw new i.i("ASN.1 element was truncated.");return this.value=t.slice(e,e+n),e+n}}toBytes(){let t=[0];if(t[0]|=this.tagClass<<6,t[0]|=this.construction<<5,this.tagNumber<31)t[0]|=this.tagNumber;else{t[0]|=31;let e=this.tagNumber,n=[];for(;0!==e;)n.unshift(127&e),e>>>=7,n[0]|=128;n[n.length-1]&=127,t=t.concat(n)}let e=[0];if(this.value.length<127)e=[this.value.length];else{let t=this.value.length;e=[0,0,0,0];for(let n=0;n<4;n++)e[n]=t>>>(3-n<<3)&255;let n=0;for(let t=0;t<e.length-1;t++)0===e[t]&&n++;(e=e.slice(n)).unshift(128|e.length)}const n=new Uint8Array(t.length+e.length+this.value.length);return n.set(t,0),n.set(e,t.length),n.set(this.value,t.length+e.length),n}}}).call(this,n(8).Buffer)},function(t,e,n){"use strict";n.d(e,"a",function(){return s});var r=n(2),i=n(0),o=n(3),u=n(1);class s extends r.a{validateTag(t,e,n){return t.includes(this.tagClass)?e.includes(this.construction)?n.includes(this.tagNumber)?0:-3:-2:-1}set integer(t){if(t<u.j)throw new i.e(`Number ${t} too small to be converted.`);if(t>u.h)throw new i.e(`Number ${t} too big to be converted.`);return t<=127&&t>=-128?void(this.value=new Uint8Array([255&t])):t<=32767&&t>=-32768?void(this.value=new Uint8Array([t>>8&255,255&t])):t<=8388607&&t>=-8388608?void(this.value=new Uint8Array([t>>16&255,t>>8&255,255&t])):void(this.value=new Uint8Array([t>>24&255,t>>16&255,t>>8&255,255&t]))}get integer(){if(0!==this.construction)throw new i.b("INTEGER cannot be constructed.");if(0===this.value.length)throw new i.h("Number encoded on zero bytes!");if(this.value.length>4)throw new i.e("Number too long to decode.");if(this.value.length>2&&(255===this.value[0]&&this.value[1]>=128||0===this.value[0]&&this.value[1]<128))throw new i.f("Unnecessary padding bytes on INTEGER or ENUMERATED.");return r.a.decodeSignedBigEndianInteger(this.value.subarray(0))}set objectIdentifier(t){const e=t.nodes;let n=[40*e[0]+e[1]],r=s.encodeObjectIdentifierNodes(e.slice(2));this.value=new Uint8Array(n.concat(r))}get objectIdentifier(){if(0!==this.construction)throw new i.b("OBJECT IDENTIFIER cannot be constructed.");if(0===this.value.length)throw new i.i("Encoded value was too short to be an OBJECT IDENTIFIER!");let t=[0,0];return this.value[0]>=80?(t[0]=2,t[1]=this.value[0]-80):this.value[0]>=40?(t[0]=1,t[1]=this.value[0]-40):(t[0]=0,t[1]=this.value[0]),1===this.value.length?new o.a(t):(t=t.concat(s.decodeObjectIdentifierNodes(this.value.slice(1))),new o.a(t))}set enumerated(t){this.integer=t}get enumerated(){return this.integer}set relativeObjectIdentifier(t){this.value=new Uint8Array(s.encodeObjectIdentifierNodes(t))}get relativeObjectIdentifier(){if(0!==this.construction)throw new i.b("Relative OID cannot be constructed.");return s.decodeObjectIdentifierNodes(this.value.slice(0))}static decodeObjectIdentifierNodes(t){if(0===t.length)return[];let e=[];if(t.length>0&&128==(128&t[t.length-1]))throw new i.i("OID truncated");let n=0;t.forEach(t=>{128&t||n++}),e.length=n;let r=0,o=0;return t.forEach(t=>{if(0===o&&128===t)throw new i.f("OID had invalid padding byte.");if(e[r]>Number.MAX_SAFE_INTEGER>>>7)throw new i.e("OID node too big");e[r]<<=7,e[r]|=127&t,128&t?o++:(r++,o=0)}),e}static encodeObjectIdentifierNodes(t){let e=[];for(let n=0;n<t.length;n++){let r=t[n];if(r<128){e.push(r);continue}let i=[];for(;0!==r;){let t=[255&r,r>>>8&255,r>>>16&255,r>>>24&255];0==(128&t[0])&&(t[0]|=128),i.unshift(t[0]),r>>=7}i[i.length-1]&=127,e=e.concat(i)}return e}}},function(t,e,n){t.exports=n(7)},function(t,e,n){"use strict";n.r(e);var r=n(2);n.d(e,"ASN1Element",function(){return r.a});var i=n(4);n.d(e,"DERElement",function(){return i.a});var o=n(0);n.d(e,"ASN1Error",function(){return o.c}),n.d(e,"ASN1NotImplementedError",function(){return o.d}),n.d(e,"ASN1RecursionError",function(){return o.g}),n.d(e,"ASN1TruncationError",function(){return o.i}),n.d(e,"ASN1OverflowError",function(){return o.e}),n.d(e,"ASN1SizeError",function(){return o.h}),n.d(e,"ASN1PaddingError",function(){return o.f}),n.d(e,"ASN1UndefinedError",function(){return o.j}),n.d(e,"ASN1CharactersError",function(){return o.a}),n.d(e,"ASN1ConstructionError",function(){return o.b});var u=n(3);n.d(e,"ObjectIdentifier",function(){return u.a});var s=n(1);n.d(e,"MAX_UINT_32",function(){return s.i}),n.d(e,"MIN_UINT_32",function(){return s.k}),n.d(e,"MAX_SINT_32",function(){return s.h}),n.d(e,"MIN_SINT_32",function(){return s.j}),n.d(e,"ASN1TagClass",function(){return s.e}),n.d(e,"ASN1Construction",function(){return s.a}),n.d(e,"LengthEncodingPreference",function(){return s.g}),n.d(e,"ASN1SpecialRealValue",function(){return s.d}),n.d(e,"ASN1RealEncodingBase",function(){return s.b}),n.d(e,"ASN1RealEncodingScale",function(){return s.c}),n.d(e,"ASN1UniversalType",function(){return s.f}),n.d(e,"printableStringCharacters",function(){return s.t}),n.d(e,"utcTimeRegex",function(){return s.u}),n.d(e,"distinguishedUTCTimeRegex",function(){return s.o}),n.d(e,"generalizedTimeRegex",function(){return s.p}),n.d(e,"distinguishedGeneralizedTimeRegex",function(){return s.m}),n.d(e,"nr1Regex",function(){return s.q}),n.d(e,"nr2Regex",function(){return s.r}),n.d(e,"nr3Regex",function(){return s.s}),n.d(e,"canonicalNR3Regex",function(){return s.l}),n.d(e,"distinguishedNR3Regex",function(){return s.n})},function(t,e,n){"use strict";(function(t){ | ||
/*! | ||
@@ -3,0 +3,0 @@ * The buffer module from node.js, for the browser. |
@@ -57,3 +57,3 @@ { | ||
"types": "./dist/types/index.d.ts", | ||
"version": "1.3.0" | ||
"version": "1.3.1" | ||
} |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
369398