PDFium Delphi Component Docs

FPdfCryptoSsl unit

HTTP(S), LDAP, LDAPS and StartTLS transport helpers are shared core infrastructure; Enterprise functionality covers the higher-level trusted-signature, evidence and long-term validation workflows. Transport availability alone does not establish signer trust; see the edition matrix

Unit: FPdfCryptoSsl
OpenSSL support for explicitly configured PAdES signing, detached/attached CMS checks, certificate trust, resource-limited CRL/OCSP validation and individual signer diagnostics

Syntax

type
  EPdfSslError = class(Exception);

  TPdfSslCapabilities = record
    Available: Boolean;
    DetachedVerification: Boolean;
    AttachedVerification: Boolean;
    SystemTrustStore: Boolean;
    CustomTrustAnchors: Boolean;
    LocalCrls: Boolean;
    ChainCertificateCollection: Boolean;
    OnlineRetrieval: Boolean;
    RetrievalTimeout: Boolean;
    RevocationDiagnostics: Boolean;
    SignerDiagnostics: Boolean;
    RevocationCertificateCollection: Boolean;
    Signing: Boolean;
    OcspVerification: Boolean;
  end;

  TPdfSslVerifyDiagnostic = (psvdBackendUnavailable, psvdOnlineRetrievalIgnored,
    psvdRetrievalTimeoutIgnored, psvdNoCrlsConfigured);
  TPdfSslVerifyDiagnostics = set of TPdfSslVerifyDiagnostic;

  TPdfSslCmsVerifier = class(TInterfacedObject, IPdfCmsVerifier)
  public
    constructor Create; overload;
    constructor Create(const LdapTlsOptions: TPdfLdapTlsOptions); overload;
    function BackendName: string;
    function VerifyDetached(const CmsDer: TBytes; Segment1: Pointer; Segment1Length: Cardinal; Segment2: Pointer; Segment2Length: Cardinal; const Options: TPdfCmsVerifyOptions): TPdfCmsVerifyResult;
    function VerifyAttached(const CmsDer: TBytes; const Options: TPdfCmsVerifyOptions): TPdfCmsVerifyResult;
  end;

procedure ConfigureSslLibraryPath(const APath: string);
function SslAvailable: Boolean;
function SslMissingSymbols: string;
function SslLibraryPath: string;
function SslLibraryVersion: string;
function SslAbiLayout: string;
function SslCapabilities: TPdfSslCapabilities;
function SslVerifyOptionsDiagnostics(const Options: TPdfCmsVerifyOptions): TPdfSslVerifyDiagnostics;
procedure ConfigureSslTrustAnchors(const Anchors: TPadesChainCertArray);
procedure ConfigureSslCrls(const Crls: TPadesChainCertArray);
procedure ConfigureSslOcspResponses(const Responses: TPadesChainCertArray);
function ConfigureSslCmsVerifier: IPdfCmsVerifier;
procedure ConfigureSslSigningCredentials(const PrivateKeyPem,
  SignerCertificateDer: TBytes; const ChainCertificateDer:
  TPadesChainCertArray; const Password: AnsiString = '');
function SslSigningAvailable: Boolean;
function SslSha3SigningAvailable: Boolean;
function ResolveSslSigner(const Options: TPadesSignerOptions): TPadesResolvedSigner;
function ResolveSslSignerForDigest(const Options: TPadesSignerOptions;
  DigestAlgorithm: TCmsDigestAlgorithm): TPadesResolvedSigner;

