SignAuditEvidenceA

Enterprise, audit evidence and 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 an empty string and sets LastErrorCode to 900 (PDFLIB_ERROR_ENTERPRISE_REQUIRED)

Description

The trailing A denotes the ANSI (char) DLL entry point; the ActiveX/COM surface exposes only the Unicode form. Behaviour is identical to SignAuditEvidence and string arguments are interpreted using the current SetAnsiMode code page

Canonicalises a valid single-file audit evidence object and signs those exact UTF-8 bytes with a detached CMS signature from a PFX identity

Syntax

Delphi

Function DLSignAuditEvidenceA(InstanceID: Integer; EvidenceJSON: PAnsiChar; PFXFileName: PAnsiChar; PFXPassword: PAnsiChar; DigestAlgorithm: Integer): PAnsiChar;

DLL

const char* DLSignAuditEvidenceA(int InstanceID, const char* EvidenceJSON, const char* PFXFileName, const char* PFXPassword, int DigestAlgorithm);

Parameters

EvidenceJSON must be a structurally valid single-file result of CreateAuditEvidence; batch envelopes and operational error objects are rejected; policy-rejected or incomplete evidence may still be signed without changing its conclusions

DigestAlgorithm is 2 for SHA-256, 3 for SHA-384 or 4 for SHA-512; SHA-1 and automatic selection are not accepted

Deterministic payload profile

pdflib-evidence-json-v1 sorts object keys by UTF-16 ordinal order, retains array order, normalises finite JSON decimal spellings exactly without binary floating point, escapes strings consistently and encodes the result as UTF-8

This is a named library profile rather than RFC 8785; duplicate keys, malformed Unicode and values beyond its node, depth, numeric and output limits are rejected

Equivalent accepted JSON objects produce the same canonical payload and payload SHA-256; the CMS bytes can vary because signing providers may use random values or signed attributes

Result and limits

A successful envelope contains schemaVersion:1, status:"ok", canonicalization, payloadSha256, canonical evidence and lowercase cmsDERHex; the newly created signature is independently checked before being returned

The operation does not rewrite a PDF or authenticate a standards verdict; source fingerprints, model identity, original accepted/complete values and fullCertification:false remain part of the signed payload

The profile allows 8388608 UTF-16 input units, 16777216 canonical UTF-8 bytes, 50000 nodes, depth 48 and 2097152 CMS bytes; numbers are bounded to 1024 source characters and an absolute decimal exponent of 1024

PFX input is limited to 16 MiB, and the password to 4096 UTF-16 units without NUL; private-key UI is disabled; Windows imports are ephemeral rather than persisted into the user's key store; credentials are used only for this explicit signing operation and are not included in the envelope

Single and Small Business instances return an empty string with error 900; operational failures return an error object with error 905; ActiveX uses IPDFlibrary10, and Dylib exposes the same wide and ANSI names with cdecl

Example

Envelope:= PDF.SignAuditEvidence(Evidence, 'audit-identity.pfx', Password, 2);
Verification:= PDF.VerifyAuditEvidenceEnvelope(Envelope, '{}');

Run the shared workflow CLI example through the Delphi, Lazarus or C++Builder entry for the required edition, including progress and batch cancellation

See also

VerifyAuditEvidenceEnvelope · CreateAuditEvidence · CompareAuditEvidence