diff --git a/src/js/logic/validate-signature-pdf-page.ts b/src/js/logic/validate-signature-pdf-page.ts index 5f4956a0..bf9c16cf 100644 --- a/src/js/logic/validate-signature-pdf-page.ts +++ b/src/js/logic/validate-signature-pdf-page.ts @@ -367,7 +367,10 @@ function createSignatureCard( let statusColor = 'text-green-400'; let statusIcon = 'check-circle'; - let statusText = trText('Valid Signature'); + const isTimestamp = result.isTimestamp === true; + let statusText = isTimestamp + ? trText('Valid Timestamp') + : trText('Valid Signature'); if (!result.isValid) { if (result.cryptoVerificationStatus === 'unsupported') { @@ -380,19 +383,19 @@ function createSignatureCard( ) { statusColor = 'text-yellow-400'; statusIcon = 'alert-triangle'; - statusText = trText('Modified After Signing (signed part intact)'); + statusText = isTimestamp + ? trText('Modified After Timestamping (timestamped part intact)') + : trText('Modified After Signing (signed part intact)'); } else { statusColor = 'text-red-400'; statusIcon = 'x-circle'; statusText = result.cryptoVerified === false ? trText('Invalid: Cryptographic Verification Failed') - : trText('Invalid Signature'); + : result.usesInsecureDigest + ? trText('Insecure Digest (MD5 / SHA-1)') + : trText('Invalid Signature'); } - } else if (result.usesInsecureDigest) { - statusColor = 'text-red-400'; - statusIcon = 'x-circle'; - statusText = trText('Insecure Digest (MD5 / SHA-1)'); } else if (result.isExpired) { statusColor = 'text-yellow-400'; statusIcon = 'alert-triangle'; @@ -400,9 +403,11 @@ function createSignatureCard( } else if (!result.isTrusted) { statusColor = 'text-yellow-400'; statusIcon = 'alert-triangle'; - statusText = result.isSelfSigned - ? trText('Self-Signed: Signer Identity Not Verified') - : trText('Signature Intact: Signer Identity Not Verified'); + statusText = isTimestamp + ? trText('Timestamp Intact: Timestamp Authority Not Verified') + : result.isSelfSigned + ? trText('Self-Signed: Signer Identity Not Verified') + : trText('Signature Intact: Signer Identity Not Verified'); } const formatDate = (date: Date) => { @@ -430,7 +435,7 @@ function createSignatureCard(
${statusText}
${trHtml('Signed By')}
+${isTimestamp ? trHtml('Timestamped By') : trHtml('Signed By')}
${escapeHtml(result.signerName)}
${result.signerOrg ? `${escapeHtml(result.signerOrg)}
` : ''} ${result.signerEmail ? `${escapeHtml(result.signerEmail)}
` : ''} @@ -464,7 +469,7 @@ function createSignatureCard( result.signatureDate ? `${trHtml('Signed On')}
+${isTimestamp ? trHtml('Timestamped On') : trHtml('Signed On')}
${formatDate(result.signatureDate)}
${trHtml('Serial Number:')} ${escapeHtml(result.serialNumber)}
${trHtml('Digest Algorithm:')} ${escapeHtml(result.algorithms.digest)}
${trHtml('Signature Algorithm:')} ${escapeHtml(result.algorithms.signature)}
+ ${result.algorithms.imprint ? `${trHtml('Timestamp Imprint Algorithm:')} ${escapeHtml(result.algorithms.imprint)}
` : ''} ${result.errorMessage ? `${trHtml('Error: {{error}}', { error: result.errorMessage })}
` : ''} ${result.unsupportedAlgorithmReason ? `${escapeHtml(result.unsupportedAlgorithmReason)}
` : ''}