FPdfCryptoHttp retrieval transport

  CryptoHttpMaxResponseBytes = 1024*1024;
  CryptoHttpMaxTotalBytes = 4*1024*1024;
  CryptoHttpMaxRequests = 8;
  CryptoHttpMaxUrlLength = 2048;
  CryptoHttpDefaultTimeoutMs = 30000;

  TPdfLdapTlsMode = (pltDisabled, pltLdaps, pltStartTls);
  TPdfLdapTlsStatus = (pltsNotRequested, pltsUnavailable, pltsPolicyRejected, pltsHandshakeFailed, pltsActive);
  TPdfLdapTlsOptions = record
    Mode: TPdfLdapTlsMode;
    CaCertificateFile: string;
    class function Default: TPdfLdapTlsOptions; static;
  end;
  TPdfCryptoFetchSession = class
  public
    constructor Create(TimeoutMs: Cardinal); overload;
    constructor Create(TimeoutMs: Cardinal; const LdapTlsOptions: TPdfLdapTlsOptions); overload;
    constructor Create(TimeoutMs: Cardinal; const LdapTlsOptions: TPdfLdapTlsOptions; Policy: TPdfCryptoRetrievalPolicy; const AllowedOrigins: TPdfCryptoRetrievalOrigins); overload;
    property LastLdapTlsStatus: TPdfLdapTlsStatus read FLastLdapTlsStatus;
    function RemainingMs: Cardinal;
    function Fetch(const Url: string; out Data: TBytes): Boolean;
  end;

function CryptoHttpAvailable: Boolean;
function CryptoLdapAvailable: Boolean;
function CryptoLdapTlsAvailable: Boolean;

Description

FPdfCryptoSsl is the OpenSSL CMS verification backend consumed by FPdfCrypto, the counterpart of what FPdfCryptoWin provides on Windows. It verifies a CMS SignedData value against the signed content, resolves the signer certificate and evaluates the certificate chain against the OpenSSL system store extended with whatever trust anchors and CRLs the caller has configured

libcrypto is bound at run time by name rather than linked, which keeps the dependency optional and lets the unit compile on every target. ConfigureSslLibraryPath overrides the library that is loaded; passing an empty path restores the built-in candidate list for the platform

Free Pascal loads native libraries through its own loader, Windows Delphi through the Windows loader, and POSIX Delphi through dlopen and dlsym. Choose a real library built for the executable's OS and CPU. On macOS, applications can use this backend alongside the Keychain verifier, whose declared SHA-2 RSA-PSS profile is verified through native SecKey since v3.212.0

SslAvailable, SslMissingSymbols, SslLibraryPath, SslLibraryVersion and SslAbiLayout report the state of that binding, so an application can decide at startup whether CMS verification will be possible on this host and can log which library answered

SslCapabilities condenses what this backend implements into one TPdfSslCapabilities record, and SslVerifyOptionsDiagnostics reports before a verification runs which TPdfCmsVerifyOptions settings would have no effect here, as a TPdfSslVerifyDiagnostics set a caller can surface as warnings

Explicit DER evidence beyond the system store is supplied by ConfigureSslTrustAnchors, ConfigureSslCrls and ConfigureSslOcspResponses; ConfigureSslCmsVerifier installs the PAdES CMS verifier, raising EPdfSslError if OpenSSL is unavailable

TPdfSslCmsVerifier implements IPdfCmsVerifier. VerifyDetached joins the two byte ranges either side of the signature hole into one signed content stream, which is the shape a PDF signature takes; VerifyAttached covers a value that carries its own content, such as a timestamp token

Provide the key, certificate and optional chain through ConfigureSslSigningCredentials for ResolveSslSigner and the non-Windows default signing resolver; verification needs no signing credentials

ResolveSslSignerForDigest extends the same resolution to SHA-3: the resolved signer declares id-sha3-256, id-sha3-384 or id-sha3-512, pairs it with the matching sha3-256WithRSAEncryption or ecdsa-with-SHA3-* signature algorithm, signs the digest through EVP_PKEY_sign with the digest set to the EVP SHA-3 object, and describes the same digest in the RSASSA-PSS parameters with a salt equal to its output length. Because OpenSSL 3 provides these digests everywhere, this is what makes the ISO/TS 32001 algorithms usable outside Windows

FPdfCryptoHttp handles online retrieval: limited HTTP(S) transport for AIA intermediates, CRL distribution points and OCSP requests, plus Windows LDAP since v3.204.0 and optional FPC Unix OpenLDAP since v3.205.0; CryptoHttpAvailable and CryptoLdapAvailable report protocol-specific readiness, and TPdfCryptoFetchSession enforces the shared request, byte and time allowances per call, with its HTTP(S) fetches travelling over WinHttp on Windows and over the FPdfCryptoHttpCurl libcurl backend on Linux and macOS

Since v3.170.0, OCSP requests whose GET encoding exceeds the RFC 6960 A.1 practical URL limit submit the full serialised OCSPRequest through TPdfCryptoFetchSession.FetchPost as an HTTP POST body with the application/ocsp-request content type; shorter requests keep the GET form. LDAP retrieval supports binary certificates and CRLs on the declared Windows/FPC Unix backends, whilst OCSP remains an HTTP(S) operation. On Windows, the asynchronous request keeps its own POST data until WinHTTP has finished closing the request handle

Functions

FunctionDescription
ConfigureSslLibraryPathOverrides the libcrypto library the backend loads; call it before the first use, and pass an empty APath to restore the built-in candidate list for the platform
SslAvailableReturns True when libcrypto loaded and every required symbol resolved
SslMissingSymbolsReturns the names that failed to resolve, separated by spaces, or an empty string when everything bound; a non-empty result on a host that has libcrypto means the build is older than the API this unit targets
SslLibraryPathReturns the path of the library that loaded, or an empty string
SslLibraryVersionReturns the version string libcrypto reports, or an empty string
SslAbiLayoutReports the C type widths this build assumes, as ulong=<n> long=<n>; OpenSSL error-queue codes and store flags use a C unsigned long, whilst X509 verification errors use a C int
SslCapabilitiesReturns a TPdfSslCapabilities record describing the operations this backend implements; the flags describe implemented operations, not successful checks
SslVerifyOptionsDiagnosticsReturns, as a TPdfSslVerifyDiagnostics set, the option effects to expect from Options under this backend before verification runs; configured CRLs still need to decode, cover the chain and be current before revocation can be valid
ConfigureSslTrustAnchorsSupplies the trust anchors, as DER in Anchors, that chain evaluation adds to the system store; an empty array leaves the evaluation with the system store alone
ConfigureSslCrlsSupplies DER CRLs for revocation checks; authenticated OCSP evidence may cover gaps in CRL coverage
ConfigureSslOcspResponsesCopies at most 8 DER responses, up to 1 MiB each and 4 MiB altogether, for native authentication during checks; an empty array removes the configuration
ConfigureSslSigningCredentialsChecks and copies a PEM key, matching DER certificate, optional DER chain and optional encrypted-PEM password; empty key, certificate and chain clear credentials, but an invalid replacement leaves previous configuration intact
SslSigningAvailableTrue requires both optional signing symbols and explicitly configured credentials to be available
ResolveSslSignerFor Options, resolves an ICmsSigner, matching certificate and configured chain; a certificate thumbprint must be empty because configuration has already selected the certificate
SslSha3SigningAvailableTrue when plain signing is available and the loaded libcrypto also exposes EVP_sha3_256, EVP_sha3_384 and EVP_sha3_512, which OpenSSL 3 carries on every platform, so a caller can offer the ISO/TS 32001 digests only where a signature can actually be produced
ResolveSslSignerForDigestReturns the same triple for a chosen TCmsDigestAlgorithm. SHA-256 forwards to ResolveSslSigner, so a caller that never asked for SHA-3 sees no change; a SHA-3 member produces a signer that declares the matching digestAlgorithm and signature algorithm, signs the matching digest length and sizes the RSA-PSS salt to the digest. The call raises EPadesCrypto when the loaded library lacks the digest entry points rather than quietly signing with SHA-256
ConfigureSslCmsVerifierBuilds an OpenSSL verifier and installs it as the CMS verification backend, returning it as an IPdfCmsVerifier
CryptoHttpAvailableReports HTTP(S) readiness: always True on supported Windows hosts using WinHTTP, and elsewhere only when FPdfCryptoHttpCurl can bind a suitable libcurl; False does not rule out independent LDAP retrieval since v3.205.0
CryptoLdapAvailableReports LDAP readiness: True for the Windows system client, or for FPC Unix after the optional OpenLDAP library and every required API export bind successfully; otherwise False. The initial Unix binding result is cached, so installing a dependency after a failed first query requires a new process. Readiness does not certify a server, a platform profile or any verification outcome

Types

TypeMembers and purpose
EPdfSslErrorException raised by ConfigureSslCmsVerifier when OpenSSL is not available; the message carries the unresolved names reported by SslMissingSymbols
TPdfSslCapabilitiesAvailable, DetachedVerification, AttachedVerification, SystemTrustStore, CustomTrustAnchors, LocalCrls and ChainCertificateCollection describe core verification operations; OnlineRetrieval and RetrievalTimeout additionally require at least one available HTTP(S) or LDAP transport, and RevocationDiagnostics requires the optional native error-capture bindings. SignerDiagnostics and RevocationCertificateCollection describe diagnostics; Signing describes optional symbols regardless of configured credentials, and OcspVerification describes optional native OCSP symbols. These capabilities are not proof of successful verification
TPdfSslVerifyDiagnosticpsvdBackendUnavailable, psvdOnlineRetrievalIgnored, psvdRetrievalTimeoutIgnored or psvdNoCrlsConfigured
TPdfSslVerifyDiagnosticsSet of TPdfSslVerifyDiagnostic values returned by SslVerifyOptionsDiagnostics
TPdfSslCmsVerifierCMS verification through OpenSSL, implementing IPdfCmsVerifier with BackendName, VerifyDetached and VerifyAttached
TPdfCryptoFetchSessionOne retrieval call's HTTP(S) and supported-platform LDAP transport session from FPdfCryptoHttp; it owns the shared deadline, the request counter, the cumulative byte budget and per-session URL deduplication, and its Create, Destroy, RemainingMs and Fetch members are described under Retrieval transport

Methods

MethodDescription
BackendNameReturns OpenSSL, the name under which this backend identifies itself in validation results
VerifyDetachedVerifies the detached CMS value in CmsDer against the content described by Segment1 / Segment1Length and Segment2 / Segment2Length, honouring Options, and returns signature, trust, revocation status and revocation diagnostics in a TPdfCmsVerifyResult
VerifyAttachedVerifies an attached CMS value in CmsDer, whose signed content travels inside the structure, using Options

Retrieval transport

FPdfCryptoHttp implements HTTP(S) and supported-platform LDAP retrieval behind OnlineRetrieval. One TPdfCryptoFetchSession instance spans one verification call, and every fetch it performs draws from the same deadline, request allowance and byte budget

RetrievalPolicy defaults to pcrpAllowedOrigins. Set AllowedRetrievalOrigins to trusted origins such as https://pki.example.com or ldap://directory.example.com:389. Matching uses the scheme, host and effective port. Entries omit paths and queries. An empty list denies retrieval, including where OnlineRetrieval is enabled. Direct sessions use the same policy through the four-argument constructor. pcrpUnrestricted explicitly restores retrieval from document-selected origins

Allowlisted names use the transport resolver, so configure names whose DNS you trust. Select pcrpAllowedIpOrigins to require canonical dotted-quad IPv4 or bracketed IPv6 literals in both the origin list and the requested URL. Equivalent IPv6 spellings match by address bytes. Scoped IPv6 literals are rejected. This policy binds the request to the listed address and port without resolving a host name. Use an IP subject alternative name for TLS endpoints. Restricted HTTPS on Windows needs support for configuring local-only transport certificate-chain retrieval

WinHTTP and FPC Unix builds with libcurl support pcrpPinnedHttpOrigins. Use entries such as https://pki.example.com=192.0.2.10 or https://pki.example.com=2001:db8::10. The address on the right is an unbracketed IPv4 or IPv6 literal. The connection uses that address and the origin port, whilst HTTP and TLS retain the request hostname. Each origin can appear once. WinHTTP needs support for its per-request hostname resolution override and rejects the request where the override cannot be set

pcrpPinnedOrigins also accepts LDAP and LDAPS origins in the same format. On Windows and FPC Linux, macOS, FreeBSD, NetBSD, DragonFly BSD and OpenBSD, a pinned LDAPS or StartTLS connection goes directly to the configured IPv4 or IPv6 address and verifies the certificate chain and the original origin name before sending a bind or a search. FPC Unix pinning with TLS requires an OpenLDAP library with ldap_init_fd and TLS entry points. On macOS, set PDFIUMPAS_OPENLDAP_LIBRARY to the absolute path of a compatible dylib before the first LDAP call. The macOS system LDAP binding supports plain LDAP for pinned origins. Unix pinned TLS requires a DNS name other than localhost, because some OpenLDAP backends substitute the machine name. Other Unix builds can use numeric LDAP origins through pcrpAllowedIpOrigins

MethodDescription
CreateStarts the session deadline; a TimeoutMs of zero selects CryptoHttpDefaultTimeoutMs, and the value is clamped to the range of Cardinal
RemainingMsReturns the milliseconds left on the shared deadline; fetches stop once it reaches zero
FetchDownloads Url into Data, requiring a nonempty HTTP 200 response body or a successful supported-platform LDAP search with one binary value and a successful terminal result; URLs must fit CryptoHttpMaxUrlLength and the remaining budgets, exclude user information, and use http, https or the bounded ldap profile below; repeated URLs return False without consuming another request
ConstantValueMeaning
CryptoHttpMaxRequests8Maximum fetch attempts one session accepts
CryptoHttpMaxResponseBytes1048576Maximum accepted size of a single response
CryptoHttpMaxTotalBytes4194304Maximum cumulative accepted response bodies per session
CryptoHttpMaxUrlLength2048Maximum URL length the parser accepts
CryptoHttpDefaultTimeoutMs30000Session deadline used when Create receives zero

Revocation results

Signature integrity, chain trust and CRL verification run in separate passes. A revoked certificate does not alter a valid SignatureStatus nor the independently computed TrustStatus

Basic X509 chain checks select X509_PURPOSE_ANY instead of presuming an S/MIME signer, so a TSA certificate with critical id-kp-timeStamping usage can have its own chain evaluated. Chain validity alone establishes neither an application-specific role nor revocation status; PAdES timestamp checks separately require the RFC 3161 role and report it in TimeStampTrustStatus

Only a failed CRL pass following successful chain trust and reporting X509_V_ERR_CERT_REVOKED (23) yields RevocationStatus = pcvsInvalid with RevocationReason = pcrrCertificateRevoked

Expired or future CRLs, missing chain coverage, bad CRL signatures and other unusable CRL evidence give pcvsIndeterminate when the CRL pass fails, with pcrrCrlExpired, pcrrCrlNotYetValid, pcrrCrlUnavailable, pcrrCrlSignatureInvalid, pcrrCrlInvalid or pcrrUnknown as appropriate. Where CRL checking is enabled but the preceding trust pass has failed, the result is pcvsIndeterminate with pcrrChainUntrusted

RevocationError carries the captured X509 verification error, or zero when no native diagnostic is available. Without the optional diagnostic bindings, failed CRL checks keep pcvsIndeterminate with pcrrUnknown and zero; basic CMS verification remains available

A successful CRL pass returns pcvsValid with pcrrNone and zero. The reason and error on their own never prove success; inspect RevocationStatus

CMS verification stops at the first failing signer or chain condition, so the captured reason is not a complete list of errors across every signer. The diagnostic callback preserves OpenSSL's rejection decisions

With several signers, the statuses describe the aggregate CMS verification whilst SignerCertificate holds only the first signer certificate in the CMS structure. A revocation diagnostic may belong to a later signer or an issuing CA; do not attribute it automatically to SignerCertificate

A CRL listing a revoked serial must still pass its time and signature checks. An expired CRL yields an indeterminate expiry result rather than establishing current revocation from its serial list

These diagnostics are available directly from IPdfCmsVerifier.VerifyDetached or VerifyAttached. PAdES trust validation likewise preserves the signature's RevocationReason and NativeRevocationError independently of TimeStampRevocationReason and NativeTimeStampRevocationError; the evidence JSON and CSV export both pairs and the independent timestamp statuses

Remarks

AIA certificate bundles

Since v3.213.0, OpenSSL AIA caIssuers responses may contain one DER X.509 certificate or a DER PKCS#7 certificates-only SignedData message with version 1, empty digestAlgorithms and signerInfos, absent id-data content, and 1 to 32 ordinary X.509 certificates. PEM, BER indefinite lengths, CRLs, attribute certificates, signed payloads, malformed certificates and trailing bytes are rejected

Every candidate is decoded before any certificate from that response is added. Duplicate certificates are counted once towards the 64-certificate untrusted-set limit, whilst the per-message 32-record limit also counts duplicates. Retrieved certificates never enter the trust-anchor store; OpenSSL still independently builds and validates each chain against configured or system anchors

Bundle retrieval shares the existing eight-request, 1 MiB response, 4 MiB total-body and elapsed-time budgets. The bounded DER scan permits at most 32 nesting levels and 32768 nodes; these accepted-data limits do not cap native parser allocations. A later offline call cannot reuse the downloaded candidates. Focused execution covers Delphi Win64 with the recorded OpenSSL 3 library

Opt-in LDAP TLS since v3.217.0

TPdfLdapTlsOptions.Default sets Mode=pltDisabled and an empty CaCertificateFile, preserving plain anonymous LDAP behaviour and rejecting ldaps URLs. Use pltLdaps with ldaps URLs (default port 636), or pltStartTls with ldap URLs (default port 389); a mismatched scheme or CA file with disabled TLS returns pltsPolicyRejected before connecting

Pass the record and the origin policy to TPdfCryptoFetchSession.Create for direct retrieval, or pass the TLS record to TPdfSslCmsVerifier.Create(LdapTlsOptions) for CMS AIA/CRL retrieval. The parameterless verifier constructor and the existing factory retain disabled LDAP TLS. Configure the CMS origin policy in TPdfCmsVerifyOptions and enable OnlineRetrieval to fetch evidence

CryptoLdapTlsAvailable reports native Windows LDAPS support since v3.253.0, native Windows StartTLS since v3.261.0 and optional TLS exports on FPC Linux. Windows Delphi/FPC Win64 uses wldap32, Schannel, Crypt32 and Winsock without an additional TLS DLL; Linux uses OpenLDAP and its OpenSSL backend. Darwin and Delphi Unix TLS remain unavailable. Missing Linux TLS exports do not disable plain LDAP readiness

Each supported TLS connection requires a valid peer chain and matching subjectAltName, refuses CN-only fallback, requires TLS 1.2 or later before anonymous bind/search and refuses ambient client credentials. Linux clears inherited client certificates and validation callbacks and creates a private client TLS context. A nonempty CaCertificateFile supplies the transport CA bundle and clears inherited CA directories; an empty path uses the native system CA defaults. Transport CAs never become CMS trust anchors. No certificate-validation bypass or authenticated binding is provided

StartTLS must succeed before anonymous bind/search; rejection, certificate failure, unexpected plaintext or timeout never falls back to a plain connection. TLS handshakes and subsequent LDAP waits receive the remaining shared deadline. Native DNS, trust-file processing and parser allocations are not universally interruptible or independently memory-bounded

Windows StartTLS connects without binding, installs the same private trust and certificate callbacks as LDAPS, then calls the native upgrade operation and rechecks verified negotiated transport before bind/search

Native Windows LDAP TLS sessions queue within the process because concurrent native StartTLS operations can fail or disrupt later retrieval; queue wait consumes the same session deadline, whilst trust remains per connection

The native upgrade has a longer built-in timeout, so a per-connection watchdog shuts down its socket at the remaining session deadline; the owner joins that watchdog before releasing the LDAP handle, and no other session or global trust setting is changed

LastLdapTlsStatus reports the last parsed LDAP fetch: pltsNotRequested before negotiation or for plain retrieval, pltsUnavailable for an absent backend, pltsPolicyRejected for incompatible or unapplied policy, pltsHandshakeFailed for failed establishment, or pltsActive after verified TLS establishment. Active TLS does not imply a successful search, certificate trust for CMS, or a good revocation verdict; HTTP calls do not reset this LDAP-specific status

Windows validates the presented chain, serverAuth usage, digitalSignature when KeyUsage exists, certificate dates and an explicit matching DNS/IP subjectAltName. Explicit PEM roots use an exclusive in-memory chain engine and never modify OS stores or become CMS trust anchors; an empty CA path selects system transport trust. Chain building uses only cached or presented additional certificates and does not start a second network retrieval. Per-connection root sets remain independent under concurrent requests

Windows strong-crypto policy is supplemented by checking negotiated TLS 1.2/1.3 and at least 128-bit cipher strength before any anonymous LDAP bind. A legacy peer can complete a rejected transport handshake without receiving LDAP credentials or requests. Windows native connect timeouts can have coarse granularity; subsecond availability is not promised. pltsActive describes locally verified transport and can remain set when the peer subsequently rejects a missing client certificate; the fetch still fails without a payload

Linux temporarily blocks SIGPIPE in the calling thread throughout native TLS operations and cleanup, drains only a newly generated signal when the caller had not blocked it, and restores the previous mask without replacing the process handler or consuming a pre-existing pending signal

LDAP retrieval

Since v3.204.0, Fetch uses the Windows wldap32.dll client for ldap:// certificate and CRL URLs with an explicit DNS/IPv4 host, a nonempty distinguished name, one recognised binary attribute, and an omitted or base search scope. An omitted filter uses (objectClass=*); percent-encoded UTF-8 names and filters are decoded without accepting embedded NUL or malformed UTF-8

Since v3.205.0, FPC Unix uses an optional OpenLDAP backend with the same URL, value and publication rules; Linux, FreeBSD, NetBSD and DragonFly BSD look for libldap.so.2, libldap-2.5.so.0 or libldap-2.4.so.2. NetBSD first tries the pkgsrc path /usr/pkg/lib/libldap.so. OpenBSD resolves libldap.so to the installed versioned OpenLDAP library. The Darwin binding first tries the absolute dylib path in PDFIUMPAS_OPENLDAP_LIBRARY where that is set, and otherwise uses /usr/lib/libldap.dylib or libldap.dylib. On macOS, the connection callback sets SO_NOSIGPIPE on each LDAP socket, so a write failure returns a transport error and the caller’s signal settings stay as they were. Missing libraries or required exports return unavailable without replacing the HTTP backend. Focused execution covers WSL Linux x64, physical Ubuntu x64 and physical Mac ARM64 with FPC 3.3.1; the two physical hosts pass 91 main assertions each, and the Linux missing-export/no-libcurl controls remain separate from the Darwin profile. The Mac loader resolves the logical dylib through the system dyld cache to LDAP.framework; its loaded Mach-O UUID and OS identity are recorded when no standalone dylib file exists. These profiles do not qualify another Unix compiler or unexecuted architecture

Recognised attributes are cACertificate;binary, userCertificate;binary, certificateRevocationList;binary, authorityRevocationList;binary and deltaRevocationList;binary. The syntax follows the certificate retrieval use of RFC 4516 and RFC 5280 within this explicit subset

The client binds anonymously with empty credentials, disables referrals, alias dereferencing, automatic reconnect and credential prompts, and requests one entry and one attribute. Publication requires exactly one nonempty value, a successful terminal search result and a live deadline; multiple entries/values, referrals and partial/error results leave Data empty

LDAP shares the existing eight-request, 1 MiB value and 4 MiB cumulative payload limits with HTTP(S), and native connection/result waits receive the remaining session timeout. Value limits are checked after native LDAP decoding and do not bound the native parser's internal allocations or promise interruption of every internal DNS operation

Authenticated binds, IPv6 literals, non-base searches and URL extensions remain outside this profile; the opt-in FPC Linux TLS extension is described below. Retrieved certificates remain untrusted chain material and downloaded CRLs still require independent signature, issuer and validity checks

Supplying signing credentials

Supply a PEM key and matching DER certificate explicitly; each key or certificate may be 4 MiB, the chain 64 certificates, combined key/certificate/chain input 16 MiB and the encrypted-PEM password 1024 bytes. Certificates need complete DER without trailing data; mismatched keys, unsupported types or invalid passwords refuse replacement while preserving prior configuration

Pass Password as AnsiString bytes; no standard-input prompt is issued, and unencrypted PEM keys can use an empty password

Default RSA signing uses SHA-256 with RSA-PSS, SHA-256 for MGF1 and a 32-byte salt. Unrestricted RSA keys can use PKCS#1 v1.5; restricted RSA-PSS keys reject PKCS#1 v1.5. EC keys produce ECDSA in the DER signature format CMS expects

TPdfSslCapabilities.Signing describes optional signing bindings; SslSigningAvailable also requires credentials. Resolved signers keep native keys alive, so release their interfaces before changing or unloading libcrypto

Using and retrieving OCSP evidence

OpenSSL authenticates OCSP responder signatures, issuer or delegated authority, certificate identifiers and response times. All non-anchor certificates in each signer chain need a positive status, whilst anchors are exempt; a good leaf response does not cover an unchecked intermediate

Enabling online retrieval alone does not trigger OCSP verification. If no configured or retrieved OCSP response is examined and no responder URL is requested, the preceding CRL status, reason, native error and affected certificate are retained. Once an OCSP attempt takes place, it can replace that verdict with an authenticated result or an indeterminate OCSP diagnostic

Before native authentication, FPdfCryptoOcsp checks freshness within resource limits; 300 seconds of skew is allowed, producedAt and thisUpdate must be no more than one day old, and any supplied nextUpdate must remain valid. This filtering does not authenticate responses

Online OCSP constructs an RFC 5019 GET URL from the encoded request, without nonce or POST fallback; OCSP, AIA and CRL share 8 requests, 1 MiB per response, 4 MiB total response bodies and the elapsed-time allowance, with redirects disabled

Evidence fetched for aggregate verification is reused in the same call's offline signer diagnostics, which send no extra requests; an exhausted deadline or absent response leaves the affected snapshot indeterminate instead of positively checked

Ordinary CMS checks can remain available when optional signing or OCSP symbols are absent; inspect SslCapabilities.OcspVerification and RevocationStatus, rather than taking configuration or pcrrNone as success

Individual signer results

CollectSignerDiagnostics returns limited offline SignerResults in encoded SignerInfo order, each with independent signature, trust and revocation results; collection allows 64 signers, 4 MiB CMS input and 64 MiB of accumulated diagnostic input/output work

SignerDiagnosticsStatus=pcvsValid means collection finished, including invalid results, not that signatures passed; read each snapshot's statuses and errors. RevocationCertificate identifies a captured failing certificate, possibly an intermediate, separately from SignerCertificate

See Also

FPdfCrypto, FPdfCryptoWin, FPdfCryptoOcsp, FPdfCms, TPdf.ValidatePadesTrust