mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-28 03:29:20 +03:00
Ask password to generate S/MIME self signed #259
This commit is contained in:
parent
3f08051e37
commit
568caed3c7
43 changed files with 147 additions and 62 deletions
|
|
@ -14,6 +14,8 @@ import { folderListOptionsBuilder } from 'Common/Folders';
|
|||
import { i18n } from 'Common/Translator';
|
||||
import { defaultOptionsAfterRender } from 'Common/Utils';
|
||||
|
||||
import { AskPopupView } from 'View/Popup/Ask';
|
||||
|
||||
export class IdentityPopupView extends AbstractViewPopup {
|
||||
constructor() {
|
||||
super('Identity');
|
||||
|
|
@ -42,16 +44,21 @@ export class IdentityPopupView extends AbstractViewPopup {
|
|||
this.createSelfSigned = this.createSelfSigned.bind(this);
|
||||
}
|
||||
|
||||
createSelfSigned() {
|
||||
let identity = this.identity();
|
||||
Remote.request('SMimeCreateCertificate', (iError, oData) => {
|
||||
if (oData.Result.x509) {
|
||||
identity.smimeKey(oData.Result.pkey);
|
||||
identity.smimeCertificate(oData.Result.x509);
|
||||
}
|
||||
}, {
|
||||
email: identity.email()
|
||||
});
|
||||
async createSelfSigned() {
|
||||
const identity = this.identity(),
|
||||
pass = await AskPopupView.password('', 'CRYPTO/CREATE_SELF_SIGNED');
|
||||
if (pass) {
|
||||
Remote.request('SMimeCreateCertificate', (iError, oData) => {
|
||||
if (oData.Result.x509) {
|
||||
identity.smimeKey(oData.Result.pkey);
|
||||
identity.smimeCertificate(oData.Result.x509);
|
||||
}
|
||||
}, {
|
||||
name: identity.name(),
|
||||
email: identity.email(),
|
||||
passphrase: pass.password
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
submitForm(form) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue