VerifyAuditEvidenceEnvelope

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

Recreates the deterministic evidence payload, checks its SHA-256 and detached CMS signature, and optionally evaluates the signer against caller-supplied trust anchors and time

Syntax

Delphi

Function TPDFlib.VerifyAuditEvidenceEnvelope(Const EnvelopeJSON,
  TrustPolicyJSON: WideString): WideString; Virtual;

ActiveX

Function PDFlib::VerifyAuditEvidenceEnvelope(EnvelopeJSON As String, TrustPolicyJSON As String) As String

DLL

const wchar_t* DLVerifyAuditEvidenceEnvelope(int InstanceID, const wchar_t* EnvelopeJSON, const wchar_t* TrustPolicyJSON);
const char* DLVerifyAuditEvidenceEnvelopeA(int InstanceID, const char* EnvelopeJSON, const char* TrustPolicyJSON);

Parameters

EnvelopeJSONEnvelope produced by SignAuditEvidence whose canonical payload and detached CMS signature are checked
TrustPolicyJSONOptional JSON trust policy; an empty string or {} checks payload and CMS integrity only and leaves signer trust not-checked. Explicit anchors require verificationTimeUTC in the exact form YYYY-MM-DDTHH:MM:SSZ, with optional CRLs and extra certificates supplied as lowercase DER hexadecimal arrays of at most 32 entries

Return values

Returns JSON with integrity for the canonical payload and CMS signature, trust for the explicit signer path policy, and compliance for the unchanged conclusions recorded in the evidence. Malformed schemas, invalid DER encodings or invalid trust-policy inputs return an error object with error 905; a well-formed envelope with invalid integrity keeps status:"ok" but reports the invalid integrity result, and other editions return an empty string with error 900.

Explicit trust policy

An empty string or {} checks payload and CMS integrity whilst leaving signer trust not-checked; system certificate stores and network retrieval are not used

{"anchorsDERHex":["...lowercase DER hex..."],
 "verificationTimeUTC":"2026-10-29T12:00:00Z",
 "checkRevocation":false,"crlsDERHex":[],"extraCertificatesDERHex":[]}

Explicit anchors require verificationTimeUTC in the exact format shown; optional CRLs are supplied as lowercase DER hexadecimal values, with at most 32 values per certificate or CRL array

The requested time is a policy input rather than a trusted timestamp; path trust at that time does not establish legal validity, remote revocation freshness or full evidence certification

extraCertificatesDERHex can supply missing intermediates as an untrusted chain-building pool under the same per-array limits; these certificates are never promoted to trust anchors

Separated results

The result contains integrity for the canonical payload and CMS signature, trust for the explicit signer path policy, and compliance for the unchanged conclusions recorded in the evidence

compliance.authenticated identifies whether the supplied claims were authenticated by a valid signature; validationRerun:false states that the PDF was not audited again; an authenticated incomplete or policy-rejected report remains incomplete or rejected

A valid signature does not make the original audit complete, and valid signer trust does not change fullCertification:false; callers must inspect each result separately

Malformed schemas, unsupported canonicalisation, invalid DER encodings or invalid trust-policy inputs return an error object and error 905; a well-formed envelope with invalid integrity can return status:"ok" with an invalid integrity result

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

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

SignAuditEvidence · CreateAuditEvidence · CompareAuditEvidence