|
|
|
|
|
PDFVerifySignatures (Function) In french: PDFVérifieSignatures Checks the validity of PDF signatures. If there are any invalid signatures, this function allows you to get their details. New in version 2025Note: This function is only available from version 2025 Update 1.
My_PDF is pdfDocument = pdf_file_path
PDFVerifySignatures(My_PDF, Verification_procedure)
PROCEDURE Verification_procedure(PDF_doc, Signature_index, Error_code)
Error_text is string
SWITCH Error_code
CASE pdfInvalidSignature: Error_text = StringBuild("Signature %1 is invalid", Signature_index)
CASE pdfCertificateExpired: Error_text = StringBuild("The certificate of the %1 signature has expired", Signature_index)
CASE pdfModifiedAfterSigning: Error_text = "The PDF file was modified after signing"
END
IF Signature_index > 0 THEN
Error_text += CR + CR
let Signature_buffer = PDFGetSignature(PDF_doc, Signature_index)
certif is Certificate = CertificateExtract(Signature_buffer)
Error_text += StringBuild([
Signature number %1
Issuer: %2
Name: %3
Valid from: %4
Valid until: %5
Signature date: %6
],
Signature_index,
certif.Issuer,
certif.Name,
DateToString(certif.StartValidityDate),
DateToString(certif.EndValidityDate),
DateToString(PDFGetSignatureDate(PDF_doc, Signature_index)))
END
IF ErrorOccurred THEN
Error_text += CR + CR+ ErrorInfo(errSummary)
Info(Error_text)
RETURN False
ELSE
RETURN True
END
Syntax
Verifying the signatures of a pdfDocument variable Hide the details
<Result> = PDFVerifySignatures(<Document> , <WLanguage procedure>)
<Result>: Boolean - True if the verification was completed and no problems were detected. The document contains valid signatures or no signatures.
Reminder: You can check the number of signatures with PDFNbSignatures. - False if the document could not be opened, if one of the signatures is invalid or if the document was modified after signing.
<Document>: pdfDocument variable Name of the pdfDocument variable containing the PDF document to be analyzed. <WLanguage procedure>: Procedure name Name of WLanguage procedure ("callback") executed for each invalid signature found. For more details on this procedure, see Parameters of the procedure used by PDFVerifySignatures.
Verifying the signatures of a PDF file Hide the details
<Result> = PDFVerifySignatures(<PDF file> [, <Password>] , <WLanguage procedure>)
<Result>: Boolean - True if the verification was completed and no problems were detected. The document contains valid signatures or no signatures.
Reminder: You can check the number of signatures with PDFNbSignatures. - False if the document could not be opened.
<PDF file>: Character string Name and path of the PDF file to be analyzed. <Password>: Optional string or Secret string PDF file password.
New in version 2025Secret strings: If you use the secret string vault, the type of secret string used for this parameter must be "ANSI or Unicode string". To learn more about secret strings and how to use the vault, see Secret string vault. <WLanguage procedure>: Procedure name Name of WLanguage procedure ("callback") executed for each invalid signature found. For more details on this procedure, see Parameters of the procedure used by PDFVerifySignatures. Business / UI classification: Business Logic
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|