mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-26 02:29:20 +03:00
Add intermediate certificates for S/MIME signing
This commit is contained in:
parent
8bf4727555
commit
dddf360db6
8 changed files with 39 additions and 4 deletions
|
|
@ -24,6 +24,7 @@ export class IdentityModel extends EmailModel /*AbstractModel*/ {
|
|||
|
||||
smimeKey: '',
|
||||
smimeCertificate: '',
|
||||
smimeCertificateChain: '',
|
||||
|
||||
askDelete: false,
|
||||
|
||||
|
|
@ -33,7 +34,9 @@ export class IdentityModel extends EmailModel /*AbstractModel*/ {
|
|||
addComputablesTo(this, {
|
||||
smimeKeyEncrypted: () => this.smimeKey().includes('-----BEGIN ENCRYPTED PRIVATE KEY-----'),
|
||||
smimeKeyValid: () => /^-----BEGIN (ENCRYPTED |RSA )?PRIVATE KEY-----/.test(this.smimeKey()),
|
||||
smimeCertificateValid: () => /^-----BEGIN CERTIFICATE-----/.test(this.smimeCertificate())
|
||||
smimeCertificateValid: () => /^-----BEGIN CERTIFICATE-----/.test(this.smimeCertificate()),
|
||||
smimeCertificateChainValid: () => !this.smimeCertificateChain()
|
||||
|| /^-----BEGIN CERTIFICATE-----/.test(this.smimeCertificateChain())
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1413,7 +1413,8 @@ export class ComposePopupView extends AbstractViewPopup {
|
|||
key && options.push(['OpenPGP', key]);
|
||||
key = GnuPGUserStore.getPrivateKeyFor(email, 1);
|
||||
key && options.push(['GnuPG', key]);
|
||||
identity.smimeKeyValid() && identity.smimeCertificateValid() && identity.email === email
|
||||
identity.smimeKeyValid() && identity.smimeCertificateValid()
|
||||
&& identity.smimeCertificateChainValid() && identity.email === email
|
||||
&& options.push(['S/MIME']);
|
||||
console.dir({signOptions: options});
|
||||
this.signOptions(options);
|
||||
|
|
@ -1610,6 +1611,7 @@ export class ComposePopupView extends AbstractViewPopup {
|
|||
// TODO: sign in PHP fails
|
||||
params.sign = 'S/MIME';
|
||||
// params.signCertificate = identity.smimeCertificate();
|
||||
// params.signCertificateChain = identity.smimeCertificateChain();
|
||||
// params.signPrivateKey = identity.smimeKey();
|
||||
// params.attachCertificate = false;
|
||||
if (identity.smimeKeyEncrypted()) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue