开启辅助访问 切换到宽版

精易论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

用微信号发送消息登录论坛

新人指南 邀请好友注册 - 我关注人的新帖 教你赚取精币 - 每日签到


求职/招聘- 论坛接单- 开发者大厅

论坛版规 总版规 - 建议/投诉 - 应聘版主 - 精华帖总集 积分说明 - 禁言标准 - 有奖举报

查看: 3954|回复: 4
收起左侧

[已解决] JSEncrypt JS RSA加一个解密函数

 关闭 [复制链接]
结帖率:91% (21/23)
发表于 2018-1-10 16:55:51 | 显示全部楼层 |阅读模式   河北省廊坊市
40精币
  1. var navigator = {};
  2. var window = {};

  3.        function getEntryptPwd(pwd,pbk){
  4.                 var pubKey = pbk;
  5.                 var encrypt = new JSEncrypt();
  6.                 encrypt.setPublicKey(pubKey);
  7.                 return encrypt.encrypt(pwd);
  8.                 }
  9.                                
  10.         //这里改成解密                       
  11. function getDetryptPwd(pwd,pbk){
  12.                 var pubKey = pbk;
  13.                 var encrypt = new JSEncrypt();
  14.                 encrypt.setPublicKey(pubKey);
  15.                 return encrypt.decrypt(pwd);
  16.                 }


  17. /*! JSEncrypt v2.3.1 | https://npmcdn.com/jsencrypt@2.3.1/LICENSE.txt */
  18. !function(t,e){
  19.     "function"==typeof define&&define.amd?define(["exports"],e):e("object"==typeof exports&&"string"!=typeof exports.nodeName?module.exports:t)
  20. }
  21. (this,function(t){
  22.     function e(t,e,i){
  23.         null!=t&&("number"==typeof t?this.fromNumber(t,e,i):null==e&&"string"!=typeof t?this.fromString(t,256):this.fromString(t,e))
  24.     }
  25.     function i(){
  26.         return new e(null)
  27.     }
  28.     function r(t,e,i,r,s,n){
  29.         for(;
  30.         --n>=0;
  31.         ){
  32.             var o=e*this[t++]+i[r]+s;
  33.             s=Math.floor(o/67108864),i[r++]=67108863&o
  34.         }
  35.         return s
  36.     }
  37.     function s(t,e,i,r,s,n){
  38.         for(var o=32767&e,h=e>>15;
  39.         --n>=0;
  40.         ){
  41.             var a=32767&this[t],u=this[t++]>>15,c=h*a+u*o;
  42.             a=o*a+((32767&c)<<15)+i[r]+(1073741823&s),s=(a>>>30)+(c>>>15)+h*u+(s>>>30),i[r++]=1073741823&a
  43.         }
  44.         return s
  45.     }
  46.     function n(t,e,i,r,s,n){
  47.         for(var o=16383&e,h=e>>14;
  48.         --n>=0;
  49.         ){
  50.             var a=16383&this[t],u=this[t++]>>14,c=h*a+u*o;
  51.             a=o*a+((16383&c)<<14)+i[r]+s,s=(a>>28)+(c>>14)+h*u,i[r++]=268435455&a
  52.         }
  53.         return s
  54.     }
  55.     function o(t){
  56.         return Be.charAt(t)
  57.     }
  58.     function h(t,e){
  59.         var i=Ke[t.charCodeAt(e)];
  60.         return null==i?-1:i
  61.     }
  62.     function a(t){
  63.         for(var e=this.t-1;
  64.         e>=0;
  65.         --e)t[e]=this[e];
  66.         t.t=this.t,t.s=this.s
  67.     }
  68.     function u(t){
  69.         this.t=1,this.s=0>t?-1:0,t>0?this[0]=t:-1>t?this[0]=t+this.DV:this.t=0
  70.     }
  71.     function c(t){
  72.         var e=i();
  73.         return e.fromInt(t),e
  74.     }
  75.     function f(t,i){
  76.         var r;
  77.         if(16==i)r=4;
  78.         else if(8==i)r=3;
  79.         else if(256==i)r=8;
  80.         else if(2==i)r=1;
  81.         else if(32==i)r=5;
  82.         else{
  83.             if(4!=i)return void this.fromRadix(t,i);
  84.             r=2
  85.         }
  86.         this.t=0,this.s=0;
  87.         for(var s=t.length,n=!1,o=0;
  88.         --s>=0;
  89.         ){
  90.             var a=8==r?255&t[s]:h(t,s);
  91.             0>a?"-"==t.charAt(s)&&(n=!0):(n=!1,0==o?this[this.t++]=a:o+r>this.DB?(this[this.t-1]|=(a&(1<<this.DB-o)-1)<<o,this[this.t++]=a>>this.DB-o):this[this.t-1]|=a<<o,o+=r,o>=this.DB&&(o-=this.DB))
  92.         }
  93.         8==r&&0!=(128&t[0])&&(this.s=-1,o>0&&(this[this.t-1]|=(1<<this.DB-o)-1<<o)),this.clamp(),n&&e.ZERO.subTo(this,this)
  94.     }
  95.     function p(){
  96.         for(var t=this.s&this.DM;
  97.         this.t>0&&this[this.t-1]==t;
  98.         )--this.t
  99.     }
  100.     function l(t){
  101.         if(this.s<0)return"-"+this.negate().toString(t);
  102.         var e;
  103.         if(16==t)e=4;
  104.         else if(8==t)e=3;
  105.         else if(2==t)e=1;
  106.         else if(32==t)e=5;
  107.         else{
  108.             if(4!=t)return this.toRadix(t);
  109.             e=2
  110.         }
  111.         var i,r=(1<<e)-1,s=!1,n="",h=this.t,a=this.DB-h*this.DB%e;
  112.         if(h-- >0)for(a<this.DB&&(i=this[h]>>a)>0&&(s=!0,n=o(i));
  113.         h>=0;
  114.         )e>a?(i=(this[h]&(1<<a)-1)<<e-a,i|=this[--h]>>(a+=this.DB-e)):(i=this[h]>>(a-=e)&r,0>=a&&(a+=this.DB,--h)),i>0&&(s=!0),s&&(n+=o(i));
  115.         return s?n:"0"
  116.     }
  117.     function d(){
  118.         var t=i();
  119.         return e.ZERO.subTo(this,t),t
  120.     }
  121.     function g(){
  122.         return this.s<0?this.negate():this
  123.     }
  124.     function m(t){
  125.         var e=this.s-t.s;
  126.         if(0!=e)return e;
  127.         var i=this.t;
  128.         if(e=i-t.t,0!=e)return this.s<0?-e:e;
  129.         for(;
  130.         --i>=0;
  131.         )if(0!=(e=this[i]-t[i]))return e;
  132.         return 0
  133.     }
  134.     function y(t){
  135.         var e,i=1;
  136.         return 0!=(e=t>>>16)&&(t=e,i+=16),0!=(e=t>>8)&&(t=e,i+=8),0!=(e=t>>4)&&(t=e,i+=4),0!=(e=t>>2)&&(t=e,i+=2),0!=(e=t>>1)&&(t=e,i+=1),i
  137.     }
  138.     function b(){
  139.         return this.t<=0?0:this.DB*(this.t-1)+y(this[this.t-1]^this.s&this.DM)
  140.     }
  141.     function T(t,e){
  142.         var i;
  143.         for(i=this.t-1;
  144.         i>=0;
  145.         --i)e[i+t]=this[i];
  146.         for(i=t-1;
  147.         i>=0;
  148.         --i)e[i]=0;
  149.         e.t=this.t+t,e.s=this.s
  150.     }
  151.     function S(t,e){
  152.         for(var i=t;
  153.         i<this.t;
  154.         ++i)e[i-t]=this[i];
  155.         e.t=Math.max(this.t-t,0),e.s=this.s
  156.     }
  157.     function R(t,e){
  158.         var i,r=t%this.DB,s=this.DB-r,n=(1<<s)-1,o=Math.floor(t/this.DB),h=this.s<<r&this.DM;
  159.         for(i=this.t-1;
  160.         i>=0;
  161.         --i)e[i+o+1]=this[i]>>s|h,h=(this[i]&n)<<r;
  162.         for(i=o-1;
  163.         i>=0;
  164.         --i)e[i]=0;
  165.         e[o]=h,e.t=this.t+o+1,e.s=this.s,e.clamp()
  166.     }
  167.     function E(t,e){
  168.         e.s=this.s;
  169.         var i=Math.floor(t/this.DB);
  170.         if(i>=this.t)return void(e.t=0);
  171.         var r=t%this.DB,s=this.DB-r,n=(1<<r)-1;
  172.         e[0]=this[i]>>r;
  173.         for(var o=i+1;
  174.         o<this.t;
  175.         ++o)e[o-i-1]|=(this[o]&n)<<s,e[o-i]=this[o]>>r;
  176.         r>0&&(e[this.t-i-1]|=(this.s&n)<<s),e.t=this.t-i,e.clamp()
  177.     }
  178.     function D(t,e){
  179.         for(var i=0,r=0,s=Math.min(t.t,this.t);
  180.         s>i;
  181.         )r+=this[i]-t[i],e[i++]=r&this.DM,r>>=this.DB;
  182.         if(t.t<this.t){
  183.             for(r-=t.s;
  184.             i<this.t;
  185.             )r+=this[i],e[i++]=r&this.DM,r>>=this.DB;
  186.             r+=this.s
  187.         }
  188.         else{
  189.             for(r+=this.s;
  190.             i<t.t;
  191.             )r-=t[i],e[i++]=r&this.DM,r>>=this.DB;
  192.             r-=t.s
  193.         }
  194.         e.s=0>r?-1:0,-1>r?e[i++]=this.DV+r:r>0&&(e[i++]=r),e.t=i,e.clamp()
  195.     }
  196.     function w(t,i){
  197.         var r=this.abs(),s=t.abs(),n=r.t;
  198.         for(i.t=n+s.t;
  199.         --n>=0;
  200.         )i[n]=0;
  201.         for(n=0;
  202.         n<s.t;
  203.         ++n)i[n+r.t]=r.am(0,s[n],i,n,0,r.t);
  204.         i.s=0,i.clamp(),this.s!=t.s&&e.ZERO.subTo(i,i)
  205.     }
  206.     function x(t){
  207.         for(var e=this.abs(),i=t.t=2*e.t;
  208.         --i>=0;
  209.         )t[i]=0;
  210.         for(i=0;
  211.         i<e.t-1;
  212.         ++i){
  213.             var r=e.am(i,e[i],t,2*i,0,1);
  214.             (t[i+e.t]+=e.am(i+1,2*e[i],t,2*i+1,r,e.t-i-1))>=e.DV&&(t[i+e.t]-=e.DV,t[i+e.t+1]=1)
  215.         }
  216.         t.t>0&&(t[t.t-1]+=e.am(i,e[i],t,2*i,0,1)),t.s=0,t.clamp()
  217.     }
  218.     function B(t,r,s){
  219.         var n=t.abs();
  220.         if(!(n.t<=0)){
  221.             var o=this.abs();
  222.             if(o.t<n.t)return null!=r&&r.fromInt(0),void(null!=s&&this.copyTo(s));
  223.             null==s&&(s=i());
  224.             var h=i(),a=this.s,u=t.s,c=this.DB-y(n[n.t-1]);
  225.             c>0?(n.lShiftTo(c,h),o.lShiftTo(c,s)):(n.copyTo(h),o.copyTo(s));
  226.             var f=h.t,p=h[f-1];
  227.             if(0!=p){
  228.                 var l=p*(1<<this.F1)+(f>1?h[f-2]>>this.F2:0),d=this.FV/l,g=(1<<this.F1)/l,m=1<<this.F2,v=s.t,b=v-f,T=null==r?i():r;
  229.                 for(h.dlShiftTo(b,T),s.compareTo(T)>=0&&(s[s.t++]=1,s.subTo(T,s)),e.ONE.dlShiftTo(f,T),T.subTo(h,h);
  230.                 h.t<f;
  231.                 )h[h.t++]=0;
  232.                 for(;
  233.                 --b>=0;
  234.                 ){
  235.                     var S=s[--v]==p?this.DM:Math.floor(s[v]*d+(s[v-1]+m)*g);
  236.                     if((s[v]+=h.am(0,S,s,b,0,f))<S)for(h.dlShiftTo(b,T),s.subTo(T,s);
  237.                     s[v]<--S;
  238.                     )s.subTo(T,s)
  239.                 }
  240.                 null!=r&&(s.drShiftTo(f,r),a!=u&&e.ZERO.subTo(r,r)),s.t=f,s.clamp(),c>0&&s.rShiftTo(c,s),0>a&&e.ZERO.subTo(s,s)
  241.             }
  242.             
  243.         }
  244.         
  245.     }
  246.     function K(t){
  247.         var r=i();
  248.         return this.abs().divRemTo(t,null,r),this.s<0&&r.compareTo(e.ZERO)>0&&t.subTo(r,r),r
  249.     }
  250.     function A(t){
  251.         this.m=t
  252.     }
  253.     function U(t){
  254.         return t.s<0||t.compareTo(this.m)>=0?t.mod(this.m):t
  255.     }
  256.     function O(t){
  257.         return t
  258.     }
  259.     function V(t){
  260.         t.divRemTo(this.m,null,t)
  261.     }
  262.     function N(t,e,i){
  263.         t.multiplyTo(e,i),this.reduce(i)
  264.     }
  265.     function J(t,e){
  266.         t.squareTo(e),this.reduce(e)
  267.     }
  268.     function I(){
  269.         if(this.t<1)return 0;
  270.         var t=this[0];
  271.         if(0==(1&t))return 0;
  272.         var e=3&t;
  273.         return e=e*(2-(15&t)*e)&15,e=e*(2-(255&t)*e)&255,e=e*(2-((65535&t)*e&65535))&65535,e=e*(2-t*e%this.DV)%this.DV,e>0?this.DV-e:-e
  274.     }
  275.     function P(t){
  276.         this.m=t,this.mp=t.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<<t.DB-15)-1,this.mt2=2*t.t
  277.     }
  278.     function M(t){
  279.         var r=i();
  280.         return t.abs().dlShiftTo(this.m.t,r),r.divRemTo(this.m,null,r),t.s<0&&r.compareTo(e.ZERO)>0&&this.m.subTo(r,r),r
  281.     }
  282.     function L(t){
  283.         var e=i();
  284.         return t.copyTo(e),this.reduce(e),e
  285.     }
  286.     function q(t){
  287.         for(;
  288.         t.t<=this.mt2;
  289.         )t[t.t++]=0;
  290.         for(var e=0;
  291.         e<this.m.t;
  292.         ++e){
  293.             var i=32767&t[e],r=i*this.mpl+((i*this.mph+(t[e]>>15)*this.mpl&this.um)<<15)&t.DM;
  294.             for(i=e+this.m.t,t[i]+=this.m.am(0,r,t,e,0,this.m.t);
  295.             t[i]>=t.DV;
  296.             )t[i]-=t.DV,t[++i]++
  297.         }
  298.         t.clamp(),t.drShiftTo(this.m.t,t),t.compareTo(this.m)>=0&&t.subTo(this.m,t)
  299.     }
  300.     function C(t,e){
  301.         t.squareTo(e),this.reduce(e)
  302.     }
  303.     function H(t,e,i){
  304.         t.multiplyTo(e,i),this.reduce(i)
  305.     }
  306.     function j(){
  307.         return 0==(this.t>0?1&this[0]:this.s)
  308.     }
  309.     function k(t,r){
  310.         if(t>4294967295||1>t)return e.ONE;
  311.         var s=i(),n=i(),o=r.convert(this),h=y(t)-1;
  312.         for(o.copyTo(s);
  313.         --h>=0;
  314.         )if(r.sqrTo(s,n),(t&1<<h)>0)r.mulTo(n,o,s);
  315.         else{
  316.             var a=s;
  317.             s=n,n=a
  318.         }
  319.         return r.revert(s)
  320.     }
  321.     function F(t,e){
  322.         var i;
  323.         return i=256>t||e.isEven()?new A(e):new P(e),this.exp(t,i)
  324.     }
  325.     // Copyright (c) 2005-2009  Tom Wu
  326.     // All Rights Reserved.
  327.     // See "LICENSE" for details.
  328.     function _(){
  329.         var t=i();
  330.         return this.copyTo(t),t
  331.     }
  332.     function z(){
  333.         if(this.s<0){
  334.             if(1==this.t)return this[0]-this.DV;
  335.             if(0==this.t)return-1
  336.         }
  337.         else{
  338.             if(1==this.t)return this[0];
  339.             if(0==this.t)return 0
  340.         }
  341.         return(this[1]&(1<<32-this.DB)-1)<<this.DB|this[0]
  342.     }
  343.     function Z(){
  344.         return 0==this.t?this.s:this[0]<<24>>24
  345.     }
  346.     function G(){
  347.         return 0==this.t?this.s:this[0]<<16>>16
  348.     }
  349.     function $(t){
  350.         return Math.floor(Math.LN2*this.DB/Math.log(t))
  351.     }
  352.     function Y(){
  353.         return this.s<0?-1:this.t<=0||1==this.t&&this[0]<=0?0:1
  354.     }
  355.     function W(t){
  356.         if(null==t&&(t=10),0==this.signum()||2>t||t>36)return"0";
  357.         var e=this.chunkSize(t),r=Math.pow(t,e),s=c(r),n=i(),o=i(),h="";
  358.         for(this.divRemTo(s,n,o);
  359.         n.signum()>0;
  360.         )h=(r+o.intValue()).toString(t).substr(1)+h,n.divRemTo(s,n,o);
  361.         return o.intValue().toString(t)+h
  362.     }
  363.     function Q(t,i){
  364.         this.fromInt(0),null==i&&(i=10);
  365.         for(var r=this.chunkSize(i),s=Math.pow(i,r),n=!1,o=0,a=0,u=0;
  366.         u<t.length;
  367.         ++u){
  368.             var c=h(t,u);
  369.             0>c?"-"==t.charAt(u)&&0==this.signum()&&(n=!0):(a=i*a+c,++o>=r&&(this.dMultiply(s),this.dAddOffset(a,0),o=0,a=0))
  370.         }
  371.         o>0&&(this.dMultiply(Math.pow(i,o)),this.dAddOffset(a,0)),n&&e.ZERO.subTo(this,this)
  372.     }
  373.     function X(t,i,r){
  374.         if("number"==typeof i)if(2>t)this.fromInt(1);
  375.         else for(this.fromNumber(t,r),this.testBit(t-1)||this.bitwiseTo(e.ONE.shiftLeft(t-1),ht,this),this.isEven()&&this.dAddOffset(1,0);
  376.         !this.isProbablePrime(i);
  377.         )this.dAddOffset(2,0),this.bitLength()>t&&this.subTo(e.ONE.shiftLeft(t-1),this);
  378.         else{
  379.             var s=new Array,n=7&t;
  380.             s.length=(t>>3)+1,i.nextBytes(s),n>0?s[0]&=(1<<n)-1:s[0]=0,this.fromString(s,256)
  381.         }
  382.         
  383.     }
  384.     function tt(){
  385.         var t=this.t,e=new Array;
  386.         e[0]=this.s;
  387.         var i,r=this.DB-t*this.DB%8,s=0;
  388.         if(t-- >0)for(r<this.DB&&(i=this[t]>>r)!=(this.s&this.DM)>>r&&(e[s++]=i|this.s<<this.DB-r);
  389.         t>=0;
  390.         )8>r?(i=(this[t]&(1<<r)-1)<<8-r,i|=this[--t]>>(r+=this.DB-8)):(i=this[t]>>(r-=8)&255,0>=r&&(r+=this.DB,--t)),0!=(128&i)&&(i|=-256),0==s&&(128&this.s)!=(128&i)&&++s,(s>0||i!=this.s)&&(e[s++]=i);
  391.         return e
  392.     }
  393.     function et(t){
  394.         return 0==this.compareTo(t)
  395.     }
  396.     function it(t){
  397.         return this.compareTo(t)<0?this:t
  398.     }
  399.     function rt(t){
  400.         return this.compareTo(t)>0?this:t
  401.     }
  402.     function st(t,e,i){
  403.         var r,s,n=Math.min(t.t,this.t);
  404.         for(r=0;
  405.         n>r;
  406.         ++r)i[r]=e(this[r],t[r]);
  407.         if(t.t<this.t){
  408.             for(s=t.s&this.DM,r=n;
  409.             r<this.t;
  410.             ++r)i[r]=e(this[r],s);
  411.             i.t=this.t
  412.         }
  413.         else{
  414.             for(s=this.s&this.DM,r=n;
  415.             r<t.t;
  416.             ++r)i[r]=e(s,t[r]);
  417.             i.t=t.t
  418.         }
  419.         i.s=e(this.s,t.s),i.clamp()
  420.     }
  421.     function nt(t,e){
  422.         return t&e
  423.     }
  424.     function ot(t){
  425.         var e=i();
  426.         return this.bitwiseTo(t,nt,e),e
  427.     }
  428.     function ht(t,e){
  429.         return t|e
  430.     }
  431.     function at(t){
  432.         var e=i();
  433.         return this.bitwiseTo(t,ht,e),e
  434.     }
  435.     function ut(t,e){
  436.         return t^e
  437.     }
  438.     function ct(t){
  439.         var e=i();
  440.         return this.bitwiseTo(t,ut,e),e
  441.     }
  442.     function ft(t,e){
  443.         return t&~e
  444.     }
  445.     function pt(t){
  446.         var e=i();
  447.         return this.bitwiseTo(t,ft,e),e
  448.     }
  449.     function lt(){
  450.         for(var t=i(),e=0;
  451.         e<this.t;
  452.         ++e)t[e]=this.DM&~this[e];
  453.         return t.t=this.t,t.s=~this.s,t
  454.     }
  455.     function dt(t){
  456.         var e=i();
  457.         return 0>t?this.rShiftTo(-t,e):this.lShiftTo(t,e),e
  458.     }
  459.     function gt(t){
  460.         var e=i();
  461.         return 0>t?this.lShiftTo(-t,e):this.rShiftTo(t,e),e
  462.     }
  463.     function mt(t){
  464.         if(0==t)return-1;
  465.         var e=0;
  466.         return 0==(65535&t)&&(t>>=16,e+=16),0==(255&t)&&(t>>=8,e+=8),0==(15&t)&&(t>>=4,e+=4),0==(3&t)&&(t>>=2,e+=2),0==(1&t)&&++e,e
  467.     }
  468.     function yt(){
  469.         for(var t=0;
  470.         t<this.t;
  471.         ++t)if(0!=this[t])return t*this.DB+mt(this[t]);
  472.         return this.s<0?this.t*this.DB:-1
  473.     }
  474.     function vt(t){
  475.         for(var e=0;
  476.         0!=t;
  477.         )t&=t-1,++e;
  478.         return e
  479.     }
  480.     function bt(){
  481.         for(var t=0,e=this.s&this.DM,i=0;
  482.         i<this.t;
  483.         ++i)t+=vt(this[i]^e);
  484.         return t
  485.     }
  486.     function Tt(t){
  487.         var e=Math.floor(t/this.DB);
  488.         return e>=this.t?0!=this.s:0!=(this[e]&1<<t%this.DB)
  489.     }
  490.     function St(t,i){
  491.         var r=e.ONE.shiftLeft(t);
  492.         return this.bitwiseTo(r,i,r),r
  493.     }
  494.     function Rt(t){
  495.         return this.changeBit(t,ht)
  496.     }
  497.     function Et(t){
  498.         return this.changeBit(t,ft)
  499.     }
  500.     function Dt(t){
  501.         return this.changeBit(t,ut)
  502.     }
  503.     function wt(t,e){
  504.         for(var i=0,r=0,s=Math.min(t.t,this.t);
  505.         s>i;
  506.         )r+=this[i]+t[i],e[i++]=r&this.DM,r>>=this.DB;
  507.         if(t.t<this.t){
  508.             for(r+=t.s;
  509.             i<this.t;
  510.             )r+=this[i],e[i++]=r&this.DM,r>>=this.DB;
  511.             r+=this.s
  512.         }
  513.         else{
  514.             for(r+=this.s;
  515.             i<t.t;
  516.             )r+=t[i],e[i++]=r&this.DM,r>>=this.DB;
  517.             r+=t.s
  518.         }
  519.         e.s=0>r?-1:0,r>0?e[i++]=r:-1>r&&(e[i++]=this.DV+r),e.t=i,e.clamp()
  520.     }
  521.     function xt(t){
  522.         var e=i();
  523.         return this.addTo(t,e),e
  524.     }
  525.     function Bt(t){
  526.         var e=i();
  527.         return this.subTo(t,e),e
  528.     }
  529.     function Kt(t){
  530.         var e=i();
  531.         return this.multiplyTo(t,e),e
  532.     }
  533.     function At(){
  534.         var t=i();
  535.         return this.squareTo(t),t
  536.     }
  537.     function Ut(t){
  538.         var e=i();
  539.         return this.divRemTo(t,e,null),e
  540.     }
  541.     function Ot(t){
  542.         var e=i();
  543.         return this.divRemTo(t,null,e),e
  544.     }
  545.     function Vt(t){
  546.         var e=i(),r=i();
  547.         return this.divRemTo(t,e,r),new Array(e,r)
  548.     }
  549.     function Nt(t){
  550.         this[this.t]=this.am(0,t-1,this,0,0,this.t),++this.t,this.clamp()
  551.     }
  552.     function Jt(t,e){
  553.         if(0!=t){
  554.             for(;
  555.             this.t<=e;
  556.             )this[this.t++]=0;
  557.             for(this[e]+=t;
  558.             this[e]>=this.DV;
  559.             )this[e]-=this.DV,++e>=this.t&&(this[this.t++]=0),++this[e]
  560.         }
  561.         
  562.     }
  563.     function It(){}function Pt(t){
  564.         return t
  565.     }
  566.     function Mt(t,e,i){
  567.         t.multiplyTo(e,i)
  568.     }
  569.     function Lt(t,e){
  570.         t.squareTo(e)
  571.     }
  572.     function qt(t){
  573.         return this.exp(t,new It)
  574.     }
  575.     function Ct(t,e,i){
  576.         var r=Math.min(this.t+t.t,e);
  577.         for(i.s=0,i.t=r;
  578.         r>0;
  579.         )i[--r]=0;
  580.         var s;
  581.         for(s=i.t-this.t;
  582.         s>r;
  583.         ++r)i[r+this.t]=this.am(0,t[r],i,r,0,this.t);
  584.         for(s=Math.min(t.t,e);
  585.         s>r;
  586.         ++r)this.am(0,t[r],i,r,0,e-r);
  587.         i.clamp()
  588.     }
  589.     function Ht(t,e,i){
  590.         --e;
  591.         var r=i.t=this.t+t.t-e;
  592.         for(i.s=0;
  593.         --r>=0;
  594.         )i[r]=0;
  595.         for(r=Math.max(e-this.t,0);
  596.         r<t.t;
  597.         ++r)i[this.t+r-e]=this.am(e-r,t[r],i,0,0,this.t+r-e);
  598.         i.clamp(),i.drShiftTo(1,i)
  599.     }
  600.     function jt(t){
  601.         this.r2=i(),this.q3=i(),e.ONE.dlShiftTo(2*t.t,this.r2),this.mu=this.r2.divide(t),this.m=t
  602.     }
  603.     function kt(t){
  604.         if(t.s<0||t.t>2*this.m.t)return t.mod(this.m);
  605.         if(t.compareTo(this.m)<0)return t;
  606.         var e=i();
  607.         return t.copyTo(e),this.reduce(e),e
  608.     }
  609.     function Ft(t){
  610.         return t
  611.     }
  612.     function _t(t){
  613.         for(t.drShiftTo(this.m.t-1,this.r2),t.t>this.m.t+1&&(t.t=this.m.t+1,t.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);
  614.         t.compareTo(this.r2)<0;
  615.         )t.dAddOffset(1,this.m.t+1);
  616.         for(t.subTo(this.r2,t);
  617.         t.compareTo(this.m)>=0;
  618.         )t.subTo(this.m,t)
  619.     }
  620.     function zt(t,e){
  621.         t.squareTo(e),this.reduce(e)
  622.     }
  623.     function Zt(t,e,i){
  624.         t.multiplyTo(e,i),this.reduce(i)
  625.     }
  626.     function Gt(t,e){
  627.         var r,s,n=t.bitLength(),o=c(1);
  628.         if(0>=n)return o;
  629.         r=18>n?1:48>n?3:144>n?4:768>n?5:6,s=8>n?new A(e):e.isEven()?new jt(e):new P(e);
  630.         var h=new Array,a=3,u=r-1,f=(1<<r)-1;
  631.         if(h[1]=s.convert(this),r>1){
  632.             var p=i();
  633.             for(s.sqrTo(h[1],p);
  634.             f>=a;
  635.             )h[a]=i(),s.mulTo(p,h[a-2],h[a]),a+=2
  636.         }
  637.         var l,d,g=t.t-1,m=!0,v=i();
  638.         for(n=y(t[g])-1;
  639.         g>=0;
  640.         ){
  641.             for(n>=u?l=t[g]>>n-u&f:(l=(t[g]&(1<<n+1)-1)<<u-n,g>0&&(l|=t[g-1]>>this.DB+n-u)),a=r;
  642.             0==(1&l);
  643.             )l>>=1,--a;
  644.             if((n-=a)<0&&(n+=this.DB,--g),m)h[l].copyTo(o),m=!1;
  645.             else{
  646.                 for(;
  647.                 a>1;
  648.                 )s.sqrTo(o,v),s.sqrTo(v,o),a-=2;
  649.                 a>0?s.sqrTo(o,v):(d=o,o=v,v=d),s.mulTo(v,h[l],o)
  650.             }
  651.             for(;
  652.             g>=0&&0==(t[g]&1<<n);
  653.             )s.sqrTo(o,v),d=o,o=v,v=d,--n<0&&(n=this.DB-1,--g)
  654.         }
  655.         return s.revert(o)
  656.     }
  657.     function $t(t){
  658.         var e=this.s<0?this.negate():this.clone(),i=t.s<0?t.negate():t.clone();
  659.         if(e.compareTo(i)<0){
  660.             var r=e;
  661.             e=i,i=r
  662.         }
  663.         var s=e.getLowestSetBit(),n=i.getLowestSetBit();
  664.         if(0>n)return e;
  665.         for(n>s&&(n=s),n>0&&(e.rShiftTo(n,e),i.rShiftTo(n,i));
  666.         e.signum()>0;
  667.         )(s=e.getLowestSetBit())>0&&e.rShiftTo(s,e),(s=i.getLowestSetBit())>0&&i.rShiftTo(s,i),e.compareTo(i)>=0?(e.subTo(i,e),e.rShiftTo(1,e)):(i.subTo(e,i),i.rShiftTo(1,i));
  668.         return n>0&&i.lShiftTo(n,i),i
  669.     }
  670.     function Yt(t){
  671.         if(0>=t)return 0;
  672.         var e=this.DV%t,i=this.s<0?t-1:0;
  673.         if(this.t>0)if(0==e)i=this[0]%t;
  674.         else for(var r=this.t-1;
  675.         r>=0;
  676.         --r)i=(e*i+this[r])%t;
  677.         return i
  678.     }
  679.     function Wt(t){
  680.         var i=t.isEven();
  681.         if(this.isEven()&&i||0==t.signum())return e.ZERO;
  682.         for(var r=t.clone(),s=this.clone(),n=c(1),o=c(0),h=c(0),a=c(1);
  683.         0!=r.signum();
  684.         ){
  685.             for(;
  686.             r.isEven();
  687.             )r.rShiftTo(1,r),i?(n.isEven()&&o.isEven()||(n.addTo(this,n),o.subTo(t,o)),n.rShiftTo(1,n)):o.isEven()||o.subTo(t,o),o.rShiftTo(1,o);
  688.             for(;
  689.             s.isEven();
  690.             )s.rShiftTo(1,s),i?(h.isEven()&&a.isEven()||(h.addTo(this,h),a.subTo(t,a)),h.rShiftTo(1,h)):a.isEven()||a.subTo(t,a),a.rShiftTo(1,a);
  691.             r.compareTo(s)>=0?(r.subTo(s,r),i&&n.subTo(h,n),o.subTo(a,o)):(s.subTo(r,s),i&&h.subTo(n,h),a.subTo(o,a))
  692.         }
  693.         return 0!=s.compareTo(e.ONE)?e.ZERO:a.compareTo(t)>=0?a.subtract(t):a.signum()<0?(a.addTo(t,a),a.signum()<0?a.add(t):a):a
  694.     }
  695.     function Qt(t){
  696.         var e,i=this.abs();
  697.         if(1==i.t&&i[0]<=Ae[Ae.length-1]){
  698.             for(e=0;
  699.             e<Ae.length;
  700.             ++e)if(i[0]==Ae[e])return!0;
  701.             return!1
  702.         }
  703.         if(i.isEven())return!1;
  704.         for(e=1;
  705.         e<Ae.length;
  706.         ){
  707.             for(var r=Ae[e],s=e+1;
  708.             s<Ae.length&&Ue>r;
  709.             )r*=Ae[s++];
  710.             for(r=i.modInt(r);
  711.             s>e;
  712.             )if(r%Ae[e++]==0)return!1
  713.         }
  714.         return i.millerRabin(t)
  715.     }
  716.     function Xt(t){
  717.         var r=this.subtract(e.ONE),s=r.getLowestSetBit();
  718.         if(0>=s)return!1;
  719.         var n=r.shiftRight(s);
  720.         t=t+1>>1,t>Ae.length&&(t=Ae.length);
  721.         for(var o=i(),h=0;
  722.         t>h;
  723.         ++h){
  724.             o.fromInt(Ae[Math.floor(Math.random()*Ae.length)]);
  725.             var a=o.modPow(n,this);
  726.             if(0!=a.compareTo(e.ONE)&&0!=a.compareTo(r)){
  727.                 for(var u=1;
  728.                 u++<s&&0!=a.compareTo(r);
  729.                 )if(a=a.modPowInt(2,this),0==a.compareTo(e.ONE))return!1;
  730.                 if(0!=a.compareTo(r))return!1
  731.             }
  732.             
  733.         }
  734.         return!0
  735.     }
  736.     function te(){
  737.         this.i=0,this.j=0,this.S=new Array
  738.     }
  739.     function ee(t){
  740.         var e,i,r;
  741.         for(e=0;
  742.         256>e;
  743.         ++e)this.S[e]=e;
  744.         for(i=0,e=0;
  745.         256>e;
  746.         ++e)i=i+this.S[e]+t[e%t.length]&255,r=this.S[e],this.S[e]=this.S[i],this.S[i]=r;
  747.         this.i=0,this.j=0
  748.     }
  749.     function ie(){
  750.         var t;
  751.         return this.i=this.i+1&255,this.j=this.j+this.S[this.i]&255,t=this.S[this.i],this.S[this.i]=this.S[this.j],this.S[this.j]=t,this.S[t+this.S[this.i]&255]
  752.     }
  753.     function re(){
  754.         return new te
  755.     }
  756.     function se(){
  757.         if(null==Oe){
  758.             for(Oe=re();
  759.             Je>Ne;
  760.             ){
  761.                 var t=Math.floor(65536*Math.random());
  762.                 Ve[Ne++]=255&t
  763.             }
  764.             for(Oe.init(Ve),Ne=0;
  765.             Ne<Ve.length;
  766.             ++Ne)Ve[Ne]=0;
  767.             Ne=0
  768.         }
  769.         return Oe.next()
  770.     }
  771.     function ne(t){
  772.         var e;
  773.         for(e=0;
  774.         e<t.length;
  775.         ++e)t[e]=se()
  776.     }
  777.     function oe(){}function he(t,i){
  778.         return new e(t,i)
  779.     }
  780.     function ae(t,i){
  781.         if(i<t.length+11)return console.error("Message too long for RSA"),null;
  782.         for(var r=new Array,s=t.length-1;
  783.         s>=0&&i>0;
  784.         ){
  785.             var n=t.charCodeAt(s--);
  786.             128>n?r[--i]=n:n>127&&2048>n?(r[--i]=63&n|128,r[--i]=n>>6|192):(r[--i]=63&n|128,r[--i]=n>>6&63|128,r[--i]=n>>12|224)
  787.         }
  788.         r[--i]=0;
  789.         for(var o=new oe,h=new Array;
  790.         i>2;
  791.         ){
  792.             for(h[0]=0;
  793.             0==h[0];
  794.             )o.nextBytes(h);
  795.             r[--i]=h[0]
  796.         }
  797.         return r[--i]=2,r[--i]=0,new e(r)
  798.     }
  799.     function ue(){
  800.         this.n=null,this.e=0,this.d=null,this.p=null,this.q=null,this.dmp1=null,this.dmq1=null,this.coeff=null
  801.     }
  802.     function ce(t,e){
  803.         null!=t&&null!=e&&t.length>0&&e.length>0?(this.n=he(t,16),this.e=parseInt(e,16)):console.error("Invalid RSA public key")
  804.     }
  805.     function fe(t){
  806.         return t.modPowInt(this.e,this.n)
  807.     }
  808.     function pe(t){
  809.         var e=ae(t,this.n.bitLength()+7>>3);
  810.         if(null==e)return null;
  811.         var i=this.doPublic(e);
  812.         if(null==i)return null;
  813.         var r=i.toString(16);
  814.         return 0==(1&r.length)?r:"0"+r
  815.     }
  816.     function le(t,e){
  817.         for(var i=t.toByteArray(),r=0;
  818.         r<i.length&&0==i[r];
  819.         )++r;
  820.         if(i.length-r!=e-1||2!=i[r])return null;
  821.         for(++r;
  822.         0!=i[r];
  823.         )if(++r>=i.length)return null;
  824.         for(var s="";
  825.         ++r<i.length;
  826.         ){
  827.             var n=255&i[r];
  828.             128>n?s+=String.fromCharCode(n):n>191&&224>n?(s+=String.fromCharCode((31&n)<<6|63&i[r+1]),++r):(s+=String.fromCharCode((15&n)<<12|(63&i[r+1])<<6|63&i[r+2]),r+=2)
  829.         }
  830.         return s
  831.     }
  832.     function de(t,e,i){
  833.         null!=t&&null!=e&&t.length>0&&e.length>0?(this.n=he(t,16),this.e=parseInt(e,16),this.d=he(i,16)):console.error("Invalid RSA private key")
  834.     }
  835.     function ge(t,e,i,r,s,n,o,h){
  836.         null!=t&&null!=e&&t.length>0&&e.length>0?(this.n=he(t,16),this.e=parseInt(e,16),this.d=he(i,16),this.p=he(r,16),this.q=he(s,16),this.dmp1=he(n,16),this.dmq1=he(o,16),this.coeff=he(h,16)):console.error("Invalid RSA private key")
  837.     }
  838.     function me(t,i){
  839.         var r=new oe,s=t>>1;
  840.         this.e=parseInt(i,16);
  841.         for(var n=new e(i,16);
  842.         ;
  843.         ){
  844.             for(;
  845.             this.p=new e(t-s,1,r),0!=this.p.subtract(e.ONE).gcd(n).compareTo(e.ONE)||!this.p.isProbablePrime(10);
  846.             );
  847.             for(;
  848.             this.q=new e(s,1,r),0!=this.q.subtract(e.ONE).gcd(n).compareTo(e.ONE)||!this.q.isProbablePrime(10);
  849.             );
  850.             if(this.p.compareTo(this.q)<=0){
  851.                 var o=this.p;
  852.                 this.p=this.q,this.q=o
  853.             }
  854.             var h=this.p.subtract(e.ONE),a=this.q.subtract(e.ONE),u=h.multiply(a);
  855.             if(0==u.gcd(n).compareTo(e.ONE)){
  856.                 this.n=this.p.multiply(this.q),this.d=n.modInverse(u),this.dmp1=this.d.mod(h),this.dmq1=this.d.mod(a),this.coeff=this.q.modInverse(this.p);
  857.                 break
  858.             }
  859.             
  860.         }
  861.         
  862.     }
  863.     function ye(t){
  864.         if(null==this.p||null==this.q)return t.modPow(this.d,this.n);
  865.         for(var e=t.mod(this.p).modPow(this.dmp1,this.p),i=t.mod(this.q).modPow(this.dmq1,this.q);
  866.         e.compareTo(i)<0;
  867.         )e=e.add(this.p);
  868.         return e.subtract(i).multiply(this.coeff).mod(this.p).multiply(this.q).add(i)
  869.     }
  870.     function ve(t){
  871.         var e=he(t,16),i=this.doPrivate(e);
  872.         return null==i?null:le(i,this.n.bitLength()+7>>3)
  873.     }
  874.     function be(t){
  875.         var e,i,r="";
  876.         for(e=0;
  877.         e+3<=t.length;
  878.         e+=3)i=parseInt(t.substring(e,e+3),16),r+=Le.charAt(i>>6)+Le.charAt(63&i);
  879.         for(e+1==t.length?(i=parseInt(t.substring(e,e+1),16),r+=Le.charAt(i<<2)):e+2==t.length&&(i=parseInt(t.substring(e,e+2),16),r+=Le.charAt(i>>2)+Le.charAt((3&i)<<4));
  880.         (3&r.length)>0;
  881.         )r+=qe;
  882.         return r
  883.     }
  884.     function Te(t){
  885.         var e,i,r="",s=0;
  886.         for(e=0;
  887.         e<t.length&&t.charAt(e)!=qe;
  888.         ++e)v=Le.indexOf(t.charAt(e)),v<0||(0==s?(r+=o(v>>2),i=3&v,s=1):1==s?(r+=o(i<<2|v>>4),i=15&v,s=2):2==s?(r+=o(i),r+=o(v>>2),i=3&v,s=3):(r+=o(i<<2|v>>4),r+=o(15&v),s=0));
  889.         return 1==s&&(r+=o(i<<2)),r
  890.     }
  891.     // Copyright (c) 2005  Tom Wu
  892.     // All Rights Reserved.
  893.     // See "LICENSE" for details.
  894.     var Se,Re=0xdeadbeefcafe,Ee=15715070==(16777215&Re);
  895.     Ee&&"Microsoft Internet Explorer"==navigator.appName?(e.prototype.am=s,Se=30):Ee&&"Netscape"!=navigator.appName?(e.prototype.am=r,Se=26):(e.prototype.am=n,Se=28),e.prototype.DB=Se,e.prototype.DM=(1<<Se)-1,e.prototype.DV=1<<Se;
  896.     var De=52;
  897.     e.prototype.FV=Math.pow(2,De),e.prototype.F1=De-Se,e.prototype.F2=2*Se-De;
  898.     var we,xe,Be="0123456789abcdefghijklmnopqrstuvwxyz",Ke=new Array;
  899.     for(we="0".charCodeAt(0),xe=0;
  900.     9>=xe;
  901.     ++xe)Ke[we++]=xe;
  902.     for(we="a".charCodeAt(0),xe=10;
  903.     36>xe;
  904.     ++xe)Ke[we++]=xe;
  905.     for(we="A".charCodeAt(0),xe=10;
  906.     36>xe;
  907.     ++xe)Ke[we++]=xe;
  908.     A.prototype.convert=U,A.prototype.revert=O,A.prototype.reduce=V,A.prototype.mulTo=N,A.prototype.sqrTo=J,P.prototype.convert=M,P.prototype.revert=L,P.prototype.reduce=q,P.prototype.mulTo=H,P.prototype.sqrTo=C,e.prototype.copyTo=a,e.prototype.fromInt=u,e.prototype.fromString=f,e.prototype.clamp=p,e.prototype.dlShiftTo=T,e.prototype.drShiftTo=S,e.prototype.lShiftTo=R,e.prototype.rShiftTo=E,e.prototype.subTo=D,e.prototype.multiplyTo=w,e.prototype.squareTo=x,e.prototype.divRemTo=B,e.prototype.invDigit=I,e.prototype.isEven=j,e.prototype.exp=k,e.prototype.toString=l,e.prototype.negate=d,e.prototype.abs=g,e.prototype.compareTo=m,e.prototype.bitLength=b,e.prototype.mod=K,e.prototype.modPowInt=F,e.ZERO=c(0),e.ONE=c(1),It.prototype.convert=Pt,It.prototype.revert=Pt,It.prototype.mulTo=Mt,It.prototype.sqrTo=Lt,jt.prototype.convert=kt,jt.prototype.revert=Ft,jt.prototype.reduce=_t,jt.prototype.mulTo=Zt,jt.prototype.sqrTo=zt;
  909.     var Ae=[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],Ue=(1<<26)/Ae[Ae.length-1];
  910.     e.prototype.chunkSize=$,e.prototype.toRadix=W,e.prototype.fromRadix=Q,e.prototype.fromNumber=X,e.prototype.bitwiseTo=st,e.prototype.changeBit=St,e.prototype.addTo=wt,e.prototype.dMultiply=Nt,e.prototype.dAddOffset=Jt,e.prototype.multiplyLowerTo=Ct,e.prototype.multiplyUpperTo=Ht,e.prototype.modInt=Yt,e.prototype.millerRabin=Xt,e.prototype.clone=_,e.prototype.intValue=z,e.prototype.byteValue=Z,e.prototype.shortValue=G,e.prototype.signum=Y,e.prototype.toByteArray=tt,e.prototype.equals=et,e.prototype.min=it,e.prototype.max=rt,e.prototype.and=ot,e.prototype.or=at,e.prototype.xor=ct,e.prototype.andNot=pt,e.prototype.not=lt,e.prototype.shiftLeft=dt,e.prototype.shiftRight=gt,e.prototype.getLowestSetBit=yt,e.prototype.bitCount=bt,e.prototype.testBit=Tt,e.prototype.setBit=Rt,e.prototype.clearBit=Et,e.prototype.flipBit=Dt,e.prototype.add=xt,e.prototype.subtract=Bt,e.prototype.multiply=Kt,e.prototype.divide=Ut,e.prototype.remainder=Ot,e.prototype.divideAndRemainder=Vt,e.prototype.modPow=Gt,e.prototype.modInverse=Wt,e.prototype.pow=qt,e.prototype.gcd=$t,e.prototype.isProbablePrime=Qt,e.prototype.square=At,te.prototype.init=ee,te.prototype.next=ie;
  911.     var Oe,Ve,Ne,Je=256;
  912.     if(null==Ve){
  913.         Ve=new Array,Ne=0;
  914.         var Ie;
  915.         if(window.crypto&&window.crypto.getRandomValues){
  916.             var Pe=new Uint32Array(256);
  917.             for(window.crypto.getRandomValues(Pe),Ie=0;
  918.             Ie<Pe.length;
  919.             ++Ie)Ve[Ne++]=255&Pe[Ie]
  920.         }
  921.         var Me=function(t){
  922.             if(this.count=this.count||0,this.count>=256||Ne>=Je)return void(window.removeEventListener?window.removeEventListener("mousemove",Me,!1):window.detachEvent&&window.detachEvent("onmousemove",Me));
  923.             try{
  924.                 var e=t.x+t.y;
  925.                 Ve[Ne++]=255&e,this.count+=1
  926.             }
  927.             catch(i){}
  928.         };
  929.         window.addEventListener?window.addEventListener("mousemove",Me,!1):window.attachEvent&&window.attachEvent("onmousemove",Me)
  930.     }
  931.     oe.prototype.nextBytes=ne,ue.prototype.doPublic=fe,ue.prototype.setPublic=ce,ue.prototype.encrypt=pe,ue.prototype.doPrivate=ye,ue.prototype.setPrivate=de,ue.prototype.setPrivateEx=ge,ue.prototype.generate=me,ue.prototype.decrypt=ve,
  932.     // Copyright (c) 2011  Kevin M Burns Jr.
  933.     // All Rights Reserved.
  934.     // See "LICENSE" for details.
  935.     //
  936.     // Extension to jsbn which adds facilities for asynchronous RSA key generation
  937.     // Primarily created to avoid execution timeout on mobile devices
  938.     //
  939.     // http://www-cs-students.stanford.edu/~tjw/jsbn/
  940.     //
  941.     // ---
  942.     function(){
  943.         var t=function(t,r,s){
  944.             var n=new oe,o=t>>1;
  945.             this.e=parseInt(r,16);
  946.             var h=new e(r,16),a=this,u=function(){
  947.                 var r=function(){
  948.                     if(a.p.compareTo(a.q)<=0){
  949.                         var t=a.p;
  950.                         a.p=a.q,a.q=t
  951.                     }
  952.                     var i=a.p.subtract(e.ONE),r=a.q.subtract(e.ONE),n=i.multiply(r);
  953.                     0==n.gcd(h).compareTo(e.ONE)?(a.n=a.p.multiply(a.q),a.d=h.modInverse(n),a.dmp1=a.d.mod(i),a.dmq1=a.d.mod(r),a.coeff=a.q.modInverse(a.p),setTimeout(function(){
  954.                         s()
  955.                     }
  956.                     ,0)):setTimeout(u,0)
  957.                 }
  958.                 ,c=function(){
  959.                     a.q=i(),a.q.fromNumberAsync(o,1,n,function(){
  960.                         a.q.subtract(e.ONE).gcda(h,function(t){
  961.                             0==t.compareTo(e.ONE)&&a.q.isProbablePrime(10)?setTimeout(r,0):setTimeout(c,0)
  962.                         })
  963.                     })
  964.                 }
  965.                 ,f=function(){
  966.                     a.p=i(),a.p.fromNumberAsync(t-o,1,n,function(){
  967.                         a.p.subtract(e.ONE).gcda(h,function(t){
  968.                             0==t.compareTo(e.ONE)&&a.p.isProbablePrime(10)?setTimeout(c,0):setTimeout(f,0)
  969.                         })
  970.                     })
  971.                 };
  972.                 setTimeout(f,0)
  973.             };
  974.             setTimeout(u,0)
  975.         };
  976.         ue.prototype.generateAsync=t;
  977.         var r=function(t,e){
  978.             var i=this.s<0?this.negate():this.clone(),r=t.s<0?t.negate():t.clone();
  979.             if(i.compareTo(r)<0){
  980.                 var s=i;
  981.                 i=r,r=s
  982.             }
  983.             var n=i.getLowestSetBit(),o=r.getLowestSetBit();
  984.             if(0>o)return void e(i);
  985.             o>n&&(o=n),o>0&&(i.rShiftTo(o,i),r.rShiftTo(o,r));
  986.             var h=function(){
  987.                 (n=i.getLowestSetBit())>0&&i.rShiftTo(n,i),(n=r.getLowestSetBit())>0&&r.rShiftTo(n,r),i.compareTo(r)>=0?(i.subTo(r,i),i.rShiftTo(1,i)):(r.subTo(i,r),r.rShiftTo(1,r)),i.signum()>0?setTimeout(h,0):(o>0&&r.lShiftTo(o,r),setTimeout(function(){
  988.                     e(r)
  989.                 }
  990.                 ,0))
  991.             };
  992.             setTimeout(h,10)
  993.         };
  994.         e.prototype.gcda=r;
  995.         var s=function(t,i,r,s){
  996.             if("number"==typeof i)if(2>t)this.fromInt(1);
  997.             else{
  998.                 this.fromNumber(t,r),this.testBit(t-1)||this.bitwiseTo(e.ONE.shiftLeft(t-1),ht,this),this.isEven()&&this.dAddOffset(1,0);
  999.                 var n=this,o=function(){
  1000.                     n.dAddOffset(2,0),n.bitLength()>t&&n.subTo(e.ONE.shiftLeft(t-1),n),n.isProbablePrime(i)?setTimeout(function(){
  1001.                         s()
  1002.                     }
  1003.                     ,0):setTimeout(o,0)
  1004.                 };
  1005.                 setTimeout(o,0)
  1006.             }
  1007.             else{
  1008.                 var h=new Array,a=7&t;
  1009.                 h.length=(t>>3)+1,i.nextBytes(h),a>0?h[0]&=(1<<a)-1:h[0]=0,this.fromString(h,256)
  1010.             }
  1011.             
  1012.         };
  1013.         e.prototype.fromNumberAsync=s
  1014.     }
  1015.     ();
  1016.     var Le="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",qe="=",Ce=Ce||{};
  1017.     Ce.env=Ce.env||{};
  1018.     var He=Ce,je=Object.prototype,ke="[object Function]",Fe=["toString","valueOf"];
  1019.     Ce.env.parseUA=function(t){
  1020.         var e,i=function(t){
  1021.             var e=0;
  1022.             return parseFloat(t.replace(/\./g,function(){
  1023.                 return 1==e++?"":"."
  1024.             }))
  1025.         }
  1026.         ,r=navigator,s={
  1027.             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:r&&r.cajaVersion,secure:!1,os:null
  1028.         }
  1029.         ,n=t||navigator&&navigator.userAgent,o=window&&window.location,h=o&&o.href;
  1030.         return s.secure=h&&0===h.toLowerCase().indexOf("https"),n&&(/windows|win32/i.test(n)?s.os="windows":/macintosh/i.test(n)?s.os="macintosh":/rhino/i.test(n)&&(s.os="rhino"),/KHTML/.test(n)&&(s.webkit=1),e=n.match(/AppleWebKit\/([^\s]*)/),e&&e[1]&&(s.webkit=i(e[1]),/ Mobile\//.test(n)?(s.mobile="Apple",e=n.match(/OS ([^\s]*)/),e&&e[1]&&(e=i(e[1].replace("_","."))),s.ios=e,s.ipad=s.ipod=s.iphone=0,e=n.match(/iPad|iPod|iPhone/),e&&e[0]&&(s[e[0].toLowerCase()]=s.ios)):(e=n.match(/NokiaN[^\/]*|Android \d\.\d|webOS\/\d\.\d/),e&&(s.mobile=e[0]),/webOS/.test(n)&&(s.mobile="WebOS",e=n.match(/webOS\/([^\s]*);/),e&&e[1]&&(s.webos=i(e[1]))),/ Android/.test(n)&&(s.mobile="Android",e=n.match(/Android ([^\s]*);/),e&&e[1]&&(s.android=i(e[1])))),e=n.match(/Chrome\/([^\s]*)/),e&&e[1]?s.chrome=i(e[1]):(e=n.match(/AdobeAIR\/([^\s]*)/),e&&(s.air=e[0]))),s.webkit||(e=n.match(/Opera[\s\/]([^\s]*)/),e&&e[1]?(s.opera=i(e[1]),e=n.match(/Version\/([^\s]*)/),e&&e[1]&&(s.opera=i(e[1])),e=n.match(/Opera Mini[^;]*/),e&&(s.mobile=e[0])):(e=n.match(/MSIE\s([^;]*)/),e&&e[1]?s.ie=i(e[1]):(e=n.match(/Gecko\/([^\s]*)/),e&&(s.gecko=1,e=n.match(/rv:([^\s\)]*)/),e&&e[1]&&(s.gecko=i(e[1]))))))),s
  1031.     }
  1032.     ,Ce.env.ua=Ce.env.parseUA(),Ce.isFunction=function(t){
  1033.         return"function"==typeof t||je.toString.apply(t)===ke
  1034.     }
  1035.     ,Ce._IEEnumFix=Ce.env.ua.ie?function(t,e){
  1036.         var i,r,s;
  1037.         for(i=0;
  1038.         i<Fe.length;
  1039.         i+=1)r=Fe[i],s=e[r],He.isFunction(s)&&s!=je[r]&&(t[r]=s)
  1040.     }
  1041.     :function(){},Ce.extend=function(t,e,i){
  1042.         if(!e||!t)throw new Error("extend failed, please check that all dependencies are included.");
  1043.         var r,s=function(){};
  1044.         if(s.prototype=e.prototype,t.prototype=new s,t.prototype.constructor=t,t.superclass=e.prototype,e.prototype.constructor==je.constructor&&(e.prototype.constructor=e),i){
  1045.             for(r in i)He.hasOwnProperty(i,r)&&(t.prototype[r]=i[r]);
  1046.             He._IEEnumFix(t.prototype,i)
  1047.         }
  1048.         
  1049.     }
  1050.     ,/*
  1051.      * asn1.js - ASN.1 DER encoder classes
  1052.      *
  1053.      * Copyright (c) 2013 Kenji Urushima (kenji.urushima@gmail.com)
  1054.      *
  1055.      * This software is licensed under the terms of the MIT License.
  1056.      * http://kjur.github.com/jsrsasign/license
  1057.      *
  1058.      * The above copyright and license notice shall be
  1059.      * included in all copies or substantial portions of the Software.
  1060.      */
  1061.     /**
  1062.      * @fileOverview
  1063.      * [url=home.php?mod=space&uid=47252]@name[/url] asn1-1.0.js
  1064.      * @author Kenji Urushima kenji.urushima@gmail.com
  1065.      * [url=home.php?mod=space&uid=59980]@Version[/url] 1.0.2 (2013-May-30)
  1066.      * @since 2.1
  1067.      * [url=home.php?mod=space&uid=154559]@license[/url] <a >MIT License</a>
  1068.      */
  1069.     "undefined"!=typeof KJUR&&KJUR||(KJUR={}),"undefined"!=typeof KJUR.asn1&&KJUR.asn1||(KJUR.asn1={}),KJUR.asn1.ASN1Util=new function(){
  1070.         this.integerToByteHex=function(t){
  1071.             var e=t.toString(16);
  1072.             return e.length%2==1&&(e="0"+e),e
  1073.         }
  1074.         ,this.bigIntToMinTwosComplementsHex=function(t){
  1075.             var i=t.toString(16);
  1076.             if("-"!=i.substr(0,1))i.length%2==1?i="0"+i:i.match(/^[0-7]/)||(i="00"+i);
  1077.             else{
  1078.                 var r=i.substr(1),s=r.length;
  1079.                 s%2==1?s+=1:i.match(/^[0-7]/)||(s+=2);
  1080.                 for(var n="",o=0;
  1081.                 s>o;
  1082.                 o++)n+="f";
  1083.                 var h=new e(n,16),a=h.xor(t).add(e.ONE);
  1084.                 i=a.toString(16).replace(/^-/,"")
  1085.             }
  1086.             return i
  1087.         }
  1088.         ,this.getPEMStringFromHex=function(t,e){
  1089.             var i=CryptoJS.enc.Hex.parse(t),r=CryptoJS.enc.Base64.stringify(i),s=r.replace(/(.{64})/g,"$1\r\n");
  1090.             return s=s.replace(/\r\n$/,""),"-----BEGIN "+e+"-----\r\n"+s+"\r\n-----END "+e+"-----\r\n"
  1091.         }
  1092.         
  1093.     }
  1094.     ,KJUR.asn1.ASN1Object=function(){
  1095.         var t="";
  1096.         this.getLengthHexFromValue=function(){
  1097.             if("undefined"==typeof this.hV||null==this.hV)throw"this.hV is null or undefined.";
  1098.             if(this.hV.length%2==1)throw"value hex must be even length: n="+t.length+",v="+this.hV;
  1099.             var e=this.hV.length/2,i=e.toString(16);
  1100.             if(i.length%2==1&&(i="0"+i),128>e)return i;
  1101.             var r=i.length/2;
  1102.             if(r>15)throw"ASN.1 length too long to represent by 8x: n = "+e.toString(16);
  1103.             var s=128+r;
  1104.             return s.toString(16)+i
  1105.         }
  1106.         ,this.getEncodedHex=function(){
  1107.             return(null==this.hTLV||this.isModified)&&(this.hV=this.getFreshValueHex(),this.hL=this.getLengthHexFromValue(),this.hTLV=this.hT+this.hL+this.hV,this.isModified=!1),this.hTLV
  1108.         }
  1109.         ,this.getValueHex=function(){
  1110.             return this.getEncodedHex(),this.hV
  1111.         }
  1112.         ,this.getFreshValueHex=function(){
  1113.             return""
  1114.         }
  1115.         
  1116.     }
  1117.     ,KJUR.asn1.DERAbstractString=function(t){
  1118.         KJUR.asn1.DERAbstractString.superclass.constructor.call(this);
  1119.         this.getString=function(){
  1120.             return this.s
  1121.         }
  1122.         ,this.setString=function(t){
  1123.             this.hTLV=null,this.isModified=!0,this.s=t,this.hV=stohex(this.s)
  1124.         }
  1125.         ,this.setStringHex=function(t){
  1126.             this.hTLV=null,this.isModified=!0,this.s=null,this.hV=t
  1127.         }
  1128.         ,this.getFreshValueHex=function(){
  1129.             return this.hV
  1130.         }
  1131.         ,"undefined"!=typeof t&&("undefined"!=typeof t.str?this.setString(t.str):"undefined"!=typeof t.hex&&this.setStringHex(t.hex))
  1132.     }
  1133.     ,Ce.extend(KJUR.asn1.DERAbstractString,KJUR.asn1.ASN1Object),KJUR.asn1.DERAbstractTime=function(t){
  1134.         KJUR.asn1.DERAbstractTime.superclass.constructor.call(this);
  1135.         this.localDateToUTC=function(t){
  1136.             utc=t.getTime()+6e4*t.getTimezoneOffset();
  1137.             var e=new Date(utc);
  1138.             return e
  1139.         }
  1140.         ,this.formatDate=function(t,e){
  1141.             var i=this.zeroPadding,r=this.localDateToUTC(t),s=String(r.getFullYear());
  1142.             "utc"==e&&(s=s.substr(2,2));
  1143.             var n=i(String(r.getMonth()+1),2),o=i(String(r.getDate()),2),h=i(String(r.getHours()),2),a=i(String(r.getMinutes()),2),u=i(String(r.getSeconds()),2);
  1144.             return s+n+o+h+a+u+"Z"
  1145.         }
  1146.         ,this.zeroPadding=function(t,e){
  1147.             return t.length>=e?t:new Array(e-t.length+1).join("0")+t
  1148.         }
  1149.         ,this.getString=function(){
  1150.             return this.s
  1151.         }
  1152.         ,this.setString=function(t){
  1153.             this.hTLV=null,this.isModified=!0,this.s=t,this.hV=stohex(this.s)
  1154.         }
  1155.         ,this.setByDateValue=function(t,e,i,r,s,n){
  1156.             var o=new Date(Date.UTC(t,e-1,i,r,s,n,0));
  1157.             this.setByDate(o)
  1158.         }
  1159.         ,this.getFreshValueHex=function(){
  1160.             return this.hV
  1161.         }
  1162.         
  1163.     }
  1164.     ,Ce.extend(KJUR.asn1.DERAbstractTime,KJUR.asn1.ASN1Object),KJUR.asn1.DERAbstractStructured=function(t){
  1165.         KJUR.asn1.DERAbstractString.superclass.constructor.call(this);
  1166.         this.setByASN1ObjectArray=function(t){
  1167.             this.hTLV=null,this.isModified=!0,this.asn1Array=t
  1168.         }
  1169.         ,this.appendASN1Object=function(t){
  1170.             this.hTLV=null,this.isModified=!0,this.asn1Array.push(t)
  1171.         }
  1172.         ,this.asn1Array=new Array,"undefined"!=typeof t&&"undefined"!=typeof t.array&&(this.asn1Array=t.array)
  1173.     }
  1174.     ,Ce.extend(KJUR.asn1.DERAbstractStructured,KJUR.asn1.ASN1Object),KJUR.asn1.DERBoolean=function(){
  1175.         KJUR.asn1.DERBoolean.superclass.constructor.call(this),this.hT="01",this.hTLV="0101ff"
  1176.     }
  1177.     ,Ce.extend(KJUR.asn1.DERBoolean,KJUR.asn1.ASN1Object),KJUR.asn1.DERInteger=function(t){
  1178.         KJUR.asn1.DERInteger.superclass.constructor.call(this),this.hT="02",this.setByBigInteger=function(t){
  1179.             this.hTLV=null,this.isModified=!0,this.hV=KJUR.asn1.ASN1Util.bigIntToMinTwosComplementsHex(t)
  1180.         }
  1181.         ,this.setByInteger=function(t){
  1182.             var i=new e(String(t),10);
  1183.             this.setByBigInteger(i)
  1184.         }
  1185.         ,this.setValueHex=function(t){
  1186.             this.hV=t
  1187.         }
  1188.         ,this.getFreshValueHex=function(){
  1189.             return this.hV
  1190.         }
  1191.         ,"undefined"!=typeof t&&("undefined"!=typeof t.bigint?this.setByBigInteger(t.bigint):"undefined"!=typeof t["int"]?this.setByInteger(t["int"]):"undefined"!=typeof t.hex&&this.setValueHex(t.hex))
  1192.     }
  1193.     ,Ce.extend(KJUR.asn1.DERInteger,KJUR.asn1.ASN1Object),KJUR.asn1.DERBitString=function(t){
  1194.         KJUR.asn1.DERBitString.superclass.constructor.call(this),this.hT="03",this.setHexValueIncludingUnusedBits=function(t){
  1195.             this.hTLV=null,this.isModified=!0,this.hV=t
  1196.         }
  1197.         ,this.setUnusedBitsAndHexValue=function(t,e){
  1198.             if(0>t||t>7)throw"unused bits shall be from 0 to 7: u = "+t;
  1199.             var i="0"+t;
  1200.             this.hTLV=null,this.isModified=!0,this.hV=i+e
  1201.         }
  1202.         ,this.setByBinaryString=function(t){
  1203.             t=t.replace(/0+$/,"");
  1204.             var e=8-t.length%8;
  1205.             8==e&&(e=0);
  1206.             for(var i=0;
  1207.             e>=i;
  1208.             i++)t+="0";
  1209.             for(var r="",i=0;
  1210.             i<t.length-1;
  1211.             i+=8){
  1212.                 var s=t.substr(i,8),n=parseInt(s,2).toString(16);
  1213.                 1==n.length&&(n="0"+n),r+=n
  1214.             }
  1215.             this.hTLV=null,this.isModified=!0,this.hV="0"+e+r
  1216.         }
  1217.         ,this.setByBooleanArray=function(t){
  1218.             for(var e="",i=0;
  1219.             i<t.length;
  1220.             i++)e+=1==t[i]?"1":"0";
  1221.             this.setByBinaryString(e)
  1222.         }
  1223.         ,this.newFalseArray=function(t){
  1224.             for(var e=new Array(t),i=0;
  1225.             t>i;
  1226.             i++)e[i]=!1;
  1227.             return e
  1228.         }
  1229.         ,this.getFreshValueHex=function(){
  1230.             return this.hV
  1231.         }
  1232.         ,"undefined"!=typeof t&&("undefined"!=typeof t.hex?this.setHexValueIncludingUnusedBits(t.hex):"undefined"!=typeof t.bin?this.setByBinaryString(t.bin):"undefined"!=typeof t.array&&this.setByBooleanArray(t.array))
  1233.     }
  1234.     ,Ce.extend(KJUR.asn1.DERBitString,KJUR.asn1.ASN1Object),KJUR.asn1.DEROctetString=function(t){
  1235.         KJUR.asn1.DEROctetString.superclass.constructor.call(this,t),this.hT="04"
  1236.     }
  1237.     ,Ce.extend(KJUR.asn1.DEROctetString,KJUR.asn1.DERAbstractString),KJUR.asn1.DERNull=function(){
  1238.         KJUR.asn1.DERNull.superclass.constructor.call(this),this.hT="05",this.hTLV="0500"
  1239.     }
  1240.     ,Ce.extend(KJUR.asn1.DERNull,KJUR.asn1.ASN1Object),KJUR.asn1.DERObjectIdentifier=function(t){
  1241.         var i=function(t){
  1242.             var e=t.toString(16);
  1243.             return 1==e.length&&(e="0"+e),e
  1244.         }
  1245.         ,r=function(t){
  1246.             var r="",s=new e(t,10),n=s.toString(2),o=7-n.length%7;
  1247.             7==o&&(o=0);
  1248.             for(var h="",a=0;
  1249.             o>a;
  1250.             a++)h+="0";
  1251.             n=h+n;
  1252.             for(var a=0;
  1253.             a<n.length-1;
  1254.             a+=7){
  1255.                 var u=n.substr(a,7);
  1256.                 a!=n.length-7&&(u="1"+u),r+=i(parseInt(u,2))
  1257.             }
  1258.             return r
  1259.         };
  1260.         KJUR.asn1.DERObjectIdentifier.superclass.constructor.call(this),this.hT="06",this.setValueHex=function(t){
  1261.             this.hTLV=null,this.isModified=!0,this.s=null,this.hV=t
  1262.         }
  1263.         ,this.setValueOidString=function(t){
  1264.             if(!t.match(/^[0-9.]+$/))throw"malformed oid string: "+t;
  1265.             var e="",s=t.split("."),n=40*parseInt(s[0])+parseInt(s[1]);
  1266.             e+=i(n),s.splice(0,2);
  1267.             for(var o=0;
  1268.             o<s.length;
  1269.             o++)e+=r(s[o]);
  1270.             this.hTLV=null,this.isModified=!0,this.s=null,this.hV=e
  1271.         }
  1272.         ,this.setValueName=function(t){
  1273.             if("undefined"==typeof KJUR.asn1.x509.OID.name2oidList[t])throw"DERObjectIdentifier oidName undefined: "+t;
  1274.             var e=KJUR.asn1.x509.OID.name2oidList[t];
  1275.             this.setValueOidString(e)
  1276.         }
  1277.         ,this.getFreshValueHex=function(){
  1278.             return this.hV
  1279.         }
  1280.         ,"undefined"!=typeof t&&("undefined"!=typeof t.oid?this.setValueOidString(t.oid):"undefined"!=typeof t.hex?this.setValueHex(t.hex):"undefined"!=typeof t.name&&this.setValueName(t.name))
  1281.     }
  1282.     ,Ce.extend(KJUR.asn1.DERObjectIdentifier,KJUR.asn1.ASN1Object),KJUR.asn1.DERUTF8String=function(t){
  1283.         KJUR.asn1.DERUTF8String.superclass.constructor.call(this,t),this.hT="0c"
  1284.     }
  1285.     ,Ce.extend(KJUR.asn1.DERUTF8String,KJUR.asn1.DERAbstractString),KJUR.asn1.DERNumericString=function(t){
  1286.         KJUR.asn1.DERNumericString.superclass.constructor.call(this,t),this.hT="12"
  1287.     }
  1288.     ,Ce.extend(KJUR.asn1.DERNumericString,KJUR.asn1.DERAbstractString),KJUR.asn1.DERPrintableString=function(t){
  1289.         KJUR.asn1.DERPrintableString.superclass.constructor.call(this,t),this.hT="13"
  1290.     }
  1291.     ,Ce.extend(KJUR.asn1.DERPrintableString,KJUR.asn1.DERAbstractString),KJUR.asn1.DERTeletexString=function(t){
  1292.         KJUR.asn1.DERTeletexString.superclass.constructor.call(this,t),this.hT="14"
  1293.     }
  1294.     ,Ce.extend(KJUR.asn1.DERTeletexString,KJUR.asn1.DERAbstractString),KJUR.asn1.DERIA5String=function(t){
  1295.         KJUR.asn1.DERIA5String.superclass.constructor.call(this,t),this.hT="16"
  1296.     }
  1297.     ,Ce.extend(KJUR.asn1.DERIA5String,KJUR.asn1.DERAbstractString),KJUR.asn1.DERUTCTime=function(t){
  1298.         KJUR.asn1.DERUTCTime.superclass.constructor.call(this,t),this.hT="17",this.setByDate=function(t){
  1299.             this.hTLV=null,this.isModified=!0,this.date=t,this.s=this.formatDate(this.date,"utc"),this.hV=stohex(this.s)
  1300.         }
  1301.         ,"undefined"!=typeof t&&("undefined"!=typeof t.str?this.setString(t.str):"undefined"!=typeof t.hex?this.setStringHex(t.hex):"undefined"!=typeof t.date&&this.setByDate(t.date))
  1302.     }
  1303.     ,Ce.extend(KJUR.asn1.DERUTCTime,KJUR.asn1.DERAbstractTime),KJUR.asn1.DERGeneralizedTime=function(t){
  1304.         KJUR.asn1.DERGeneralizedTime.superclass.constructor.call(this,t),this.hT="18",this.setByDate=function(t){
  1305.             this.hTLV=null,this.isModified=!0,this.date=t,this.s=this.formatDate(this.date,"gen"),this.hV=stohex(this.s)
  1306.         }
  1307.         ,"undefined"!=typeof t&&("undefined"!=typeof t.str?this.setString(t.str):"undefined"!=typeof t.hex?this.setStringHex(t.hex):"undefined"!=typeof t.date&&this.setByDate(t.date))
  1308.     }
  1309.     ,Ce.extend(KJUR.asn1.DERGeneralizedTime,KJUR.asn1.DERAbstractTime),KJUR.asn1.DERSequence=function(t){
  1310.         KJUR.asn1.DERSequence.superclass.constructor.call(this,t),this.hT="30",this.getFreshValueHex=function(){
  1311.             for(var t="",e=0;
  1312.             e<this.asn1Array.length;
  1313.             e++){
  1314.                 var i=this.asn1Array[e];
  1315.                 t+=i.getEncodedHex()
  1316.             }
  1317.             return this.hV=t,this.hV
  1318.         }
  1319.         
  1320.     }
  1321.     ,Ce.extend(KJUR.asn1.DERSequence,KJUR.asn1.DERAbstractStructured),KJUR.asn1.DERSet=function(t){
  1322.         KJUR.asn1.DERSet.superclass.constructor.call(this,t),this.hT="31",this.getFreshValueHex=function(){
  1323.             for(var t=new Array,e=0;
  1324.             e<this.asn1Array.length;
  1325.             e++){
  1326.                 var i=this.asn1Array[e];
  1327.                 t.push(i.getEncodedHex())
  1328.             }
  1329.             return t.sort(),this.hV=t.join(""),this.hV
  1330.         }
  1331.         
  1332.     }
  1333.     ,Ce.extend(KJUR.asn1.DERSet,KJUR.asn1.DERAbstractStructured),KJUR.asn1.DERTaggedObject=function(t){
  1334.         KJUR.asn1.DERTaggedObject.superclass.constructor.call(this),this.hT="a0",this.hV="",this.isExplicit=!0,this.asn1Object=null,this.setASN1Object=function(t,e,i){
  1335.             this.hT=e,this.isExplicit=t,this.asn1Object=i,this.isExplicit?(this.hV=this.asn1Object.getEncodedHex(),this.hTLV=null,this.isModified=!0):(this.hV=null,this.hTLV=i.getEncodedHex(),this.hTLV=this.hTLV.replace(/^../,e),this.isModified=!1)
  1336.         }
  1337.         ,this.getFreshValueHex=function(){
  1338.             return this.hV
  1339.         }
  1340.         ,"undefined"!=typeof t&&("undefined"!=typeof t.tag&&(this.hT=t.tag),"undefined"!=typeof t.explicit&&(this.isExplicit=t.explicit),"undefined"!=typeof t.obj&&(this.asn1Object=t.obj,this.setASN1Object(this.isExplicit,this.hT,this.asn1Object)))
  1341.     }
  1342.     ,Ce.extend(KJUR.asn1.DERTaggedObject,KJUR.asn1.ASN1Object),
  1343.     // Copyright (c) 2008-2013 Lapo Luchini <lapo@lapo.it>
  1344.     // copyright notice and this permission notice appear in all copies.
  1345.     //
  1346.     // THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
  1347.     // WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
  1348.     // MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
  1349.     // ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  1350.     // WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
  1351.     // ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  1352.     // OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  1353.     function(t){
  1354.         "use strict";
  1355.         var e,i={};
  1356.         i.decode=function(i){
  1357.             var r;
  1358.             if(e===t){
  1359.                 var s="0123456789ABCDEF",n=" \f\n\r        聽\u2028\u2029";
  1360.                 for(e=[],r=0;
  1361.                 16>r;
  1362.                 ++r)e[s.charAt(r)]=r;
  1363.                 for(s=s.toLowerCase(),r=10;
  1364.                 16>r;
  1365.                 ++r)e[s.charAt(r)]=r;
  1366.                 for(r=0;
  1367.                 r<n.length;
  1368.                 ++r)e[n.charAt(r)]=-1
  1369.             }
  1370.             var o=[],h=0,a=0;
  1371.             for(r=0;
  1372.             r<i.length;
  1373.             ++r){
  1374.                 var u=i.charAt(r);
  1375.                 if("="==u)break;
  1376.                 if(u=e[u],-1!=u){
  1377.                     if(u===t)throw"Illegal character at offset "+r;
  1378.                     h|=u,++a>=2?(o[o.length]=h,h=0,a=0):h<<=4
  1379.                 }
  1380.                
  1381.             }
  1382.             if(a)throw"Hex encoding incomplete: 4 bits missing";
  1383.             return o
  1384.         }
  1385.         ,window.Hex=i
  1386.     }
  1387.     (),
  1388.     // Copyright (c) 2008-2013 Lapo Luchini <lapo@lapo.it>
  1389.     // copyright notice and this permission notice appear in all copies.
  1390.     //
  1391.     // THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
  1392.     // WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
  1393.     // MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
  1394.     // ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  1395.     // WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
  1396.     // ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  1397.     // OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  1398.     function(t){
  1399.         "use strict";
  1400.         var e,i={};
  1401.         i.decode=function(i){
  1402.             var r;
  1403.             if(e===t){
  1404.                 var s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n="= \f\n\r        聽\u2028\u2029";
  1405.                 for(e=[],r=0;
  1406.                 64>r;
  1407.                 ++r)e[s.charAt(r)]=r;
  1408.                 for(r=0;
  1409.                 r<n.length;
  1410.                 ++r)e[n.charAt(r)]=-1
  1411.             }
  1412.             var o=[],h=0,a=0;
  1413.             for(r=0;
  1414.             r<i.length;
  1415.             ++r){
  1416.                 var u=i.charAt(r);
  1417.                 if("="==u)break;
  1418.                 if(u=e[u],-1!=u){
  1419.                     if(u===t)throw"Illegal character at offset "+r;
  1420.                     h|=u,++a>=4?(o[o.length]=h>>16,o[o.length]=h>>8&255,o[o.length]=255&h,h=0,a=0):h<<=6
  1421.                 }
  1422.                
  1423.             }
  1424.             switch(a){
  1425.                 case 1:throw"Base64 encoding incomplete: at least 2 bits missing";
  1426.                 case 2:o[o.length]=h>>10;
  1427.                 break;
  1428.                 case 3:o[o.length]=h>>16,o[o.length]=h>>8&255
  1429.             }
  1430.             return o
  1431.         }
  1432.         ,i.re=/-----BEGIN [^-]+-----([A-Za-z0-9+\/=\s]+)-----END [^-]+-----|begin-base64[^\n]+\n([A-Za-z0-9+\/=\s]+)====/,i.unarmor=function(t){
  1433.             var e=i.re.exec(t);
  1434.             if(e)if(e[1])t=e[1];
  1435.             else{
  1436.                 if(!e[2])throw"RegExp out of sync";
  1437.                 t=e[2]
  1438.             }
  1439.             return i.decode(t)
  1440.         }
  1441.         ,window.Base64=i
  1442.     }
  1443.     (),

  1444.     // Copyright (c) 2008-2013 Lapo Luchini <lapo@lapo.it>
  1445.     // copyright notice and this permission notice appear in all copies.
  1446.     //
  1447.     // THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
  1448.     // WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
  1449.     // MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
  1450.     // ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  1451.     // WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
  1452.     // ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  1453.     // OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  1454.     function(t){
  1455.         "use strict";
  1456.         function e(t,i){
  1457.             t instanceof e?(this.enc=t.enc,this.pos=t.pos):(this.enc=t,this.pos=i)
  1458.         }
  1459.         function i(t,e,i,r,s){
  1460.             this.stream=t,this.header=e,this.length=i,this.tag=r,this.sub=s
  1461.         }
  1462.         var r=100,s="鈥?",n={
  1463.             tag:function(t,e){
  1464.                 var i=document.createElement(t);
  1465.                 return i.className=e,i
  1466.             }
  1467.             ,text:function(t){
  1468.                 return document.createTextNode(t)
  1469.             }
  1470.             
  1471.         };
  1472.         e.prototype.get=function(e){
  1473.             if(e===t&&(e=this.pos++),e>=this.enc.length)throw"Requesting byte offset "+e+" on a stream of length "+this.enc.length;
  1474.             return this.enc[e]
  1475.         }
  1476.         ,e.prototype.hexDigits="0123456789ABCDEF",e.prototype.hexByte=function(t){
  1477.             return this.hexDigits.charAt(t>>4&15)+this.hexDigits.charAt(15&t)
  1478.         }
  1479.         ,e.prototype.hexDump=function(t,e,i){
  1480.             for(var r="",s=t;
  1481.             e>s;
  1482.             ++s)if(r+=this.hexByte(this.get(s)),i!==!0)switch(15&s){
  1483.                 case 7:r+="  ";
  1484.                 break;
  1485.                 case 15:r+="\n";
  1486.                 break;
  1487.                 default:r+=" "
  1488.             }
  1489.             return r
  1490.         }
  1491.         ,e.prototype.parseStringISO=function(t,e){
  1492.             for(var i="",r=t;
  1493.             e>r;
  1494.             ++r)i+=String.fromCharCode(this.get(r));
  1495.             return i
  1496.         }
  1497.         ,e.prototype.parseStringUTF=function(t,e){
  1498.             for(var i="",r=t;
  1499.             e>r;
  1500.             ){
  1501.                 var s=this.get(r++);
  1502.                 i+=128>s?String.fromCharCode(s):s>191&&224>s?String.fromCharCode((31&s)<<6|63&this.get(r++)):String.fromCharCode((15&s)<<12|(63&this.get(r++))<<6|63&this.get(r++))
  1503.             }
  1504.             return i
  1505.         }
  1506.         ,e.prototype.parseStringBMP=function(t,e){
  1507.             for(var i="",r=t;
  1508.             e>r;
  1509.             r+=2){
  1510.                 var s=this.get(r),n=this.get(r+1);
  1511.                 i+=String.fromCharCode((s<<8)+n)
  1512.             }
  1513.             return i
  1514.         }
  1515.         ,e.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)?)?$/,e.prototype.parseTime=function(t,e){
  1516.             var i=this.parseStringISO(t,e),r=this.reTime.exec(i);
  1517.             return r?(i=r[1]+"-"+r[2]+"-"+r[3]+" "+r[4],r[5]&&(i+=":"+r[5],r[6]&&(i+=":"+r[6],r[7]&&(i+="."+r[7]))),r[8]&&(i+=" UTC","Z"!=r[8]&&(i+=r[8],r[9]&&(i+=":"+r[9]))),i):"Unrecognized time: "+i
  1518.         }
  1519.         ,e.prototype.parseInteger=function(t,e){
  1520.             var i=e-t;
  1521.             if(i>4){
  1522.                 i<<=3;
  1523.                 var r=this.get(t);
  1524.                 if(0===r)i-=8;
  1525.                 else for(;
  1526.                 128>r;
  1527.                 )r<<=1,--i;
  1528.                 return"("+i+" bit)"
  1529.             }
  1530.             for(var s=0,n=t;
  1531.             e>n;
  1532.             ++n)s=s<<8|this.get(n);
  1533.             return s
  1534.         }
  1535.         ,e.prototype.parseBitString=function(t,e){
  1536.             var i=this.get(t),r=(e-t-1<<3)-i,s="("+r+" bit)";
  1537.             if(20>=r){
  1538.                 var n=i;
  1539.                 s+=" ";
  1540.                 for(var o=e-1;
  1541.                 o>t;
  1542.                 --o){
  1543.                     for(var h=this.get(o),a=n;
  1544.                     8>a;
  1545.                     ++a)s+=h>>a&1?"1":"0";
  1546.                     n=0
  1547.                 }
  1548.                
  1549.             }
  1550.             return s
  1551.         }
  1552.         ,e.prototype.parseOctetString=function(t,e){
  1553.             var i=e-t,n="("+i+" byte) ";
  1554.             i>r&&(e=t+r);
  1555.             for(var o=t;
  1556.             e>o;
  1557.             ++o)n+=this.hexByte(this.get(o));
  1558.             return i>r&&(n+=s),n
  1559.         }
  1560.         ,e.prototype.parseOID=function(t,e){
  1561.             for(var i="",r=0,s=0,n=t;
  1562.             e>n;
  1563.             ++n){
  1564.                 var o=this.get(n);
  1565.                 if(r=r<<7|127&o,s+=7,!(128&o)){
  1566.                     if(""===i){
  1567.                         var h=80>r?40>r?0:1:2;
  1568.                         i=h+"."+(r-40*h)
  1569.                     }
  1570.                     else i+="."+(s>=31?"bigint":r);
  1571.                     r=s=0
  1572.                 }
  1573.                
  1574.             }
  1575.             return i
  1576.         }
  1577.         ,i.prototype.typeName=function(){
  1578.             if(this.tag===t)return"unknown";
  1579.             var e=this.tag>>6,i=(this.tag>>5&1,31&this.tag);
  1580.             switch(e){
  1581.                 case 0:switch(i){
  1582.                     case 0:return"EOC";
  1583.                     case 1:return"BOOLEAN";
  1584.                     case 2:return"INTEGER";
  1585.                     case 3:return"BIT_STRING";
  1586.                     case 4:return"OCTET_STRING";
  1587.                     case 5:return"NULL";
  1588.                     case 6:return"OBJECT_IDENTIFIER";
  1589.                     case 7:return"ObjectDescriptor";
  1590.                     case 8:return"EXTERNAL";
  1591.                     case 9:return"REAL";
  1592.                     case 10:return"ENUMERATED";
  1593.                     case 11:return"EMBEDDED_PDV";
  1594.                     case 12:return"UTF8String";
  1595.                     case 16:return"SEQUENCE";
  1596.                     case 17:return"SET";
  1597.                     case 18:return"NumericString";
  1598.                     case 19:return"PrintableString";
  1599.                     case 20:return"TeletexString";
  1600.                     case 21:return"VideotexString";
  1601.                     case 22:return"IA5String";
  1602.                     case 23:return"UTCTime";
  1603.                     case 24:return"GeneralizedTime";
  1604.                     case 25:return"GraphicString";
  1605.                     case 26:return"VisibleString";
  1606.                     case 27:return"GeneralString";
  1607.                     case 28:return"UniversalString";
  1608.                     case 30:return"BMPString";
  1609.                     default:return"Universal_"+i.toString(16)
  1610.                 }
  1611.                 case 1:return"Application_"+i.toString(16);
  1612.                 case 2:return"["+i+"]";
  1613.                 case 3:return"Private_"+i.toString(16)
  1614.             }
  1615.             
  1616.         }
  1617.         ,i.prototype.reSeemsASCII=/^[ -~]+$/,i.prototype.content=function(){
  1618.             if(this.tag===t)return null;
  1619.             var e=this.tag>>6,i=31&this.tag,n=this.posContent(),o=Math.abs(this.length);
  1620.             if(0!==e){
  1621.                 if(null!==this.sub)return"("+this.sub.length+" elem)";
  1622.                 var h=this.stream.parseStringISO(n,n+Math.min(o,r));
  1623.                 return this.reSeemsASCII.test(h)?h.substring(0,2*r)+(h.length>2*r?s:""):this.stream.parseOctetString(n,n+o)
  1624.             }
  1625.             switch(i){
  1626.                 case 1:return 0===this.stream.get(n)?"false":"true";
  1627.                 case 2:return this.stream.parseInteger(n,n+o);
  1628.                 case 3:return this.sub?"("+this.sub.length+" elem)":this.stream.parseBitString(n,n+o);
  1629.                 case 4:return this.sub?"("+this.sub.length+" elem)":this.stream.parseOctetString(n,n+o);
  1630.                 case 6:return this.stream.parseOID(n,n+o);
  1631.                 case 16:case 17:return"("+this.sub.length+" elem)";
  1632.                 case 12:return this.stream.parseStringUTF(n,n+o);
  1633.                 case 18:case 19:case 20:case 21:case 22:case 26:return this.stream.parseStringISO(n,n+o);
  1634.                 case 30:return this.stream.parseStringBMP(n,n+o);
  1635.                 case 23:case 24:return this.stream.parseTime(n,n+o)
  1636.             }
  1637.             return null
  1638.         }
  1639.         ,i.prototype.toString=function(){
  1640.             return this.typeName()+"@"+this.stream.pos+"[header:"+this.header+",length:"+this.length+",sub:"+(null===this.sub?"null":this.sub.length)+"]"
  1641.         }
  1642.         ,i.prototype.print=function(e){
  1643.             if(e===t&&(e=""),document.writeln(e+this),null!==this.sub){
  1644.                 e+="  ";
  1645.                 for(var i=0,r=this.sub.length;
  1646.                 r>i;
  1647.                 ++i)this.sub[i].print(e)
  1648.             }
  1649.             
  1650.         }
  1651.         ,i.prototype.toPrettyString=function(e){
  1652.             e===t&&(e="");
  1653.             var i=e+this.typeName()+" @"+this.stream.pos;
  1654.             if(this.length>=0&&(i+="+"),i+=this.length,32&this.tag?i+=" (constructed)":3!=this.tag&&4!=this.tag||null===this.sub||(i+=" (encapsulates)"),i+="\n",null!==this.sub){
  1655.                 e+="  ";
  1656.                 for(var r=0,s=this.sub.length;
  1657.                 s>r;
  1658.                 ++r)i+=this.sub[r].toPrettyString(e)
  1659.             }
  1660.             return i
  1661.         }
  1662.         ,i.prototype.toDOM=function(){
  1663.             var t=n.tag("div","node");
  1664.             t.asn1=this;
  1665.             var e=n.tag("div","head"),i=this.typeName().replace(/_/g," ");
  1666.             e.innerHTML=i;
  1667.             var r=this.content();
  1668.             if(null!==r){
  1669.                 r=String(r).replace(/</g,"<");
  1670.                 var s=n.tag("span","preview");
  1671.                 s.appendChild(n.text(r)),e.appendChild(s)
  1672.             }
  1673.             t.appendChild(e),this.node=t,this.head=e;
  1674.             var o=n.tag("div","value");
  1675.             if(i="Offset: "+this.stream.pos+"<br/>",i+="Length: "+this.header+"+",i+=this.length>=0?this.length:-this.length+" (undefined)",32&this.tag?i+="<br/>(constructed)":3!=this.tag&&4!=this.tag||null===this.sub||(i+="<br/>(encapsulates)"),null!==r&&(i+="<br/>Value:<br/><b>"+r+"</b>","object"==typeof oids&&6==this.tag)){
  1676.                 var h=oids[r];
  1677.                 h&&(h.d&&(i+="<br/>"+h.d),h.c&&(i+="<br/>"+h.c),h.w&&(i+="<br/>(warning!)"))
  1678.             }
  1679.             o.innerHTML=i,t.appendChild(o);
  1680.             var a=n.tag("div","sub");
  1681.             if(null!==this.sub)for(var u=0,c=this.sub.length;
  1682.             c>u;
  1683.             ++u)a.appendChild(this.sub[u].toDOM());
  1684.             return t.appendChild(a),e.onclick=function(){
  1685.                 t.className="node collapsed"==t.className?"node":"node collapsed"
  1686.             }
  1687.             ,t
  1688.         }
  1689.         ,i.prototype.posStart=function(){
  1690.             return this.stream.pos
  1691.         }
  1692.         ,i.prototype.posContent=function(){
  1693.             return this.stream.pos+this.header
  1694.         }
  1695.         ,i.prototype.posEnd=function(){
  1696.             return this.stream.pos+this.header+Math.abs(this.length)
  1697.         }
  1698.         ,i.prototype.fakeHover=function(t){
  1699.             this.node.className+=" hover",t&&(this.head.className+=" hover")
  1700.         }
  1701.         ,i.prototype.fakeOut=function(t){
  1702.             var e=/ ?hover/;
  1703.             this.node.className=this.node.className.replace(e,""),t&&(this.head.className=this.head.className.replace(e,""))
  1704.         }
  1705.         ,i.prototype.toHexDOM_sub=function(t,e,i,r,s){
  1706.             if(!(r>=s)){
  1707.                 var o=n.tag("span",e);
  1708.                 o.appendChild(n.text(i.hexDump(r,s))),t.appendChild(o)
  1709.             }
  1710.             
  1711.         }
  1712.         ,i.prototype.toHexDOM=function(e){
  1713.             var i=n.tag("span","hex");
  1714.             if(e===t&&(e=i),this.head.hexNode=i,this.head.onmouseover=function(){
  1715.                 this.hexNode.className="hexCurrent"
  1716.             }
  1717.             ,this.head.onmouseout=function(){
  1718.                 this.hexNode.className="hex"
  1719.             }
  1720.             ,i.asn1=this,i.onmouseover=function(){
  1721.                 var t=!e.selected;
  1722.                 t&&(e.selected=this.asn1,this.className="hexCurrent"),this.asn1.fakeHover(t)
  1723.             }
  1724.             ,i.onmouseout=function(){
  1725.                 var t=e.selected==this.asn1;
  1726.                 this.asn1.fakeOut(t),t&&(e.selected=null,this.className="hex")
  1727.             }
  1728.             ,this.toHexDOM_sub(i,"tag",this.stream,this.posStart(),this.posStart()+1),this.toHexDOM_sub(i,this.length>=0?"dlen":"ulen",this.stream,this.posStart()+1,this.posContent()),null===this.sub)i.appendChild(n.text(this.stream.hexDump(this.posContent(),this.posEnd())));
  1729.             else if(this.sub.length>0){
  1730.                 var r=this.sub[0],s=this.sub[this.sub.length-1];
  1731.                 this.toHexDOM_sub(i,"intro",this.stream,this.posContent(),r.posStart());
  1732.                 for(var o=0,h=this.sub.length;
  1733.                 h>o;
  1734.                 ++o)i.appendChild(this.sub[o].toHexDOM(e));
  1735.                 this.toHexDOM_sub(i,"outro",this.stream,s.posEnd(),this.posEnd())
  1736.             }
  1737.             return i
  1738.         }
  1739.         ,i.prototype.toHexString=function(t){
  1740.             return this.stream.hexDump(this.posStart(),this.posEnd(),!0)
  1741.         }
  1742.         ,i.decodeLength=function(t){
  1743.             var e=t.get(),i=127&e;
  1744.             if(i==e)return i;
  1745.             if(i>3)throw"Length over 24 bits not supported at position "+(t.pos-1);
  1746.             if(0===i)return-1;
  1747.             e=0;
  1748.             for(var r=0;
  1749.             i>r;
  1750.             ++r)e=e<<8|t.get();
  1751.             return e
  1752.         }
  1753.         ,i.hasContent=function(t,r,s){
  1754.             if(32&t)return!0;
  1755.             if(3>t||t>4)return!1;
  1756.             var n=new e(s);
  1757.             3==t&&n.get();
  1758.             var o=n.get();
  1759.             if(o>>6&1)return!1;
  1760.             try{
  1761.                 var h=i.decodeLength(n);
  1762.                 return n.pos-s.pos+h==r
  1763.             }
  1764.             catch(a){
  1765.                 return!1
  1766.             }
  1767.             
  1768.         }
  1769.         ,i.decode=function(t){
  1770.             t instanceof e||(t=new e(t,0));
  1771.             var r=new e(t),s=t.get(),n=i.decodeLength(t),o=t.pos-r.pos,h=null;
  1772.             if(i.hasContent(s,n,t)){
  1773.                 var a=t.pos;
  1774.                 if(3==s&&t.get(),h=[],n>=0){
  1775.                     for(var u=a+n;
  1776.                     t.pos<u;
  1777.                     )h[h.length]=i.decode(t);
  1778.                     if(t.pos!=u)throw"Content size is not correct for container starting at offset "+a
  1779.                 }
  1780.                 else try{
  1781.                     for(;
  1782.                     ;
  1783.                     ){
  1784.                         var c=i.decode(t);
  1785.                         if(0===c.tag)break;
  1786.                         h[h.length]=c
  1787.                     }
  1788.                     n=a-t.pos
  1789.                 }
  1790.                 catch(f){
  1791.                     throw"Exception while decoding undefined length content: "+f
  1792.                 }
  1793.                
  1794.             }
  1795.             else t.pos+=n;
  1796.             return new i(r,o,n,s,h)
  1797.         }
  1798.         ,i.test=function(){
  1799.             for(var t=[{
  1800.                 value:[39],expected:39
  1801.             }
  1802.             ,{
  1803.                 value:[129,201],expected:201
  1804.             }
  1805.             ,{
  1806.                 value:[131,254,220,186],expected:16702650
  1807.             }
  1808.             ],r=0,s=t.length;
  1809.             s>r;
  1810.             ++r){
  1811.                 var n=new e(t[r].value,0),o=i.decodeLength(n);
  1812.                 o!=t[r].expected&&document.write("In test["+r+"] expected "+t[r].expected+" got "+o+"\n")
  1813.             }
  1814.             
  1815.         }
  1816.         ,window.ASN1=i
  1817.     }
  1818.     ();
  1819. var ASN1 = window.ASN1;
  1820. var  Base64 = window.Base64;
  1821. ASN1.prototype.getHexStringValue=function(){
  1822.         var t=this.toHexString(),e=2*this.header,i=2*this.length;
  1823.         return t.substr(e,i)
  1824.     }
  1825.     ,ue.prototype.parseKey=function(t){
  1826.         try{
  1827.             var e=0,i=0,r=/^\s*(?:[0-9A-Fa-f][0-9A-Fa-f]\s*)+$/,s=r.test(t)?Hex.decode(t):Base64.unarmor(t),n=ASN1.decode(s);
  1828.             if(3===n.sub.length&&(n=n.sub[2].sub[0]),9===n.sub.length){
  1829.                 e=n.sub[1].getHexStringValue(),this.n=he(e,16),i=n.sub[2].getHexStringValue(),this.e=parseInt(i,16);
  1830.                 var o=n.sub[3].getHexStringValue();
  1831.                 this.d=he(o,16);
  1832.                 var h=n.sub[4].getHexStringValue();
  1833.                 this.p=he(h,16);
  1834.                 var a=n.sub[5].getHexStringValue();
  1835.                 this.q=he(a,16);
  1836.                 var u=n.sub[6].getHexStringValue();
  1837.                 this.dmp1=he(u,16);
  1838.                 var c=n.sub[7].getHexStringValue();
  1839.                 this.dmq1=he(c,16);
  1840.                 var f=n.sub[8].getHexStringValue();
  1841.                 this.coeff=he(f,16)
  1842.             }
  1843.             else{
  1844.                 if(2!==n.sub.length)return!1;
  1845.                 var p=n.sub[1],l=p.sub[0];
  1846.                 e=l.sub[0].getHexStringValue(),this.n=he(e,16),i=l.sub[1].getHexStringValue(),this.e=parseInt(i,16)
  1847.             }
  1848.             return!0
  1849.         }
  1850.         catch(d){
  1851.             return!1
  1852.         }
  1853.         
  1854.     }
  1855.     ,ue.prototype.getPrivateBaseKey=function(){
  1856.         var t={
  1857.             array:[new KJUR.asn1.DERInteger({
  1858.                 "int":0
  1859.             }),new KJUR.asn1.DERInteger({
  1860.                 bigint:this.n
  1861.             }),new KJUR.asn1.DERInteger({
  1862.                 "int":this.e
  1863.             }),new KJUR.asn1.DERInteger({
  1864.                 bigint:this.d
  1865.             }),new KJUR.asn1.DERInteger({
  1866.                 bigint:this.p
  1867.             }),new KJUR.asn1.DERInteger({
  1868.                 bigint:this.q
  1869.             }),new KJUR.asn1.DERInteger({
  1870.                 bigint:this.dmp1
  1871.             }),new KJUR.asn1.DERInteger({
  1872.                 bigint:this.dmq1
  1873.             }),new KJUR.asn1.DERInteger({
  1874.                 bigint:this.coeff
  1875.             })]
  1876.         }
  1877.         ,e=new KJUR.asn1.DERSequence(t);
  1878.         return e.getEncodedHex()
  1879.     }
  1880.     ,ue.prototype.getPrivateBaseKeyB64=function(){
  1881.         return be(this.getPrivateBaseKey())
  1882.     }
  1883.     ,ue.prototype.getPublicBaseKey=function(){
  1884.         var t={
  1885.             array:[new KJUR.asn1.DERObjectIdentifier({
  1886.                 oid:"1.2.840.113549.1.1.1"
  1887.             }),new KJUR.asn1.DERNull]
  1888.         }
  1889.         ,e=new KJUR.asn1.DERSequence(t);
  1890.         t={
  1891.             array:[new KJUR.asn1.DERInteger({
  1892.                 bigint:this.n
  1893.             }),new KJUR.asn1.DERInteger({
  1894.                 "int":this.e
  1895.             })]
  1896.         };
  1897.         var i=new KJUR.asn1.DERSequence(t);
  1898.         t={
  1899.             hex:"00"+i.getEncodedHex()
  1900.         };
  1901.         var r=new KJUR.asn1.DERBitString(t);
  1902.         t={
  1903.             array:[e,r]
  1904.         };
  1905.         var s=new KJUR.asn1.DERSequence(t);
  1906.         return s.getEncodedHex()
  1907.     }
  1908.     ,ue.prototype.getPublicBaseKeyB64=function(){
  1909.         return be(this.getPublicBaseKey())
  1910.     }
  1911.     ,ue.prototype.wordwrap=function(t,e){
  1912.         if(e=e||64,!t)return t;
  1913.         var i="(.{1,"+e+"})( +|$\n?)|(.{1,"+e+"})";
  1914.         return t.match(RegExp(i,"g")).join("\n")
  1915.     }
  1916.     ,ue.prototype.getPrivateKey=function(){
  1917.         var t="-----BEGIN RSA PRIVATE KEY-----\n";
  1918.         return t+=this.wordwrap(this.getPrivateBaseKeyB64())+"\n",t+="-----END RSA PRIVATE KEY-----"
  1919.     }
  1920.     ,ue.prototype.getPublicKey=function(){
  1921.         var t="-----BEGIN PUBLIC KEY-----\n";
  1922.         return t+=this.wordwrap(this.getPublicBaseKeyB64())+"\n",t+="-----END PUBLIC KEY-----"
  1923.     }
  1924.     ,ue.prototype.hasPublicKeyProperty=function(t){
  1925.         return t=t||{},t.hasOwnProperty("n")&&t.hasOwnProperty("e")
  1926.     }
  1927.     ,ue.prototype.hasPrivateKeyProperty=function(t){
  1928.         return t=t||{},t.hasOwnProperty("n")&&t.hasOwnProperty("e")&&t.hasOwnProperty("d")&&t.hasOwnProperty("p")&&t.hasOwnProperty("q")&&t.hasOwnProperty("dmp1")&&t.hasOwnProperty("dmq1")&&t.hasOwnProperty("coeff")
  1929.     }
  1930.     ,ue.prototype.parsePropertiesFrom=function(t){
  1931.         this.n=t.n,this.e=t.e,t.hasOwnProperty("d")&&(this.d=t.d,this.p=t.p,this.q=t.q,this.dmp1=t.dmp1,this.dmq1=t.dmq1,this.coeff=t.coeff)
  1932.     };
  1933.     var _e=function(t){
  1934.         ue.call(this),t&&("string"==typeof t?this.parseKey(t):(this.hasPrivateKeyProperty(t)||this.hasPublicKeyProperty(t))&&this.parsePropertiesFrom(t))
  1935.     };
  1936.     _e.prototype=new ue,_e.prototype.constructor=_e;
  1937.     var ze=function(t){
  1938.         t=t||{},this.default_key_size=parseInt(t.default_key_size)||1024,this.default_public_exponent=t.default_public_exponent||"010001",this.log=t.log||!1,this.key=null
  1939.     };
  1940.     ze.prototype.setKey=function(t){
  1941.         this.log&&this.key&&console.warn("A key was already set, overriding existing."),this.key=new _e(t)
  1942.     }
  1943.     ,ze.prototype.setPrivateKey=function(t){
  1944.         this.setKey(t)
  1945.     }
  1946.     ,ze.prototype.setPublicKey=function(t){
  1947.         this.setKey(t)
  1948.     }
  1949.     ,ze.prototype.decrypt=function(t){
  1950.         try{
  1951.             return this.getKey().decrypt(Te(t))
  1952.         }
  1953.         catch(e){
  1954.             return!1
  1955.         }
  1956.         
  1957.     }
  1958.     ,ze.prototype.encrypt=function(t){
  1959.         try{
  1960.             return be(this.getKey().encrypt(t))
  1961.         }
  1962.         catch(e){
  1963.             return!1
  1964.         }
  1965.         
  1966.     }
  1967.     ,ze.prototype.getKey=function(t){
  1968.         if(!this.key){
  1969.             if(this.key=new _e,t&&"[object Function]"==={}.toString.call(t))return void this.key.generateAsync(this.default_key_size,this.default_public_exponent,t);
  1970.             this.key.generate(this.default_key_size,this.default_public_exponent)
  1971.         }
  1972.         return this.key
  1973.     }
  1974.     ,ze.prototype.getPrivateKey=function(){
  1975.         return this.getKey().getPrivateKey()
  1976.     }
  1977.     ,ze.prototype.getPrivateKeyB64=function(){
  1978.         return this.getKey().getPrivateBaseKeyB64()
  1979.     }
  1980.     ,ze.prototype.getPublicKey=function(){
  1981.         return this.getKey().getPublicKey()
  1982.     }
  1983.     ,ze.prototype.getPublicKeyB64=function(){
  1984.         return this.getKey().getPublicBaseKeyB64()
  1985.     }
  1986.     ,ze.version="2.3.1",t.JSEncrypt=ze
  1987. });
