ApplyPAdESLongTermArchiveValidation

Digital signatures

Requires the Enterprise edition — in Delphi, C++Builder and Lazarus code create the library as TPDFlibEnterprise (unit PDFlibEnterprise); the Enterprise DLL and ActiveX builds provide it unchanged; other editions keep the method, which returns 0, an empty string or False and sets LastErrorCode to 900 (PDFLIB_ERROR_ENTERPRISE_REQUIRED)

Description

Promotes an already-signed PDF to PAdES B-LTA in one call: the B-LT validation-material upgrade runs first, then a /DocTimeStamp signature with /SubFilter /ETSI.RFC3161 is appended whose token is fetched from the TSA configured with SetTimeStampServer, writing the result to a file

Syntax

Delphi

Function TPDFlib.ApplyPAdESLongTermArchiveValidation(Const InputFile, Password, OutputFile, FieldName: WideString; Options: Integer): Integer; Virtual;

ActiveX

Function PDFlib::ApplyPAdESLongTermArchiveValidation(InputFile As String, Password As String, OutputFile As String, FieldName As String, Options As Long) As Long

DLL

int DLApplyPAdESLongTermArchiveValidation(int InstanceID, const wchar_t* InputFile, const wchar_t* Password, const wchar_t* OutputFile, const wchar_t* FieldName, int Options);
int DLApplyPAdESLongTermArchiveValidationA(int InstanceID, const char* InputFile, const char* Password, const char* OutputFile, const char* FieldName, int Options);

Parameters

InputFileThe signed PDF
PasswordThe password to open it, or an empty string
OutputFileThe B-LTA PDF to write
FieldNameA signature field to process, or an empty string to process every signature into one revision
OptionsA PADES_LTV_* bit mask as documented for ApplyPAdESLongTermValidation; 0 selects PADES_LTV_DEFAULT

Return values

1The promotion succeeded
2The input file could not be read
3The B-LT stage failed; GetPAdESLTVError returns the reason
4No TSA is configured or the TSA refused the request; GetTimeStampError holds the TSA detail
10The output could not be written
11The document time-stamp could not be applied

See also

ApplyPAdESLongTermValidation, SetTimeStampServer, SetPAdESSignatureTimeStampDigestAlgorithm