Files
sysPass/public/vendor/js/jsencrypt.min.js
Rubén D a2ac8731f8 * [MOD] Updated copyright
Signed-off-by: Rubén D <nuxsmin@syspass.org>
2020-12-08 10:10:10 +01:00

109 lines
52 KiB
JavaScript

/*
JSEncrypt v2.3.0 | https://npmcdn.com/jsencrypt@2.3.0/LICENSE.txt asn1-1.0.2.js (c) 2013 Kenji Urushima | kjur.github.com/jsrsasign/license
<a href="http://kjur.github.io/jsrsasign/license/">MIT License</a>
*/
var JSEncryptExports={};
(function(M){function f(a,b,c){null!=a&&("number"==typeof a?this.fromNumber(a,b,c):null==b&&"string"!=typeof a?this.fromString(a,256):this.fromString(a,b))}function n(){return new f(null)}function X(a,b,c,d,e,h){for(;0<=--h;){var g=b*this[a++]+c[d]+e;e=Math.floor(g/67108864);c[d++]=g&67108863}return e}function Y(a,b,c,d,e,h){var g=b&32767;for(b>>=15;0<=--h;){var k=this[a]&32767,f=this[a++]>>15,r=b*k+f*g;k=g*k+((r&32767)<<15)+c[d]+(e&1073741823);e=(k>>>30)+(r>>>15)+b*f+(e>>>30);c[d++]=k&1073741823}return e}
function Z(a,b,c,d,e,h){var g=b&16383;for(b>>=14;0<=--h;){var k=this[a]&16383,f=this[a++]>>14,r=b*k+f*g;k=g*k+((r&16383)<<14)+c[d]+e;e=(k>>28)+(r>>14)+b*f;c[d++]=k&268435455}return e}function R(a,b){a=G[a.charCodeAt(b)];return null==a?-1:a}function z(a){var b=n();b.fromInt(a);return b}function H(a){var b=1,c;0!=(c=a>>>16)&&(a=c,b+=16);0!=(c=a>>8)&&(a=c,b+=8);0!=(c=a>>4)&&(a=c,b+=4);0!=(c=a>>2)&&(a=c,b+=2);0!=a>>1&&(b+=1);return b}function A(a){this.m=a}function B(a){this.m=a;this.mp=a.invDigit();
this.mpl=this.mp&32767;this.mph=this.mp>>15;this.um=(1<<a.DB-15)-1;this.mt2=2*a.t}function aa(a,b){return a&b}function I(a,b){return a|b}function S(a,b){return a^b}function T(a,b){return a&~b}function E(){}function U(a){return a}function D(a){this.r2=n();this.q3=n();f.ONE.dlShiftTo(2*a.t,this.r2);this.mu=this.r2.divide(a);this.m=a}function N(){this.j=this.i=0;this.S=[]}function J(){}function m(a,b){return new f(a,b)}function p(){this.n=null;this.e=0;this.coeff=this.dmq1=this.dmp1=this.q=this.p=this.d=
null}function O(a){var b,c="";for(b=0;b+3<=a.length;b+=3){var d=parseInt(a.substring(b,b+3),16);c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(d>>6)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(d&63)}b+1==a.length?(d=parseInt(a.substring(b,b+1),16),c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(d<<2)):b+2==a.length&&(d=parseInt(a.substring(b,b+2),16),c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(d>>
2)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((d&3)<<4));for(;0<(c.length&3);)c+="=";return c}function ba(a){var b="",c,d=0;for(c=0;c<a.length&&"="!=a.charAt(c);++c)if(v="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(a.charAt(c)),!(0>v))if(0==d){b+="0123456789abcdefghijklmnopqrstuvwxyz".charAt(v>>2);var e=v&3;d=1}else 1==d?(b+="0123456789abcdefghijklmnopqrstuvwxyz".charAt(e<<2|v>>4),e=v&15,d=2):2==d?(b+="0123456789abcdefghijklmnopqrstuvwxyz".charAt(e),
b+="0123456789abcdefghijklmnopqrstuvwxyz".charAt(v>>2),e=v&3,d=3):(b+="0123456789abcdefghijklmnopqrstuvwxyz".charAt(e<<2|v>>4),b+="0123456789abcdefghijklmnopqrstuvwxyz".charAt(v&15),d=0);1==d&&(b+="0123456789abcdefghijklmnopqrstuvwxyz".charAt(e<<2));return b}if("Microsoft Internet Explorer"==navigator.appName){f.prototype.am=Y;var q=30}else"Netscape"!=navigator.appName?(f.prototype.am=X,q=26):(f.prototype.am=Z,q=28);f.prototype.DB=q;f.prototype.DM=(1<<q)-1;f.prototype.DV=1<<q;f.prototype.FV=Math.pow(2,
52);f.prototype.F1=52-q;f.prototype.F2=2*q-52;var G=[],u;q=48;for(u=0;9>=u;++u)G[q++]=u;q=97;for(u=10;36>u;++u)G[q++]=u;q=65;for(u=10;36>u;++u)G[q++]=u;A.prototype.convert=function(a){return 0>a.s||0<=a.compareTo(this.m)?a.mod(this.m):a};A.prototype.revert=function(a){return a};A.prototype.reduce=function(a){a.divRemTo(this.m,null,a)};A.prototype.mulTo=function(a,b,c){a.multiplyTo(b,c);this.reduce(c)};A.prototype.sqrTo=function(a,b){a.squareTo(b);this.reduce(b)};B.prototype.convert=function(a){var b=
n();a.abs().dlShiftTo(this.m.t,b);b.divRemTo(this.m,null,b);0>a.s&&0<b.compareTo(f.ZERO)&&this.m.subTo(b,b);return b};B.prototype.revert=function(a){var b=n();a.copyTo(b);this.reduce(b);return b};B.prototype.reduce=function(a){for(;a.t<=this.mt2;)a[a.t++]=0;for(var b=0;b<this.m.t;++b){var c=a[b]&32767,d=c*this.mpl+((c*this.mph+(a[b]>>15)*this.mpl&this.um)<<15)&a.DM;c=b+this.m.t;for(a[c]+=this.m.am(0,d,a,b,0,this.m.t);a[c]>=a.DV;)a[c]-=a.DV,a[++c]++}a.clamp();a.drShiftTo(this.m.t,a);0<=a.compareTo(this.m)&&
a.subTo(this.m,a)};B.prototype.mulTo=function(a,b,c){a.multiplyTo(b,c);this.reduce(c)};B.prototype.sqrTo=function(a,b){a.squareTo(b);this.reduce(b)};f.prototype.copyTo=function(a){for(var b=this.t-1;0<=b;--b)a[b]=this[b];a.t=this.t;a.s=this.s};f.prototype.fromInt=function(a){this.t=1;this.s=0>a?-1:0;0<a?this[0]=a:-1>a?this[0]=a+this.DV:this.t=0};f.prototype.fromString=function(a,b){if(16==b)b=4;else if(8==b)b=3;else if(256==b)b=8;else if(2==b)b=1;else if(32==b)b=5;else if(4==b)b=2;else{this.fromRadix(a,
b);return}this.s=this.t=0;for(var c=a.length,d=!1,e=0;0<=--c;){var h=8==b?a[c]&255:R(a,c);0>h?"-"==a.charAt(c)&&(d=!0):(d=!1,0==e?this[this.t++]=h:e+b>this.DB?(this[this.t-1]|=(h&(1<<this.DB-e)-1)<<e,this[this.t++]=h>>this.DB-e):this[this.t-1]|=h<<e,e+=b,e>=this.DB&&(e-=this.DB))}8==b&&0!=(a[0]&128)&&(this.s=-1,0<e&&(this[this.t-1]|=(1<<this.DB-e)-1<<e));this.clamp();d&&f.ZERO.subTo(this,this)};f.prototype.clamp=function(){for(var a=this.s&this.DM;0<this.t&&this[this.t-1]==a;)--this.t};f.prototype.dlShiftTo=
function(a,b){var c;for(c=this.t-1;0<=c;--c)b[c+a]=this[c];for(c=a-1;0<=c;--c)b[c]=0;b.t=this.t+a;b.s=this.s};f.prototype.drShiftTo=function(a,b){for(var c=a;c<this.t;++c)b[c-a]=this[c];b.t=Math.max(this.t-a,0);b.s=this.s};f.prototype.lShiftTo=function(a,b){var c=a%this.DB,d=this.DB-c,e=(1<<d)-1;a=Math.floor(a/this.DB);var h=this.s<<c&this.DM,g;for(g=this.t-1;0<=g;--g)b[g+a+1]=this[g]>>d|h,h=(this[g]&e)<<c;for(g=a-1;0<=g;--g)b[g]=0;b[a]=h;b.t=this.t+a+1;b.s=this.s;b.clamp()};f.prototype.rShiftTo=
function(a,b){b.s=this.s;var c=Math.floor(a/this.DB);if(c>=this.t)b.t=0;else{a%=this.DB;var d=this.DB-a,e=(1<<a)-1;b[0]=this[c]>>a;for(var h=c+1;h<this.t;++h)b[h-c-1]|=(this[h]&e)<<d,b[h-c]=this[h]>>a;0<a&&(b[this.t-c-1]|=(this.s&e)<<d);b.t=this.t-c;b.clamp()}};f.prototype.subTo=function(a,b){for(var c=0,d=0,e=Math.min(a.t,this.t);c<e;)d+=this[c]-a[c],b[c++]=d&this.DM,d>>=this.DB;if(a.t<this.t){for(d-=a.s;c<this.t;)d+=this[c],b[c++]=d&this.DM,d>>=this.DB;d+=this.s}else{for(d+=this.s;c<a.t;)d-=a[c],
b[c++]=d&this.DM,d>>=this.DB;d-=a.s}b.s=0>d?-1:0;-1>d?b[c++]=this.DV+d:0<d&&(b[c++]=d);b.t=c;b.clamp()};f.prototype.multiplyTo=function(a,b){var c=this.abs(),d=a.abs(),e=c.t;for(b.t=e+d.t;0<=--e;)b[e]=0;for(e=0;e<d.t;++e)b[e+c.t]=c.am(0,d[e],b,e,0,c.t);b.s=0;b.clamp();this.s!=a.s&&f.ZERO.subTo(b,b)};f.prototype.squareTo=function(a){for(var b=this.abs(),c=a.t=2*b.t;0<=--c;)a[c]=0;for(c=0;c<b.t-1;++c){var d=b.am(c,b[c],a,2*c,0,1);(a[c+b.t]+=b.am(c+1,2*b[c],a,2*c+1,d,b.t-c-1))>=b.DV&&(a[c+b.t]-=b.DV,
a[c+b.t+1]=1)}0<a.t&&(a[a.t-1]+=b.am(c,b[c],a,2*c,0,1));a.s=0;a.clamp()};f.prototype.divRemTo=function(a,b,c){var d=a.abs();if(!(0>=d.t)){var e=this.abs();if(e.t<d.t)null!=b&&b.fromInt(0),null!=c&&this.copyTo(c);else{null==c&&(c=n());var h=n(),g=this.s;a=a.s;var k=this.DB-H(d[d.t-1]);0<k?(d.lShiftTo(k,h),e.lShiftTo(k,c)):(d.copyTo(h),e.copyTo(c));d=h.t;e=h[d-1];if(0!=e){var x=e*(1<<this.F1)+(1<d?h[d-2]>>this.F2:0),r=this.FV/x;x=(1<<this.F1)/x;var l=1<<this.F2,t=c.t,p=t-d,m=null==b?n():b;h.dlShiftTo(p,
m);0<=c.compareTo(m)&&(c[c.t++]=1,c.subTo(m,c));f.ONE.dlShiftTo(d,m);for(m.subTo(h,h);h.t<d;)h[h.t++]=0;for(;0<=--p;){var q=c[--t]==e?this.DM:Math.floor(c[t]*r+(c[t-1]+l)*x);if((c[t]+=h.am(0,q,c,p,0,d))<q)for(h.dlShiftTo(p,m),c.subTo(m,c);c[t]<--q;)c.subTo(m,c)}null!=b&&(c.drShiftTo(d,b),g!=a&&f.ZERO.subTo(b,b));c.t=d;c.clamp();0<k&&c.rShiftTo(k,c);0>g&&f.ZERO.subTo(c,c)}}}};f.prototype.invDigit=function(){if(1>this.t)return 0;var a=this[0];if(0==(a&1))return 0;var b=a&3;b=b*(2-(a&15)*b)&15;b=b*(2-
(a&255)*b)&255;b=b*(2-((a&65535)*b&65535))&65535;b=b*(2-a*b%this.DV)%this.DV;return 0<b?this.DV-b:-b};f.prototype.isEven=function(){return 0==(0<this.t?this[0]&1:this.s)};f.prototype.exp=function(a,b){if(4294967295<a||1>a)return f.ONE;var c=n(),d=n(),e=b.convert(this),h=H(a)-1;for(e.copyTo(c);0<=--h;)if(b.sqrTo(c,d),0<(a&1<<h))b.mulTo(d,e,c);else{var g=c;c=d;d=g}return b.revert(c)};f.prototype.toString=function(a){if(0>this.s)return"-"+this.negate().toString(a);if(16==a)a=4;else if(8==a)a=3;else if(2==
a)a=1;else if(32==a)a=5;else if(4==a)a=2;else return this.toRadix(a);var b=(1<<a)-1,c,d=!1,e="",h=this.t,g=this.DB-h*this.DB%a;if(0<h--)for(g<this.DB&&0<(c=this[h]>>g)&&(d=!0,e="0123456789abcdefghijklmnopqrstuvwxyz".charAt(c));0<=h;)g<a?(c=(this[h]&(1<<g)-1)<<a-g,c|=this[--h]>>(g+=this.DB-a)):(c=this[h]>>(g-=a)&b,0>=g&&(g+=this.DB,--h)),0<c&&(d=!0),d&&(e+="0123456789abcdefghijklmnopqrstuvwxyz".charAt(c));return d?e:"0"};f.prototype.negate=function(){var a=n();f.ZERO.subTo(this,a);return a};f.prototype.abs=
function(){return 0>this.s?this.negate():this};f.prototype.compareTo=function(a){var b=this.s-a.s;if(0!=b)return b;var c=this.t;b=c-a.t;if(0!=b)return 0>this.s?-b:b;for(;0<=--c;)if(0!=(b=this[c]-a[c]))return b;return 0};f.prototype.bitLength=function(){return 0>=this.t?0:this.DB*(this.t-1)+H(this[this.t-1]^this.s&this.DM)};f.prototype.mod=function(a){var b=n();this.abs().divRemTo(a,null,b);0>this.s&&0<b.compareTo(f.ZERO)&&a.subTo(b,b);return b};f.prototype.modPowInt=function(a,b){b=256>a||b.isEven()?
new A(b):new B(b);return this.exp(a,b)};f.ZERO=z(0);f.ONE=z(1);E.prototype.convert=U;E.prototype.revert=U;E.prototype.mulTo=function(a,b,c){a.multiplyTo(b,c)};E.prototype.sqrTo=function(a,b){a.squareTo(b)};D.prototype.convert=function(a){if(0>a.s||a.t>2*this.m.t)return a.mod(this.m);if(0>a.compareTo(this.m))return a;var b=n();a.copyTo(b);this.reduce(b);return b};D.prototype.revert=function(a){return a};D.prototype.reduce=function(a){a.drShiftTo(this.m.t-1,this.r2);a.t>this.m.t+1&&(a.t=this.m.t+1,
a.clamp());this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3);for(this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);0>a.compareTo(this.r2);)a.dAddOffset(1,this.m.t+1);for(a.subTo(this.r2,a);0<=a.compareTo(this.m);)a.subTo(this.m,a)};D.prototype.mulTo=function(a,b,c){a.multiplyTo(b,c);this.reduce(c)};D.prototype.sqrTo=function(a,b){a.squareTo(b);this.reduce(b)};var w=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,
179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,
991,997],ca=67108864/w[w.length-1];f.prototype.chunkSize=function(a){return Math.floor(Math.LN2*this.DB/Math.log(a))};f.prototype.toRadix=function(a){null==a&&(a=10);if(0==this.signum()||2>a||36<a)return"0";var b=this.chunkSize(a);b=Math.pow(a,b);var c=z(b),d=n(),e=n(),h="";for(this.divRemTo(c,d,e);0<d.signum();)h=(b+e.intValue()).toString(a).substr(1)+h,d.divRemTo(c,d,e);return e.intValue().toString(a)+h};f.prototype.fromRadix=function(a,b){this.fromInt(0);null==b&&(b=10);for(var c=this.chunkSize(b),
d=Math.pow(b,c),e=!1,h=0,g=0,k=0;k<a.length;++k){var x=R(a,k);0>x?"-"==a.charAt(k)&&0==this.signum()&&(e=!0):(g=b*g+x,++h>=c&&(this.dMultiply(d),this.dAddOffset(g,0),g=h=0))}0<h&&(this.dMultiply(Math.pow(b,h)),this.dAddOffset(g,0));e&&f.ZERO.subTo(this,this)};f.prototype.fromNumber=function(a,b,c){if("number"==typeof b)if(2>a)this.fromInt(1);else for(this.fromNumber(a,c),this.testBit(a-1)||this.bitwiseTo(f.ONE.shiftLeft(a-1),I,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(b);)this.dAddOffset(2,
0),this.bitLength()>a&&this.subTo(f.ONE.shiftLeft(a-1),this);else{c=[];var d=a&7;c.length=(a>>3)+1;b.nextBytes(c);c[0]=0<d?c[0]&(1<<d)-1:0;this.fromString(c,256)}};f.prototype.bitwiseTo=function(a,b,c){var d,e=Math.min(a.t,this.t);for(d=0;d<e;++d)c[d]=b(this[d],a[d]);if(a.t<this.t){var h=a.s&this.DM;for(d=e;d<this.t;++d)c[d]=b(this[d],h);c.t=this.t}else{h=this.s&this.DM;for(d=e;d<a.t;++d)c[d]=b(h,a[d]);c.t=a.t}c.s=b(this.s,a.s);c.clamp()};f.prototype.changeBit=function(a,b){a=f.ONE.shiftLeft(a);this.bitwiseTo(a,
b,a);return a};f.prototype.addTo=function(a,b){for(var c=0,d=0,e=Math.min(a.t,this.t);c<e;)d+=this[c]+a[c],b[c++]=d&this.DM,d>>=this.DB;if(a.t<this.t){for(d+=a.s;c<this.t;)d+=this[c],b[c++]=d&this.DM,d>>=this.DB;d+=this.s}else{for(d+=this.s;c<a.t;)d+=a[c],b[c++]=d&this.DM,d>>=this.DB;d+=a.s}b.s=0>d?-1:0;0<d?b[c++]=d:-1>d&&(b[c++]=this.DV+d);b.t=c;b.clamp()};f.prototype.dMultiply=function(a){this[this.t]=this.am(0,a-1,this,0,0,this.t);++this.t;this.clamp()};f.prototype.dAddOffset=function(a,b){if(0!=
a){for(;this.t<=b;)this[this.t++]=0;for(this[b]+=a;this[b]>=this.DV;)this[b]-=this.DV,++b>=this.t&&(this[this.t++]=0),++this[b]}};f.prototype.multiplyLowerTo=function(a,b,c){var d=Math.min(this.t+a.t,b);c.s=0;for(c.t=d;0<d;)c[--d]=0;var e;for(e=c.t-this.t;d<e;++d)c[d+this.t]=this.am(0,a[d],c,d,0,this.t);for(e=Math.min(a.t,b);d<e;++d)this.am(0,a[d],c,d,0,b-d);c.clamp()};f.prototype.multiplyUpperTo=function(a,b,c){--b;var d=c.t=this.t+a.t-b;for(c.s=0;0<=--d;)c[d]=0;for(d=Math.max(b-this.t,0);d<a.t;++d)c[this.t+
d-b]=this.am(b-d,a[d],c,0,0,this.t+d-b);c.clamp();c.drShiftTo(1,c)};f.prototype.modInt=function(a){if(0>=a)return 0;var b=this.DV%a,c=0>this.s?a-1:0;if(0<this.t)if(0==b)c=this[0]%a;else for(var d=this.t-1;0<=d;--d)c=(b*c+this[d])%a;return c};f.prototype.millerRabin=function(a){var b=this.subtract(f.ONE),c=b.getLowestSetBit();if(0>=c)return!1;var d=b.shiftRight(c);a=a+1>>1;a>w.length&&(a=w.length);for(var e=n(),h=0;h<a;++h){e.fromInt(w[Math.floor(Math.random()*w.length)]);var g=e.modPow(d,this);if(0!=
g.compareTo(f.ONE)&&0!=g.compareTo(b)){for(var k=1;k++<c&&0!=g.compareTo(b);)if(g=g.modPowInt(2,this),0==g.compareTo(f.ONE))return!1;if(0!=g.compareTo(b))return!1}}return!0};f.prototype.clone=function(){var a=n();this.copyTo(a);return a};f.prototype.intValue=function(){if(0>this.s){if(1==this.t)return this[0]-this.DV;if(0==this.t)return-1}else{if(1==this.t)return this[0];if(0==this.t)return 0}return(this[1]&(1<<32-this.DB)-1)<<this.DB|this[0]};f.prototype.byteValue=function(){return 0==this.t?this.s:
this[0]<<24>>24};f.prototype.shortValue=function(){return 0==this.t?this.s:this[0]<<16>>16};f.prototype.signum=function(){return 0>this.s?-1:0>=this.t||1==this.t&&0>=this[0]?0:1};f.prototype.toByteArray=function(){var a=this.t,b=[];b[0]=this.s;var c=this.DB-a*this.DB%8,d,e=0;if(0<a--)for(c<this.DB&&(d=this[a]>>c)!=(this.s&this.DM)>>c&&(b[e++]=d|this.s<<this.DB-c);0<=a;)if(8>c?(d=(this[a]&(1<<c)-1)<<8-c,d|=this[--a]>>(c+=this.DB-8)):(d=this[a]>>(c-=8)&255,0>=c&&(c+=this.DB,--a)),0!=(d&128)&&(d|=-256),
0==e&&(this.s&128)!=(d&128)&&++e,0<e||d!=this.s)b[e++]=d;return b};f.prototype.equals=function(a){return 0==this.compareTo(a)};f.prototype.min=function(a){return 0>this.compareTo(a)?this:a};f.prototype.max=function(a){return 0<this.compareTo(a)?this:a};f.prototype.and=function(a){var b=n();this.bitwiseTo(a,aa,b);return b};f.prototype.or=function(a){var b=n();this.bitwiseTo(a,I,b);return b};f.prototype.xor=function(a){var b=n();this.bitwiseTo(a,S,b);return b};f.prototype.andNot=function(a){var b=n();
this.bitwiseTo(a,T,b);return b};f.prototype.not=function(){for(var a=n(),b=0;b<this.t;++b)a[b]=this.DM&~this[b];a.t=this.t;a.s=~this.s;return a};f.prototype.shiftLeft=function(a){var b=n();0>a?this.rShiftTo(-a,b):this.lShiftTo(a,b);return b};f.prototype.shiftRight=function(a){var b=n();0>a?this.lShiftTo(-a,b):this.rShiftTo(a,b);return b};f.prototype.getLowestSetBit=function(){for(var a=0;a<this.t;++a)if(0!=this[a]){var b=a*this.DB;a=this[a];if(0==a)a=-1;else{var c=0;0==(a&65535)&&(a>>=16,c+=16);0==
(a&255)&&(a>>=8,c+=8);0==(a&15)&&(a>>=4,c+=4);0==(a&3)&&(a>>=2,c+=2);0==(a&1)&&++c;a=c}return b+a}return 0>this.s?this.t*this.DB:-1};f.prototype.bitCount=function(){for(var a=0,b=this.s&this.DM,c=0;c<this.t;++c){for(var d=this[c]^b,e=0;0!=d;)d&=d-1,++e;a+=e}return a};f.prototype.testBit=function(a){var b=Math.floor(a/this.DB);return b>=this.t?0!=this.s:0!=(this[b]&1<<a%this.DB)};f.prototype.setBit=function(a){return this.changeBit(a,I)};f.prototype.clearBit=function(a){return this.changeBit(a,T)};
f.prototype.flipBit=function(a){return this.changeBit(a,S)};f.prototype.add=function(a){var b=n();this.addTo(a,b);return b};f.prototype.subtract=function(a){var b=n();this.subTo(a,b);return b};f.prototype.multiply=function(a){var b=n();this.multiplyTo(a,b);return b};f.prototype.divide=function(a){var b=n();this.divRemTo(a,b,null);return b};f.prototype.remainder=function(a){var b=n();this.divRemTo(a,null,b);return b};f.prototype.divideAndRemainder=function(a){var b=n(),c=n();this.divRemTo(a,b,c);return[b,
c]};f.prototype.modPow=function(a,b){var c=a.bitLength(),d=z(1);if(0>=c)return d;var e=18>c?1:48>c?3:144>c?4:768>c?5:6;b=8>c?new A(b):b.isEven()?new D(b):new B(b);var h=[],g=3,k=e-1,f=(1<<e)-1;h[1]=b.convert(this);if(1<e)for(c=n(),b.sqrTo(h[1],c);g<=f;)h[g]=n(),b.mulTo(c,h[g-2],h[g]),g+=2;var r=a.t-1,l=!0,t=n();for(c=H(a[r])-1;0<=r;){if(c>=k)var m=a[r]>>c-k&f;else m=(a[r]&(1<<c+1)-1)<<k-c,0<r&&(m|=a[r-1]>>this.DB+c-k);for(g=e;0==(m&1);)m>>=1,--g;0>(c-=g)&&(c+=this.DB,--r);if(l)h[m].copyTo(d),l=!1;
else{for(;1<g;)b.sqrTo(d,t),b.sqrTo(t,d),g-=2;0<g?b.sqrTo(d,t):(g=d,d=t,t=g);b.mulTo(t,h[m],d)}for(;0<=r&&0==(a[r]&1<<c);)b.sqrTo(d,t),g=d,d=t,t=g,0>--c&&(c=this.DB-1,--r)}return b.revert(d)};f.prototype.modInverse=function(a){var b=a.isEven();if(this.isEven()&&b||0==a.signum())return f.ZERO;for(var c=a.clone(),d=this.clone(),e=z(1),h=z(0),g=z(0),k=z(1);0!=c.signum();){for(;c.isEven();)c.rShiftTo(1,c),b?(e.isEven()&&h.isEven()||(e.addTo(this,e),h.subTo(a,h)),e.rShiftTo(1,e)):h.isEven()||h.subTo(a,
h),h.rShiftTo(1,h);for(;d.isEven();)d.rShiftTo(1,d),b?(g.isEven()&&k.isEven()||(g.addTo(this,g),k.subTo(a,k)),g.rShiftTo(1,g)):k.isEven()||k.subTo(a,k),k.rShiftTo(1,k);0<=c.compareTo(d)?(c.subTo(d,c),b&&e.subTo(g,e),h.subTo(k,h)):(d.subTo(c,d),b&&g.subTo(e,g),k.subTo(h,k))}if(0!=d.compareTo(f.ONE))return f.ZERO;if(0<=k.compareTo(a))return k.subtract(a);if(0>k.signum())k.addTo(a,k);else return k;return 0>k.signum()?k.add(a):k};f.prototype.pow=function(a){return this.exp(a,new E)};f.prototype.gcd=function(a){var b=
0>this.s?this.negate():this.clone();a=0>a.s?a.negate():a.clone();if(0>b.compareTo(a)){var c=b;b=a;a=c}c=b.getLowestSetBit();var d=a.getLowestSetBit();if(0>d)return b;c<d&&(d=c);0<d&&(b.rShiftTo(d,b),a.rShiftTo(d,a));for(;0<b.signum();)0<(c=b.getLowestSetBit())&&b.rShiftTo(c,b),0<(c=a.getLowestSetBit())&&a.rShiftTo(c,a),0<=b.compareTo(a)?(b.subTo(a,b),b.rShiftTo(1,b)):(a.subTo(b,a),a.rShiftTo(1,a));0<d&&a.lShiftTo(d,a);return a};f.prototype.isProbablePrime=function(a){var b,c=this.abs();if(1==c.t&&
c[0]<=w[w.length-1]){for(b=0;b<w.length;++b)if(c[0]==w[b])return!0;return!1}if(c.isEven())return!1;for(b=1;b<w.length;){for(var d=w[b],e=b+1;e<w.length&&d<ca;)d*=w[e++];for(d=c.modInt(d);b<e;)if(0==d%w[b++])return!1}return c.millerRabin(a)};f.prototype.square=function(){var a=n();this.squareTo(a);return a};N.prototype.init=function(a){var b,c;for(b=0;256>b;++b)this.S[b]=b;for(b=c=0;256>b;++b){c=c+this.S[b]+a[b%a.length]&255;var d=this.S[b];this.S[b]=this.S[c];this.S[c]=d}this.j=this.i=0};N.prototype.next=
function(){this.i=this.i+1&255;this.j=this.j+this.S[this.i]&255;var a=this.S[this.i];this.S[this.i]=this.S[this.j];this.S[this.j]=a;return this.S[a+this.S[this.i]&255]};var K;if(null==C){var C=[];var y=0;if(window.crypto&&window.crypto.getRandomValues)for(u=new Uint32Array(256),window.crypto.getRandomValues(u),q=0;q<u.length;++q)C[y++]=u[q]&255;var L=function(a){this.count=this.count||0;if(256<=this.count||256<=y)window.removeEventListener?window.removeEventListener("mousemove",L,!1):window.detachEvent&&
window.detachEvent("onmousemove",L);else try{var b=a.x+a.y;C[y++]=b&255;this.count+=1}catch(c){}};window.addEventListener?window.addEventListener("mousemove",L,!1):window.attachEvent&&window.attachEvent("onmousemove",L)}J.prototype.nextBytes=function(a){var b;for(b=0;b<a.length;++b){var c=b;if(null==K){for(K=new N;256>y;){var d=Math.floor(65536*Math.random());C[y++]=d&255}K.init(C);for(y=0;y<C.length;++y)C[y]=0;y=0}d=K.next();a[c]=d}};p.prototype.doPublic=function(a){return a.modPowInt(this.e,this.n)};
p.prototype.setPublic=function(a,b){null!=a&&null!=b&&0<a.length&&0<b.length?(this.n=m(a,16),this.e=parseInt(b,16)):console.error("Invalid RSA public key")};p.prototype.encrypt=function(a){var b=this.n.bitLength()+7>>3;if(b<a.length+11)console.error("Message too long for RSA"),b=null;else{for(var c=[],d=a.length-1;0<=d&&0<b;){var e=a.charCodeAt(d--);128>e?c[--b]=e:127<e&&2048>e?(c[--b]=e&63|128,c[--b]=e>>6|192):(c[--b]=e&63|128,c[--b]=e>>6&63|128,c[--b]=e>>12|224)}c[--b]=0;a=new J;for(d=[];2<b;){for(d[0]=
0;0==d[0];)a.nextBytes(d);c[--b]=d[0]}c[--b]=2;c[--b]=0;b=new f(c)}if(null==b)return null;b=this.doPublic(b);if(null==b)return null;b=b.toString(16);return 0==(b.length&1)?b:"0"+b};p.prototype.doPrivate=function(a){if(null==this.p||null==this.q)return a.modPow(this.d,this.n);var b=a.mod(this.p).modPow(this.dmp1,this.p);for(a=a.mod(this.q).modPow(this.dmq1,this.q);0>b.compareTo(a);)b=b.add(this.p);return b.subtract(a).multiply(this.coeff).mod(this.p).multiply(this.q).add(a)};p.prototype.setPrivate=
function(a,b,c){null!=a&&null!=b&&0<a.length&&0<b.length?(this.n=m(a,16),this.e=parseInt(b,16),this.d=m(c,16)):console.error("Invalid RSA private key")};p.prototype.setPrivateEx=function(a,b,c,d,e,h,g,k){null!=a&&null!=b&&0<a.length&&0<b.length?(this.n=m(a,16),this.e=parseInt(b,16),this.d=m(c,16),this.p=m(d,16),this.q=m(e,16),this.dmp1=m(h,16),this.dmq1=m(g,16),this.coeff=m(k,16)):console.error("Invalid RSA private key")};p.prototype.generate=function(a,b){var c=new J,d=a>>1;this.e=parseInt(b,16);
for(b=new f(b,16);;){for(;this.p=new f(a-d,1,c),0!=this.p.subtract(f.ONE).gcd(b).compareTo(f.ONE)||!this.p.isProbablePrime(10););for(;this.q=new f(d,1,c),0!=this.q.subtract(f.ONE).gcd(b).compareTo(f.ONE)||!this.q.isProbablePrime(10););if(0>=this.p.compareTo(this.q)){var e=this.p;this.p=this.q;this.q=e}e=this.p.subtract(f.ONE);var h=this.q.subtract(f.ONE),g=e.multiply(h);if(0==g.gcd(b).compareTo(f.ONE)){this.n=this.p.multiply(this.q);this.d=b.modInverse(g);this.dmp1=this.d.mod(e);this.dmq1=this.d.mod(h);
this.coeff=this.q.modInverse(this.p);break}}};p.prototype.decrypt=function(a){a=m(a,16);a=this.doPrivate(a);if(null==a)return null;a:{var b=this.n.bitLength()+7>>3;a=a.toByteArray();for(var c=0;c<a.length&&0==a[c];)++c;if(a.length-c!=b-1||2!=a[c])a=null;else{for(++c;0!=a[c];)if(++c>=a.length){a=null;break a}for(b="";++c<a.length;){var d=a[c]&255;128>d?b+=String.fromCharCode(d):191<d&&224>d?(b+=String.fromCharCode((d&31)<<6|a[c+1]&63),++c):(b+=String.fromCharCode((d&15)<<12|(a[c+1]&63)<<6|a[c+2]&63),
c+=2)}a=b}}return a};(function(){p.prototype.generateAsync=function(a,b,c){var d=new J,e=a>>1;this.e=parseInt(b,16);var h=new f(b,16),g=this,k=function(){var b=function(){if(0>=g.p.compareTo(g.q)){var a=g.p;g.p=g.q;g.q=a}a=g.p.subtract(f.ONE);var b=g.q.subtract(f.ONE),e=a.multiply(b);0==e.gcd(h).compareTo(f.ONE)?(g.n=g.p.multiply(g.q),g.d=h.modInverse(e),g.dmp1=g.d.mod(a),g.dmq1=g.d.mod(b),g.coeff=g.q.modInverse(g.p),setTimeout(function(){c()},0)):setTimeout(k,0)},l=function(){g.q=n();g.q.fromNumberAsync(e,
1,d,function(){g.q.subtract(f.ONE).gcda(h,function(a){0==a.compareTo(f.ONE)&&g.q.isProbablePrime(10)?setTimeout(b,0):setTimeout(l,0)})})},m=function(){g.p=n();g.p.fromNumberAsync(a-e,1,d,function(){g.p.subtract(f.ONE).gcda(h,function(a){0==a.compareTo(f.ONE)&&g.p.isProbablePrime(10)?setTimeout(l,0):setTimeout(m,0)})})};setTimeout(m,0)};setTimeout(k,0)};f.prototype.gcda=function(a,b){var c=0>this.s?this.negate():this.clone(),d=0>a.s?a.negate():a.clone();0>c.compareTo(d)&&(a=c,c=d,d=a);var e=c.getLowestSetBit(),
h=d.getLowestSetBit();if(0>h)b(c);else{e<h&&(h=e);0<h&&(c.rShiftTo(h,c),d.rShiftTo(h,d));var g=function(){0<(e=c.getLowestSetBit())&&c.rShiftTo(e,c);0<(e=d.getLowestSetBit())&&d.rShiftTo(e,d);0<=c.compareTo(d)?(c.subTo(d,c),c.rShiftTo(1,c)):(d.subTo(c,d),d.rShiftTo(1,d));0<c.signum()?setTimeout(g,0):(0<h&&d.lShiftTo(h,d),setTimeout(function(){b(d)},0))};setTimeout(g,10)}};f.prototype.fromNumberAsync=function(a,b,c,d){if("number"==typeof b)if(2>a)this.fromInt(1);else{this.fromNumber(a,c);this.testBit(a-
1)||this.bitwiseTo(f.ONE.shiftLeft(a-1),I,this);this.isEven()&&this.dAddOffset(1,0);var e=this,h=function(){e.dAddOffset(2,0);e.bitLength()>a&&e.subTo(f.ONE.shiftLeft(a-1),e);e.isProbablePrime(b)?setTimeout(function(){d()},0):setTimeout(h,0)};setTimeout(h,0)}else{c=[];var g=a&7;c.length=(a>>3)+1;b.nextBytes(c);c[0]=0<g?c[0]&(1<<g)-1:0;this.fromString(c,256)}}})();var l=l||{};l.env=l.env||{};var P=l,Q=Object.prototype,W=["toString","valueOf"];l.env.parseUA=function(a){var b=function(a){var b=0;return parseFloat(a.replace(/\./g,
function(){return 1==b++?"":"."}))},c=navigator;c={ie:0,opera:0,gecko:0,webkit:0,chrome:0,mobile:null,air:0,ipad:0,iphone:0,ipod:0,ios:null,android:0,webos:0,caja:c&&c.cajaVersion,secure:!1,os:null};a=a||navigator&&navigator.userAgent;var d=window&&window.location;d=d&&d.href;c.secure=d&&0===d.toLowerCase().indexOf("https");if(a){/windows|win32/i.test(a)?c.os="windows":/macintosh/i.test(a)?c.os="macintosh":/rhino/i.test(a)&&(c.os="rhino");/KHTML/.test(a)&&(c.webkit=1);if((d=a.match(/AppleWebKit\/([^\s]*)/))&&
d[1]){c.webkit=b(d[1]);if(/ Mobile\//.test(a))c.mobile="Apple",(d=a.match(/OS ([^\s]*)/))&&d[1]&&(d=b(d[1].replace("_","."))),c.ios=d,c.ipad=c.ipod=c.iphone=0,(d=a.match(/iPad|iPod|iPhone/))&&d[0]&&(c[d[0].toLowerCase()]=c.ios);else{if(d=a.match(/NokiaN[^\/]*|Android \d\.\d|webOS\/\d\.\d/))c.mobile=d[0];/webOS/.test(a)&&(c.mobile="WebOS",(d=a.match(/webOS\/([^\s]*);/))&&d[1]&&(c.webos=b(d[1])));/ Android/.test(a)&&(c.mobile="Android",(d=a.match(/Android ([^\s]*);/))&&d[1]&&(c.android=b(d[1])))}if((d=
a.match(/Chrome\/([^\s]*)/))&&d[1])c.chrome=b(d[1]);else if(d=a.match(/AdobeAIR\/([^\s]*)/))c.air=d[0]}if(!c.webkit)if((d=a.match(/Opera[\s\/]([^\s]*)/))&&d[1]){if(c.opera=b(d[1]),(d=a.match(/Version\/([^\s]*)/))&&d[1]&&(c.opera=b(d[1])),d=a.match(/Opera Mini[^;]*/))c.mobile=d[0]}else if((d=a.match(/MSIE\s([^;]*)/))&&d[1])c.ie=b(d[1]);else if(d=a.match(/Gecko\/([^\s]*)/))c.gecko=1,(d=a.match(/rv:([^\s\)]*)/))&&d[1]&&(c.gecko=b(d[1]))}return c};l.env.ua=l.env.parseUA();l.isFunction=function(a){return"function"===
typeof a||"[object Function]"===Q.toString.apply(a)};l._IEEnumFix=l.env.ua.ie?function(a,b){var c;for(c=0;c<W.length;c+=1){var d=W[c];var e=b[d];P.isFunction(e)&&e!=Q[d]&&(a[d]=e)}}:function(){};l.extend=function(a,b,c){if(!b||!a)throw Error("extend failed, please check that all dependencies are included.");var d=function(){},e;d.prototype=b.prototype;a.prototype=new d;a.prototype.constructor=a;a.superclass=b.prototype;b.prototype.constructor==Q.constructor&&(b.prototype.constructor=b);if(c){for(e in c)P.hasOwnProperty(c,
e)&&(a.prototype[e]=c[e]);P._IEEnumFix(a.prototype,c)}};"undefined"!=typeof KJUR&&KJUR||(KJUR={});"undefined"!=typeof KJUR.asn1&&KJUR.asn1||(KJUR.asn1={});KJUR.asn1.ASN1Util=new function(){this.integerToByteHex=function(a){a=a.toString(16);1==a.length%2&&(a="0"+a);return a};this.bigIntToMinTwosComplementsHex=function(a){var b=a.toString(16);if("-"!=b.substr(0,1))1==b.length%2?b="0"+b:b.match(/^[0-7]/)||(b="00"+b);else{var c=b.substr(1).length;1==c%2?c+=1:b.match(/^[0-7]/)||(c+=2);b="";for(var d=0;d<
c;d++)b+="f";b=(new f(b,16)).xor(a).add(f.ONE).toString(16).replace(/^-/,"")}return b};this.getPEMStringFromHex=function(a,b){a=CryptoJS.enc.Hex.parse(a);a=CryptoJS.enc.Base64.stringify(a).replace(/(.{64})/g,"$1\r\n");a=a.replace(/\r\n$/,"");return"-----BEGIN "+b+"-----\r\n"+a+"\r\n-----END "+b+"-----\r\n"}};KJUR.asn1.ASN1Object=function(){this.getLengthHexFromValue=function(){if("undefined"==typeof this.hV||null==this.hV)throw"this.hV is null or undefined.";if(1==this.hV.length%2)throw"value hex must be even length: n=0,v="+
this.hV;var a=this.hV.length/2,b=a.toString(16);1==b.length%2&&(b="0"+b);if(128>a)return b;var c=b.length/2;if(15<c)throw"ASN.1 length too long to represent by 8x: n = "+a.toString(16);return(128+c).toString(16)+b};this.getEncodedHex=function(){if(null==this.hTLV||this.isModified)this.hV=this.getFreshValueHex(),this.hL=this.getLengthHexFromValue(),this.hTLV=this.hT+this.hL+this.hV,this.isModified=!1;return this.hTLV};this.getValueHex=function(){this.getEncodedHex();return this.hV};this.getFreshValueHex=
function(){return""}};KJUR.asn1.DERAbstractString=function(a){KJUR.asn1.DERAbstractString.superclass.constructor.call(this);this.getString=function(){return this.s};this.setString=function(a){this.hTLV=null;this.isModified=!0;this.s=a;this.hV=stohex(this.s)};this.setStringHex=function(a){this.hTLV=null;this.isModified=!0;this.s=null;this.hV=a};this.getFreshValueHex=function(){return this.hV};"undefined"!=typeof a&&("undefined"!=typeof a.str?this.setString(a.str):"undefined"!=typeof a.hex&&this.setStringHex(a.hex))};
l.extend(KJUR.asn1.DERAbstractString,KJUR.asn1.ASN1Object);KJUR.asn1.DERAbstractTime=function(a){KJUR.asn1.DERAbstractTime.superclass.constructor.call(this);this.localDateToUTC=function(a){utc=a.getTime()+6E4*a.getTimezoneOffset();return new Date(utc)};this.formatDate=function(a,c){var b=this.zeroPadding,e=this.localDateToUTC(a);a=String(e.getFullYear());"utc"==c&&(a=a.substr(2,2));c=b(String(e.getMonth()+1),2);var h=b(String(e.getDate()),2),g=b(String(e.getHours()),2),k=b(String(e.getMinutes()),
2);b=b(String(e.getSeconds()),2);return a+c+h+g+k+b+"Z"};this.zeroPadding=function(a,c){return a.length>=c?a:Array(c-a.length+1).join("0")+a};this.getString=function(){return this.s};this.setString=function(a){this.hTLV=null;this.isModified=!0;this.s=a;this.hV=stohex(this.s)};this.setByDateValue=function(a,c,d,e,h,g){a=new Date(Date.UTC(a,c-1,d,e,h,g,0));this.setByDate(a)};this.getFreshValueHex=function(){return this.hV}};l.extend(KJUR.asn1.DERAbstractTime,KJUR.asn1.ASN1Object);KJUR.asn1.DERAbstractStructured=
function(a){KJUR.asn1.DERAbstractString.superclass.constructor.call(this);this.setByASN1ObjectArray=function(a){this.hTLV=null;this.isModified=!0;this.asn1Array=a};this.appendASN1Object=function(a){this.hTLV=null;this.isModified=!0;this.asn1Array.push(a)};this.asn1Array=[];"undefined"!=typeof a&&"undefined"!=typeof a.array&&(this.asn1Array=a.array)};l.extend(KJUR.asn1.DERAbstractStructured,KJUR.asn1.ASN1Object);KJUR.asn1.DERBoolean=function(){KJUR.asn1.DERBoolean.superclass.constructor.call(this);
this.hT="01";this.hTLV="0101ff"};l.extend(KJUR.asn1.DERBoolean,KJUR.asn1.ASN1Object);KJUR.asn1.DERInteger=function(a){KJUR.asn1.DERInteger.superclass.constructor.call(this);this.hT="02";this.setByBigInteger=function(a){this.hTLV=null;this.isModified=!0;this.hV=KJUR.asn1.ASN1Util.bigIntToMinTwosComplementsHex(a)};this.setByInteger=function(a){a=new f(String(a),10);this.setByBigInteger(a)};this.setValueHex=function(a){this.hV=a};this.getFreshValueHex=function(){return this.hV};"undefined"!=typeof a&&
("undefined"!=typeof a.bigint?this.setByBigInteger(a.bigint):"undefined"!=typeof a["int"]?this.setByInteger(a["int"]):"undefined"!=typeof a.hex&&this.setValueHex(a.hex))};l.extend(KJUR.asn1.DERInteger,KJUR.asn1.ASN1Object);KJUR.asn1.DERBitString=function(a){KJUR.asn1.DERBitString.superclass.constructor.call(this);this.hT="03";this.setHexValueIncludingUnusedBits=function(a){this.hTLV=null;this.isModified=!0;this.hV=a};this.setUnusedBitsAndHexValue=function(a,c){if(0>a||7<a)throw"unused bits shall be from 0 to 7: u = "+
a;this.hTLV=null;this.isModified=!0;this.hV="0"+a+c};this.setByBinaryString=function(a){a=a.replace(/0+$/,"");var b=8-a.length%8;8==b&&(b=0);for(var d=0;d<=b;d++)a+="0";var e="";for(d=0;d<a.length-1;d+=8){var h=a.substr(d,8);h=parseInt(h,2).toString(16);1==h.length&&(h="0"+h);e+=h}this.hTLV=null;this.isModified=!0;this.hV="0"+b+e};this.setByBooleanArray=function(a){for(var b="",d=0;d<a.length;d++)b=1==a[d]?b+"1":b+"0";this.setByBinaryString(b)};this.newFalseArray=function(a){for(var b=Array(a),d=
0;d<a;d++)b[d]=!1;return b};this.getFreshValueHex=function(){return this.hV};"undefined"!=typeof a&&("undefined"!=typeof a.hex?this.setHexValueIncludingUnusedBits(a.hex):"undefined"!=typeof a.bin?this.setByBinaryString(a.bin):"undefined"!=typeof a.array&&this.setByBooleanArray(a.array))};l.extend(KJUR.asn1.DERBitString,KJUR.asn1.ASN1Object);KJUR.asn1.DEROctetString=function(a){KJUR.asn1.DEROctetString.superclass.constructor.call(this,a);this.hT="04"};l.extend(KJUR.asn1.DEROctetString,KJUR.asn1.DERAbstractString);
KJUR.asn1.DERNull=function(){KJUR.asn1.DERNull.superclass.constructor.call(this);this.hT="05";this.hTLV="0500"};l.extend(KJUR.asn1.DERNull,KJUR.asn1.ASN1Object);KJUR.asn1.DERObjectIdentifier=function(a){var b=function(a){a=a.toString(16);1==a.length&&(a="0"+a);return a};KJUR.asn1.DERObjectIdentifier.superclass.constructor.call(this);this.hT="06";this.setValueHex=function(a){this.hTLV=null;this.isModified=!0;this.s=null;this.hV=a};this.setValueOidString=function(a){if(!a.match(/^[0-9.]+$/))throw"malformed oid string: "+
a;var c="";a=a.split(".");var e=40*parseInt(a[0])+parseInt(a[1]);c+=b(e);a.splice(0,2);for(e=0;e<a.length;e++){var h="",g=(new f(a[e],10)).toString(2),k=7-g.length%7;7==k&&(k=0);for(var x="",l=0;l<k;l++)x+="0";g=x+g;for(l=0;l<g.length-1;l+=7)k=g.substr(l,7),l!=g.length-7&&(k="1"+k),h+=b(parseInt(k,2));c+=h}this.hTLV=null;this.isModified=!0;this.s=null;this.hV=c};this.setValueName=function(a){if("undefined"!=typeof KJUR.asn1.x509.OID.name2oidList[a])this.setValueOidString(KJUR.asn1.x509.OID.name2oidList[a]);
else throw"DERObjectIdentifier oidName undefined: "+a;};this.getFreshValueHex=function(){return this.hV};"undefined"!=typeof a&&("undefined"!=typeof a.oid?this.setValueOidString(a.oid):"undefined"!=typeof a.hex?this.setValueHex(a.hex):"undefined"!=typeof a.name&&this.setValueName(a.name))};l.extend(KJUR.asn1.DERObjectIdentifier,KJUR.asn1.ASN1Object);KJUR.asn1.DERUTF8String=function(a){KJUR.asn1.DERUTF8String.superclass.constructor.call(this,a);this.hT="0c"};l.extend(KJUR.asn1.DERUTF8String,KJUR.asn1.DERAbstractString);
KJUR.asn1.DERNumericString=function(a){KJUR.asn1.DERNumericString.superclass.constructor.call(this,a);this.hT="12"};l.extend(KJUR.asn1.DERNumericString,KJUR.asn1.DERAbstractString);KJUR.asn1.DERPrintableString=function(a){KJUR.asn1.DERPrintableString.superclass.constructor.call(this,a);this.hT="13"};l.extend(KJUR.asn1.DERPrintableString,KJUR.asn1.DERAbstractString);KJUR.asn1.DERTeletexString=function(a){KJUR.asn1.DERTeletexString.superclass.constructor.call(this,a);this.hT="14"};l.extend(KJUR.asn1.DERTeletexString,
KJUR.asn1.DERAbstractString);KJUR.asn1.DERIA5String=function(a){KJUR.asn1.DERIA5String.superclass.constructor.call(this,a);this.hT="16"};l.extend(KJUR.asn1.DERIA5String,KJUR.asn1.DERAbstractString);KJUR.asn1.DERUTCTime=function(a){KJUR.asn1.DERUTCTime.superclass.constructor.call(this,a);this.hT="17";this.setByDate=function(a){this.hTLV=null;this.isModified=!0;this.date=a;this.s=this.formatDate(this.date,"utc");this.hV=stohex(this.s)};"undefined"!=typeof a&&("undefined"!=typeof a.str?this.setString(a.str):
"undefined"!=typeof a.hex?this.setStringHex(a.hex):"undefined"!=typeof a.date&&this.setByDate(a.date))};l.extend(KJUR.asn1.DERUTCTime,KJUR.asn1.DERAbstractTime);KJUR.asn1.DERGeneralizedTime=function(a){KJUR.asn1.DERGeneralizedTime.superclass.constructor.call(this,a);this.hT="18";this.setByDate=function(a){this.hTLV=null;this.isModified=!0;this.date=a;this.s=this.formatDate(this.date,"gen");this.hV=stohex(this.s)};"undefined"!=typeof a&&("undefined"!=typeof a.str?this.setString(a.str):"undefined"!=
typeof a.hex?this.setStringHex(a.hex):"undefined"!=typeof a.date&&this.setByDate(a.date))};l.extend(KJUR.asn1.DERGeneralizedTime,KJUR.asn1.DERAbstractTime);KJUR.asn1.DERSequence=function(a){KJUR.asn1.DERSequence.superclass.constructor.call(this,a);this.hT="30";this.getFreshValueHex=function(){for(var a="",c=0;c<this.asn1Array.length;c++)a+=this.asn1Array[c].getEncodedHex();return this.hV=a}};l.extend(KJUR.asn1.DERSequence,KJUR.asn1.DERAbstractStructured);KJUR.asn1.DERSet=function(a){KJUR.asn1.DERSet.superclass.constructor.call(this,
a);this.hT="31";this.getFreshValueHex=function(){for(var a=[],c=0;c<this.asn1Array.length;c++)a.push(this.asn1Array[c].getEncodedHex());a.sort();return this.hV=a.join("")}};l.extend(KJUR.asn1.DERSet,KJUR.asn1.DERAbstractStructured);KJUR.asn1.DERTaggedObject=function(a){KJUR.asn1.DERTaggedObject.superclass.constructor.call(this);this.hT="a0";this.hV="";this.isExplicit=!0;this.asn1Object=null;this.setASN1Object=function(a,c,d){this.hT=c;this.isExplicit=a;this.asn1Object=d;this.isExplicit?(this.hV=this.asn1Object.getEncodedHex(),
this.hTLV=null,this.isModified=!0):(this.hV=null,this.hTLV=d.getEncodedHex(),this.hTLV=this.hTLV.replace(/^../,c),this.isModified=!1)};this.getFreshValueHex=function(){return this.hV};"undefined"!=typeof a&&("undefined"!=typeof a.tag&&(this.hT=a.tag),"undefined"!=typeof a.explicit&&(this.isExplicit=a.explicit),"undefined"!=typeof a.obj&&(this.asn1Object=a.obj,this.setASN1Object(this.isExplicit,this.hT,this.asn1Object)))};l.extend(KJUR.asn1.DERTaggedObject,KJUR.asn1.ASN1Object);(function(a){var b=
{},c;b.decode=function(b){var e;if(c===a){var d="0123456789ABCDEF";c=[];for(e=0;16>e;++e)c[d.charAt(e)]=e;d=d.toLowerCase();for(e=10;16>e;++e)c[d.charAt(e)]=e;for(e=0;8>e;++e)c[" \f\n\r\t\u00a0\u2028\u2029".charAt(e)]=-1}d=[];var g=0,k=0;for(e=0;e<b.length;++e){var f=b.charAt(e);if("="==f)break;f=c[f];if(-1!=f){if(f===a)throw"Illegal character at offset "+e;g|=f;2<=++k?(d[d.length]=g,k=g=0):g<<=4}}if(k)throw"Hex encoding incomplete: 4 bits missing";return d};window.Hex=b})();(function(a){var b={},
c;b.decode=function(b){var e;if(c===a){c=[];for(e=0;64>e;++e)c["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e)]=e;for(e=0;9>e;++e)c["= \f\n\r\t\u00a0\u2028\u2029".charAt(e)]=-1}var d=[],g=0,k=0;for(e=0;e<b.length;++e){var f=b.charAt(e);if("="==f)break;f=c[f];if(-1!=f){if(f===a)throw"Illegal character at offset "+e;g|=f;4<=++k?(d[d.length]=g>>16,d[d.length]=g>>8&255,d[d.length]=g&255,k=g=0):g<<=6}}switch(k){case 1:throw"Base64 encoding incomplete: at least 2 bits missing";
case 2:d[d.length]=g>>10;break;case 3:d[d.length]=g>>16,d[d.length]=g>>8&255}return d};b.re=/-----BEGIN [^-]+-----([A-Za-z0-9+\/=\s]+)-----END [^-]+-----|begin-base64[^\n]+\n([A-Za-z0-9+\/=\s]+)====/;b.unarmor=function(a){var c=b.re.exec(a);if(c)if(c[1])a=c[1];else if(c[2])a=c[2];else throw"RegExp out of sync";return b.decode(a)};window.Base64=b})();(function(a){function b(a,c){a instanceof b?(this.enc=a.enc,this.pos=a.pos):(this.enc=a,this.pos=c)}function c(a,b,c,d,f){this.stream=a;this.header=b;
this.length=c;this.tag=d;this.sub=f}var d={tag:function(a,b){a=document.createElement(a);a.className=b;return a},text:function(a){return document.createTextNode(a)}};b.prototype.get=function(b){b===a&&(b=this.pos++);if(b>=this.enc.length)throw"Requesting byte offset "+b+" on a stream of length "+this.enc.length;return this.enc[b]};b.prototype.hexDigits="0123456789ABCDEF";b.prototype.hexByte=function(a){return this.hexDigits.charAt(a>>4&15)+this.hexDigits.charAt(a&15)};b.prototype.hexDump=function(a,
b,c){for(var d="";a<b;++a)if(d+=this.hexByte(this.get(a)),!0!==c)switch(a&15){case 7:d+=" ";break;case 15:d+="\n";break;default:d+=" "}return d};b.prototype.parseStringISO=function(a,b){for(var c="";a<b;++a)c+=String.fromCharCode(this.get(a));return c};b.prototype.parseStringUTF=function(a,b){for(var c="";a<b;){var d=this.get(a++);c=128>d?c+String.fromCharCode(d):191<d&&224>d?c+String.fromCharCode((d&31)<<6|this.get(a++)&63):c+String.fromCharCode((d&15)<<12|(this.get(a++)&63)<<6|this.get(a++)&63)}return c};
b.prototype.parseStringBMP=function(a,b){for(var c="";a<b;a+=2){var d=this.get(a),e=this.get(a+1);c+=String.fromCharCode((d<<8)+e)}return c};b.prototype.reTime=/^((?:1[89]|2\d)?\d\d)(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])([01]\d|2[0-3])(?:([0-5]\d)(?:([0-5]\d)(?:[.,](\d{1,3}))?)?)?(Z|[-+](?:[0]\d|1[0-2])([0-5]\d)?)?$/;b.prototype.parseTime=function(a,b){a=this.parseStringISO(a,b);b=this.reTime.exec(a);if(!b)return"Unrecognized time: "+a;a=b[1]+"-"+b[2]+"-"+b[3]+" "+b[4];b[5]&&(a+=":"+b[5],b[6]&&(a+=
":"+b[6],b[7]&&(a+="."+b[7])));b[8]&&(a+=" UTC","Z"!=b[8]&&(a+=b[8],b[9]&&(a+=":"+b[9])));return a};b.prototype.parseInteger=function(a,b){var c=b-a;if(4<c){c<<=3;b=this.get(a);if(0===b)c-=8;else for(;128>b;)b<<=1,--c;return"("+c+" bit)"}for(c=0;a<b;++a)c=c<<8|this.get(a);return c};b.prototype.parseBitString=function(a,b){var c=this.get(a),d=(b-a-1<<3)-c,e="("+d+" bit)";if(20>=d)for(e+=" ",--b;b>a;--b){for(d=this.get(b);8>c;++c)e+=d>>c&1?"1":"0";c=0}return e};b.prototype.parseOctetString=function(a,
b){var c=b-a,d="("+c+" byte) ";for(100<c&&(b=a+100);a<b;++a)d+=this.hexByte(this.get(a));100<c&&(d+="\u2026");return d};b.prototype.parseOID=function(a,b){for(var c="",d=0,e=0;a<b;++a){var h=this.get(a);d=d<<7|h&127;e+=7;h&128||(""===c?(c=80>d?40>d?0:1:2,c=c+"."+(d-40*c)):c+="."+(31<=e?"bigint":d),d=e=0)}return c};c.prototype.typeName=function(){if(this.tag===a)return"unknown";var b=this.tag&31;switch(this.tag>>6){case 0:switch(b){case 0:return"EOC";case 1:return"BOOLEAN";case 2:return"INTEGER";case 3:return"BIT_STRING";
case 4:return"OCTET_STRING";case 5:return"NULL";case 6:return"OBJECT_IDENTIFIER";case 7:return"ObjectDescriptor";case 8:return"EXTERNAL";case 9:return"REAL";case 10:return"ENUMERATED";case 11:return"EMBEDDED_PDV";case 12:return"UTF8String";case 16:return"SEQUENCE";case 17:return"SET";case 18:return"NumericString";case 19:return"PrintableString";case 20:return"TeletexString";case 21:return"VideotexString";case 22:return"IA5String";case 23:return"UTCTime";case 24:return"GeneralizedTime";case 25:return"GraphicString";
case 26:return"VisibleString";case 27:return"GeneralString";case 28:return"UniversalString";case 30:return"BMPString";default:return"Universal_"+b.toString(16)}case 1:return"Application_"+b.toString(16);case 2:return"["+b+"]";case 3:return"Private_"+b.toString(16)}};c.prototype.reSeemsASCII=/^[ -~]+$/;c.prototype.content=function(){if(this.tag===a)return null;var b=this.tag>>6,c=this.tag&31,d=this.posContent(),f=Math.abs(this.length);if(0!==b){if(null!==this.sub)return"("+this.sub.length+" elem)";
b=this.stream.parseStringISO(d,d+Math.min(f,100));return this.reSeemsASCII.test(b)?b.substring(0,200)+(200<b.length?"\u2026":""):this.stream.parseOctetString(d,d+f)}switch(c){case 1:return 0===this.stream.get(d)?"false":"true";case 2:return this.stream.parseInteger(d,d+f);case 3:return this.sub?"("+this.sub.length+" elem)":this.stream.parseBitString(d,d+f);case 4:return this.sub?"("+this.sub.length+" elem)":this.stream.parseOctetString(d,d+f);case 6:return this.stream.parseOID(d,d+f);case 16:case 17:return"("+
this.sub.length+" elem)";case 12:return this.stream.parseStringUTF(d,d+f);case 18:case 19:case 20:case 21:case 22:case 26:return this.stream.parseStringISO(d,d+f);case 30:return this.stream.parseStringBMP(d,d+f);case 23:case 24:return this.stream.parseTime(d,d+f)}return null};c.prototype.toString=function(){return this.typeName()+"@"+this.stream.pos+"[header:"+this.header+",length:"+this.length+",sub:"+(null===this.sub?"null":this.sub.length)+"]"};c.prototype.print=function(b){b===a&&(b="");document.writeln(b+
this);if(null!==this.sub){b+=" ";for(var c=0,d=this.sub.length;c<d;++c)this.sub[c].print(b)}};c.prototype.toPrettyString=function(b){b===a&&(b="");var c=b+this.typeName()+" @"+this.stream.pos;0<=this.length&&(c+="+");c+=this.length;this.tag&32?c+=" (constructed)":3!=this.tag&&4!=this.tag||null===this.sub||(c+=" (encapsulates)");c+="\n";if(null!==this.sub){b+=" ";for(var d=0,e=this.sub.length;d<e;++d)c+=this.sub[d].toPrettyString(b)}return c};c.prototype.toDOM=function(){var a=d.tag("div","node");
a.asn1=this;var b=d.tag("div","head"),c=this.typeName().replace(/_/g," ");b.innerHTML=c;var f=this.content();null!==f&&(f=String(f).replace(/</g,"&lt;"),c=d.tag("span","preview"),c.appendChild(d.text(f)),b.appendChild(c));a.appendChild(b);this.node=a;this.head=b;var l=d.tag("div","value");c="Offset: "+this.stream.pos+"<br/>";c+="Length: "+this.header+"+";c=0<=this.length?c+this.length:c+(-this.length+" (undefined)");this.tag&32?c+="<br/>(constructed)":3!=this.tag&&4!=this.tag||null===this.sub||(c+=
"<br/>(encapsulates)");null!==f&&(c+="<br/>Value:<br/><b>"+f+"</b>","object"===typeof oids&&6==this.tag&&(f=oids[f]))&&(f.d&&(c+="<br/>"+f.d),f.c&&(c+="<br/>"+f.c),f.w&&(c+="<br/>(warning!)"));l.innerHTML=c;a.appendChild(l);c=d.tag("div","sub");if(null!==this.sub)for(f=0,l=this.sub.length;f<l;++f)c.appendChild(this.sub[f].toDOM());a.appendChild(c);b.onclick=function(){a.className="node collapsed"==a.className?"node":"node collapsed"};return a};c.prototype.posStart=function(){return this.stream.pos};
c.prototype.posContent=function(){return this.stream.pos+this.header};c.prototype.posEnd=function(){return this.stream.pos+this.header+Math.abs(this.length)};c.prototype.fakeHover=function(a){this.node.className+=" hover";a&&(this.head.className+=" hover")};c.prototype.fakeOut=function(a){var b=/ ?hover/;this.node.className=this.node.className.replace(b,"");a&&(this.head.className=this.head.className.replace(b,""))};c.prototype.toHexDOM_sub=function(a,b,c,f,l){f>=l||(b=d.tag("span",b),b.appendChild(d.text(c.hexDump(f,
l))),a.appendChild(b))};c.prototype.toHexDOM=function(b){var c=d.tag("span","hex");b===a&&(b=c);this.head.hexNode=c;this.head.onmouseover=function(){this.hexNode.className="hexCurrent"};this.head.onmouseout=function(){this.hexNode.className="hex"};c.asn1=this;c.onmouseover=function(){var a=!b.selected;a&&(b.selected=this.asn1,this.className="hexCurrent");this.asn1.fakeHover(a)};c.onmouseout=function(){var a=b.selected==this.asn1;this.asn1.fakeOut(a);a&&(b.selected=null,this.className="hex")};this.toHexDOM_sub(c,
"tag",this.stream,this.posStart(),this.posStart()+1);this.toHexDOM_sub(c,0<=this.length?"dlen":"ulen",this.stream,this.posStart()+1,this.posContent());if(null===this.sub)c.appendChild(d.text(this.stream.hexDump(this.posContent(),this.posEnd())));else if(0<this.sub.length){var e=this.sub[0],f=this.sub[this.sub.length-1];this.toHexDOM_sub(c,"intro",this.stream,this.posContent(),e.posStart());e=0;for(var l=this.sub.length;e<l;++e)c.appendChild(this.sub[e].toHexDOM(b));this.toHexDOM_sub(c,"outro",this.stream,
f.posEnd(),this.posEnd())}return c};c.prototype.toHexString=function(a){return this.stream.hexDump(this.posStart(),this.posEnd(),!0)};c.decodeLength=function(a){var b=a.get(),c=b&127;if(c==b)return c;if(3<c)throw"Length over 24 bits not supported at position "+(a.pos-1);if(0===c)return-1;for(var d=b=0;d<c;++d)b=b<<8|a.get();return b};c.hasContent=function(a,d,f){if(a&32)return!0;if(3>a||4<a)return!1;var e=new b(f);3==a&&e.get();if(e.get()>>6&1)return!1;try{var g=c.decodeLength(e);return e.pos-f.pos+
g==d}catch(r){return!1}};c.decode=function(a){a instanceof b||(a=new b(a,0));var d=new b(a),e=a.get(),f=c.decodeLength(a),l=a.pos-d.pos,m=null;if(c.hasContent(e,f,a)){var n=a.pos;3==e&&a.get();m=[];if(0<=f){for(var p=n+f;a.pos<p;)m[m.length]=c.decode(a);if(a.pos!=p)throw"Content size is not correct for container starting at offset "+n;}else try{for(;;){p=c.decode(a);if(0===p.tag)break;m[m.length]=p}f=n-a.pos}catch(V){throw"Exception while decoding undefined length content: "+V;}}else a.pos+=f;return new c(d,
l,f,e,m)};c.test=function(){for(var a=[{value:[39],expected:39},{value:[129,201],expected:201},{value:[131,254,220,186],expected:16702650}],d=0,f=a.length;d<f;++d){var k=new b(a[d].value,0);k=c.decodeLength(k);k!=a[d].expected&&document.write("In test["+d+"] expected "+a[d].expected+" got "+k+"\n")}};window.ASN1=c})();ASN1.prototype.getHexStringValue=function(){return this.toHexString().substr(2*this.header,2*this.length)};p.prototype.parseKey=function(a){try{var b=0,c=0,d=/^\s*(?:[0-9A-Fa-f][0-9A-Fa-f]\s*)+$/.test(a)?
Hex.decode(a):Base64.unarmor(a),e=ASN1.decode(d);3===e.sub.length&&(e=e.sub[2].sub[0]);if(9===e.sub.length){b=e.sub[1].getHexStringValue();this.n=m(b,16);c=e.sub[2].getHexStringValue();this.e=parseInt(c,16);var f=e.sub[3].getHexStringValue();this.d=m(f,16);var g=e.sub[4].getHexStringValue();this.p=m(g,16);var k=e.sub[5].getHexStringValue();this.q=m(k,16);var l=e.sub[6].getHexStringValue();this.dmp1=m(l,16);var n=e.sub[7].getHexStringValue();this.dmq1=m(n,16);var p=e.sub[8].getHexStringValue();this.coeff=
m(p,16)}else if(2===e.sub.length){var q=e.sub[1].sub[0];b=q.sub[0].getHexStringValue();this.n=m(b,16);c=q.sub[1].getHexStringValue();this.e=parseInt(c,16)}else return!1;return!0}catch(V){return!1}};p.prototype.getPrivateBaseKey=function(){var a={array:[new KJUR.asn1.DERInteger({"int":0}),new KJUR.asn1.DERInteger({bigint:this.n}),new KJUR.asn1.DERInteger({"int":this.e}),new KJUR.asn1.DERInteger({bigint:this.d}),new KJUR.asn1.DERInteger({bigint:this.p}),new KJUR.asn1.DERInteger({bigint:this.q}),new KJUR.asn1.DERInteger({bigint:this.dmp1}),
new KJUR.asn1.DERInteger({bigint:this.dmq1}),new KJUR.asn1.DERInteger({bigint:this.coeff})]};return(new KJUR.asn1.DERSequence(a)).getEncodedHex()};p.prototype.getPrivateBaseKeyB64=function(){return O(this.getPrivateBaseKey())};p.prototype.getPublicBaseKey=function(){var a={array:[new KJUR.asn1.DERObjectIdentifier({oid:"1.2.840.113549.1.1.1"}),new KJUR.asn1.DERNull]},b=new KJUR.asn1.DERSequence(a);a={array:[new KJUR.asn1.DERInteger({bigint:this.n}),new KJUR.asn1.DERInteger({"int":this.e})]};a={hex:"00"+
(new KJUR.asn1.DERSequence(a)).getEncodedHex()};a=new KJUR.asn1.DERBitString(a);a={array:[b,a]};return(new KJUR.asn1.DERSequence(a)).getEncodedHex()};p.prototype.getPublicBaseKeyB64=function(){return O(this.getPublicBaseKey())};p.prototype.wordwrap=function(a,b){b=b||64;return a?a.match(RegExp("(.{1,"+b+"})( +|$\n?)|(.{1,"+b+"})","g")).join("\n"):a};p.prototype.getPrivateKey=function(){return"-----BEGIN RSA PRIVATE KEY-----\n"+(this.wordwrap(this.getPrivateBaseKeyB64())+"\n")+"-----END RSA PRIVATE KEY-----"};
p.prototype.getPublicKey=function(){return"-----BEGIN PUBLIC KEY-----\n"+(this.wordwrap(this.getPublicBaseKeyB64())+"\n")+"-----END PUBLIC KEY-----"};p.prototype.hasPublicKeyProperty=function(a){a=a||{};return a.hasOwnProperty("n")&&a.hasOwnProperty("e")};p.prototype.hasPrivateKeyProperty=function(a){a=a||{};return a.hasOwnProperty("n")&&a.hasOwnProperty("e")&&a.hasOwnProperty("d")&&a.hasOwnProperty("p")&&a.hasOwnProperty("q")&&a.hasOwnProperty("dmp1")&&a.hasOwnProperty("dmq1")&&a.hasOwnProperty("coeff")};
p.prototype.parsePropertiesFrom=function(a){this.n=a.n;this.e=a.e;a.hasOwnProperty("d")&&(this.d=a.d,this.p=a.p,this.q=a.q,this.dmp1=a.dmp1,this.dmq1=a.dmq1,this.coeff=a.coeff)};var F=function(a){p.call(this);a&&("string"===typeof a?this.parseKey(a):(this.hasPrivateKeyProperty(a)||this.hasPublicKeyProperty(a))&&this.parsePropertiesFrom(a))};F.prototype=new p;F.prototype.constructor=F;l=function(a){a=a||{};this.default_key_size=parseInt(a.default_key_size)||1024;this.default_public_exponent=a.default_public_exponent||
"010001";this.log=a.log||!1;this.key=null};l.prototype.setKey=function(a){this.log&&this.key&&console.warn("A key was already set, overriding existing.");this.key=new F(a)};l.prototype.setPrivateKey=function(a){this.setKey(a)};l.prototype.setPublicKey=function(a){this.setKey(a)};l.prototype.decrypt=function(a){try{return this.getKey().decrypt(ba(a))}catch(b){return!1}};l.prototype.encrypt=function(a){try{return O(this.getKey().encrypt(a))}catch(b){return!1}};l.prototype.getKey=function(a){if(!this.key){this.key=
new F;if(a&&"[object Function]"==={}.toString.call(a)){this.key.generateAsync(this.default_key_size,this.default_public_exponent,a);return}this.key.generate(this.default_key_size,this.default_public_exponent)}return this.key};l.prototype.getPrivateKey=function(){return this.getKey().getPrivateKey()};l.prototype.getPrivateKeyB64=function(){return this.getKey().getPrivateBaseKeyB64()};l.prototype.getPublicKey=function(){return this.getKey().getPublicKey()};l.prototype.getPublicKeyB64=function(){return this.getKey().getPublicBaseKeyB64()};
l.version="2.3.0";M.JSEncrypt=l})(JSEncryptExports);(function(M,f){"object"===typeof exports&&"undefined"!==typeof module?module.exports=f:"function"===typeof define&&define.amd?define(f):M.JSEncrypt=f})(this,JSEncryptExports.JSEncrypt);