复制代码
上边标注的地方改成能解密的函数 谢谢了  JS完全不懂呀

最佳答案

查看完整内容

js没有问题。function getDetryptPwd(pwd, pbk) ,这个地方传密文跟私钥就行了。rsa公钥跟私钥有区别,你用公钥加密不能用公钥解密。

回答提醒:如果本帖被关闭无法回复,您有更好的答案帮助楼主解决,请发表至 源码区 可获得加分喔。
友情提醒:本版被采纳的主题可在 申请荣誉值 页面申请荣誉值,获得 1点 荣誉值,荣誉值可兑换荣誉会员、终身vip用户组。
快捷通道:申请荣誉值无答案申请取消悬赏投诉有答案未采纳为最佳
结帖率:100% (10/10)
发表于 2018-1-10 16:55:52 | 显示全部楼层   湖南省邵阳市
js没有问题。function getDetryptPwd(pwd, pbk) ,这个地方传密文跟私钥就行了。rsa公钥跟私钥有区别,你用公钥加密不能用公钥解密。

评分

参与人数 1荣誉 +1 收起 理由
笨潴 + 1 热心帮助他人,荣誉+1,希望继续努力(*^__^*) 嘻嘻!

查看全部评分

回复

使用道具 举报

结帖率:100% (4/4)

签到天数: 5 天

发表于 2018-1-10 17:10:33 | 显示全部楼层   广东省东莞市
定制帖等着你!!
回复

使用道具 举报

发表于 2018-1-10 17:14:00 | 显示全部楼层   山东省烟台市
js,不难的建议去菜鸟教程学习下
回复

使用道具 举报

结帖率:100% (10/10)

签到天数: 5 天

发表于 2018-1-10 17:25:48 | 显示全部楼层   广东省广州市
没私钥,解不了。私钥估计你也么办法搞到手,私钥几乎都在服务器那里。所以没私钥基本无解。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则 致发广告者

发布主题 收藏帖子 返回列表

sitemap| 易语言源码| 易语言教程| 易语言论坛| 易语言模块| 手机版| 广告投放| 精易论坛
拒绝任何人以任何形式在本论坛发表与中华人民共和国法律相抵触的言论,本站内容均为会员发表,并不代表精易立场!
论坛帖子内容仅用于技术交流学习和研究的目的,严禁用于非法目的,否则造成一切后果自负!如帖子内容侵害到你的权益,请联系我们!
防范网络诈骗,远离网络犯罪 违法和不良信息举报电话0663-3422125,QQ: 793400750,邮箱:wp@125.la
Powered by Discuz! X3.4 揭阳市揭东区精易科技有限公司 ( 粤ICP备12094385号-1) 粤公网安备 44522102000125 增值电信业务经营许可证 粤B2-20192173

快速回复 返回顶部 返回列表