Skip to content
Snippets Groups Projects
Commit 1cedf9ed authored by Guillaume Heurtier's avatar Guillaume Heurtier
Browse files

FEAT #14565 TIME 0:00 handle fortify read exception

parent a46e4c09
No related branches found
No related tags found
No related merge requests found
......@@ -405,6 +405,7 @@
"validateDocumentWarning": "You are about to validate this document!",
"certifiedDocument": "Certified document",
"certifiedDocumentMsg": "The document was signed by digital certificate, you cannot affix a stamp.",
"errorUserSignType": "Signers without a certificate must be present before signers with a certificate."
"errorUserSignType": "Signers without a certificate must be present before signers with a certificate.",
"fortifyReadException": "Error when communicating with Fortify"
}
}
\ No newline at end of file
}
......@@ -402,6 +402,7 @@
"validateDocumentWarning": "Vous êtes sur le point de valider ce document !",
"certifiedDocument": "Document certifié",
"certifiedDocumentMsg": "Le document a été signé par certificat numérique, vous ne pouvez pas apposer de griffe.",
"errorUserSignType": "Les signataires sans certificat doivent être présent avant les signataires avec certificat."
"errorUserSignType": "Les signataires sans certificat doivent être présent avant les signataires avec certificat.",
"fortifyReadException": "Erreur lors de la communication avec Fortify"
}
}
......@@ -65,10 +65,17 @@ export class SignatureMethodModalComponent implements OnInit {
}).then(async (load: HTMLIonLoadingElement) => {
load.present();
this.provider = await certData.detail.server.getCrypto(certData.detail.providerId);
this.cert = await this.provider.certStorage.getItem(certData.detail.certificateId);
this.certPem = await this.provider.certStorage.exportCert('pem', this.cert);
this.privateKey = await this.provider.keyStorage.getItem(certData.detail.privateKeyId);
try {
this.provider = await certData.detail.server.getCrypto(certData.detail.providerId);
this.cert = await this.provider.certStorage.getItem(certData.detail.certificateId);
this.certPem = await this.provider.certStorage.exportCert('pem', this.cert);
this.privateKey = await this.provider.keyStorage.getItem(certData.detail.privateKeyId);
} catch (e) {
this.notificationService.error('lang.fortifyReadException');
load.dismiss();
this.modalController.dismiss(false);
return;
}
this.certificate = {
certificate: this.certPem
......@@ -94,7 +101,15 @@ export class SignatureMethodModalComponent implements OnInit {
console.log('hashDocumentHex', hashDocumentHex);
const hashSignature = await this.provider.subtle.sign(alg, this.privateKey, hashDocumentHex);
let hashSignature;
try {
hashSignature = await this.provider.subtle.sign(alg, this.privateKey, hashDocumentHex);
} catch (e) {
this.notificationService.error('lang.fortifyReadException');
resolve(false);
return of(false);
}
console.log('hashSignature', hashSignature);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment