Execute

Security and signatures

Requires the Enterprise edition — a method of TPDFlibDSSProcess in the Enterprise unit PDFlibEntSignVerify

Description

Reads the source PDF, writes the certificates, CRLs, OCSP responses and VRI entries of the process into the /DSS dictionary of the document catalog and delivers the augmented PDF to the target: the original bytes followed by one incremental update.

The result code is also stored in ProcessResult. The codes mirror those of the sign process so that one Case statement can route both.

Requires the Enterprise edition; the method belongs to TPDFlibDSSProcess in unit PDFlibEntSignVerify.

Syntax

Delphi

Function TPDFlibDSSProcess.Execute: Integer;

Return values

1The /DSS dictionary was written and the augmented PDF was delivered to the target
2SourceDataType is dtFile and SourceFileName does not exist
3The source cannot be read or parsed: opening or copying the source file failed, SourceDataType has a value outside TPDFlibDataType, the reader rejected the data (an empty stream or string, for example), or the document is encrypted and SourcePassword does not open it
10The target could not be written: creating or writing TargetFileName raised an error, or TargetDataType is dtStream and TargetStream is Nil
11The document has no catalog, so the /DSS dictionary could not be added; nothing is written to the target

Remarks

The target is written only after the store was added. On 2, 3 and 11 nothing is written; on 10 with a file target the output file may exist but not be complete.

SourceStream is read from position 0 and TargetStream is truncated to position 0 and rewritten; neither is freed. With dtString the complete document is stored in TargetString. TargetDataType has to be one of the three TPDFlibDataType values: the delivery step has no branch for another value.

When the catalog already has a /DSS dictionary, the new material is appended to its /Certs, /CRLs and /OCSPs arrays and the new entries are added to its /VRI dictionary. The /Extensions /ESIC declaration of the catalog is raised to extension level 1 when it is lower.

Each input string becomes one uncompressed stream object; nothing is validated here, so the material has to be DER-encoded data (see AddCertificate, AddCRL, AddOCSP). VRI entries are written as described under TPAdESVRIEntry.

The update is written with a cross-reference stream when the source uses one and with a classic trailer otherwise. The conditions in the return table are reported as codes and do not raise.

See also

TPDFlibDSSProcess, AddCertificate, AddCRL, AddOCSP, AddVRIEntry, TPDFlibDataType, TPAdESVRIEntry, EndPAdESDSSProcessToFile, GetPAdESDSSProcessResult, ApplyPAdESLongTermValidation