
kerio.waw.ui.sslCertificateGenerate = {

x_m: function(x_n) {
var
x_1ol,
x_br,
x_1d,
x_1c,
x_1om,
x_ja,
x_jb,
x_10,
x_16,
x_2w,
x_1on,
x_1b = kerio.lib,
x_x = x_1b.x_x;
this.x_ga = x_n; x_2w = x_n + '_';

x_1on = function() {
var
x_10g = kerio.waw.status.x_p.x_10g,
x_1oo;
switch (x_10g) {
case 'en':
x_1oo = 'us';
break;
case 'sv':
x_1oo = 'se';
break;
case 'cs':
x_1oo = 'cz';
break;
default:
x_1oo = x_10g;
}
return x_1oo.toUpperCase();
};x_1ol = 100;
x_br = x_1b.x_a1(
{	x_a2: 120,
de: 125,
es: 125,
ja: x_1ol,
en: x_1ol,
zh: x_1ol
});
x_1d = {
x_1e: [
{	x_1f: 'x_79',
x_23: x_x('Attributes', 'sslCertificate'),
x_br: x_br,
x_1e: [
{	x_1j: 'hostname',
x_23: x_x('Hostname:', 'sslCertificate'),
x_93: 64,
x_ge: true,
x_b6: {
x_b7: false,
x_nv: 'x_nw'
}
},
{	x_1j: 'organizationName',
x_23: x_x('Organization name:', 'sslCertificate'),
x_93: 64,
x_ge: true
},
{	x_1j: 'organizationalUnitName',
x_23: x_x('Organizational unit:', 'sslCertificate'),
x_93: 64,
x_ge: true
},
{	x_1j: 'city',
x_23: x_x('City:', 'sslCertificate'),
x_93: 128,
x_ge: true
},
{	x_1j: 'state',
x_23: x_x('State or Province:', 'sslCertificate'),
x_93: 128,
x_ge: true
},
{	x_1f: 'x_9u',
x_1j: 'country',
x_23: x_x('Country:', 'sslCertificate'),
x_a5: 'value',
x_a7: 'name',
x_5z: []},
{	x_1f: 'x_5x',
x_1p: 'formLastContainer',
x_1e: [
{	x_1f: 'x_1kd',
x_1j: 'validFromDate',
x_23: x_x('Valid date:', 'sslCertificate')
},
{	x_1f: 'x_1i',
x_1l: true,
x_1o: '-',
x_1u: 10
},
{	x_1f: 'x_1kd',
x_1j: 'validToDate',
x_1l: true
}
]
}
]}
]};x_1c = new x_1b.x_1t(x_2w + 'x_1c', x_1d);
x_1om = 400;
x_ja = x_1b.x_a1(
{	x_a2: 410,
ja: x_1om,
en: x_1om,
zh: x_1om
});
x_jb = x_1b.x_a1(
{	x_a2: 330,
en: 340
});
x_10 = {
x_1u: x_ja,
x_l0: x_ja,
x_1v: x_jb,
x_l1: x_jb,
x_1y: x_x('Generate Certificate', 'sslCertificate'),
x_1x: x_1c,
x_1z: [
{	x_1j: 'x_1o2',
x_23: x_x('Generate…', 'common'),
x_20: true,

x_25: function(x_32) {
var
x_16 = x_32.x_16;
x_16.x_ly(kerio.lib.x_x('Generating certificate…', 'sslCertificate'));
x_16.x_iy();
}},
{	x_1j: 'x_ji',
x_23: x_x('Cancel', 'common'),
x_21: true
}
]};x_16 = new x_1b.x_26(x_n, x_10);
x_1c.x_27(
{	x_1op: x_1c.x_29('country')
});
x_16.x_27(
{	x_1c: x_1c,
x_1oq: false,
x_1or: '',
x_1oo: x_1on(),
x_150: undefined,
x_oo: undefined
});
this.x_2a(x_16);
return x_16;
}, 
x_2a: function(x_2b) {

x_2b.x_2c = function(x_28){
this.x_150 = x_28.x_47.x_150;
this.x_oo = x_28.x_9d;
this.x_24();
if (this.x_1oq) {
this.x_1os();
} else {
x_fi.x_db(
{	x_da: [
{	object: 'CertificateManager',
method: 'getCountryList'
},
{	object: 'ProductInfoManager',
method: 'getSystemHostname'
}
],
x_2q: this,
x_2e: this.x_1ot
}
);
}
};
x_2b.x_1ot = function(x_6v) {
var
x_ql = x_6v.x_ac.batchResult;
this.x_1oq = true;
this.x_1c.x_1op.x_7k(x_ql[0].countries);
this.x_1or = x_ql[1].hostname;
this.x_1os();
};
x_2b.x_1os = function() {
var
x_1ou = this.x_150.subject,
x_o4 = this.x_150.valid,
x_7h = {},
x_1ov,
x_1kd,
x_g6,
x_41, x_42;
if (x_o4) {
for (x_41 = 0, x_42 = x_1ou.length; x_41 < x_42; x_41++) {
x_g6 = x_1ou[x_41];
x_7h[x_g6.name] = x_g6.value;
}
} else {
x_7h.country = this.x_1oo;
}
x_1kd = new Date();
x_7h.validFromDate = Math.round(x_1kd.getTime() / 1000);
x_1kd.setFullYear(x_1kd.getFullYear() + 1);
x_7h.validToDate = Math.round(x_1kd.getTime() / 1000);
x_7h.validFromTime = x_1kd.format('H:i');
x_7h.validToTime = x_7h.validFromTime;
x_1ov = kerio.lib.x_10o.x_192(
x_7h.hostname,
x_r.x_193,
x_fa.x_194.x_1hq);
if (x_1ov) {
x_7h.hostname = this.x_1or;
}
this.x_1c.x_7k(x_7h);
this.x_24(false);
};
x_2b.x_iy = function() {
var
x_7h = this.x_1c.x_7i(),
x_28 = {},x_1ow,
x_1ox;
x_28.subject = [
{	name: 'hostname',
value: x_7h.hostname
},
{	name: 'organizationName',
value: x_7h.organizationName
},
{	name: 'organizationalUnitName',
value: x_7h.organizationalUnitName
},
{	name: 'city',
value: x_7h.city
},
{	name: 'state',
value: x_7h.state
},
{	name: 'country',
value: x_7h.country
}
];x_1ow = new Date(x_7h.validFromDate * 1000);
x_1ox = new Date(x_7h.validToDate * 1000);
x_28.period = {
validFromDate: {
year: x_1ow.getFullYear(),
month: x_1ow.getMonth(),
day: x_1ow.getDate()
},
validFromTime: {
hour: 0,
min: 0
},
validToDate: {
year: x_1ox.getFullYear(),
month: x_1ox.getMonth(),
day: x_1ox.getDate()
},
validToTime: {
hour: 23,
min: 59
}
};
x_fi.x_4y(
'CertificateManager',
'generate',
x_28,
this.x_jk,
this
);
};
x_2b.x_jk = function (x_6v) {
var
x_ac = x_6v.x_ac;
this.x_24(false);
if (!x_6v.x_6x) {
return;
}
kerio.lib.x_5l.x_5m({
x_5g: 'sslCertificateDetails',
x_n: 'x_19g',
x_28: {
x_9d: this,
x_47: {
x_150: x_ac.certificate,
x_1o5: x_ac.id,
x_19l: kerio.lib.x_x('SSL Certificate has been generated successfully.', 'sslCertificate')
}
}
});
this.x_2r();
};
x_2b.x_jo = function() {
this.x_1c.x_2h();
};
}
}; 