TPLDERArray

Security and signatures

Description

TPLDERArray is a dynamic array of AnsiString in which every element is one complete DER object held byte for byte. AnsiString is deliberate: the elements are binary, and a UnicodeString round trip through the string list machinery would change them.

CMS and certificate helpers use it as their output container. PLExtractCMSCertificates fills it with the embedded certificate set in encoding order, the chain builder returns a leaf-first path, and timestamp and revocation helpers hand back tokens, OCSP certificates and DER names. Duplicates are not removed and the order is whatever the source produced.

Syntax

Delphi

TPLDERArray = Array Of AnsiString;

Remarks

Helpers that fill the array return the element count separately; a result of 0 with an empty array means nothing usable was found, including a malformed input.

Index 0 is the first element and High is Length - 1. An unassigned variable is nil, which the helpers treat exactly like an empty array.

Elements are not validated on insertion. Each one should be a single DER SEQUENCE that spans the whole element to be a certificate, CRL or OCSP response; an element that is only a parseable prefix is not useful downstream.

The array is compiler-managed: assign it, pass it as const or out, and never free elements individually or keep an element pointer past the next SetLength.

Do not route these bytes through a TStringList or a WideString, even temporarily; that conversion is what the AnsiString element type avoids.

See also

PLExtractCMSCertificates, PLTrimCMSPadding, PLCheckCMSSignedDataStructure