PLExtractCMSSignatureTimeStampTokens

Signature utilities

Description

Collects the signature-time-stamp attribute values of every signer in a CMS SignedData blob. The function walks each SignerInfo's unsigned attributes, matches the attribute OID 1.2.840.113549.1.9.16.2.14 (signature-time-stamp) and returns each attribute value that is a SEQUENCE as a raw DER blob.

Each returned blob is the CMS envelope that carries an RFC 3161 TimeStampToken; the timestamp payload itself is not validated by this reader. Tokens are gathered across all signers of the blob, so a multi-signer signature can yield several.

The walk reads structure only and verifies nothing; it uses the read-only PDFlibCMSRead unit available in every edition.

Syntax

Delphi

Function PLExtractCMSSignatureTimeStampTokens(Const CMSBytes: AnsiString;
  Out Tokens: TPLDERArray): Integer;

Parameters

CMSBytesOne complete binary DER ContentInfo containing SignedData
TokensReceives the DER-encoded timestamp token envelopes found in the signers' unsigned attributes

Return values

N > 0N timestamp token envelopes were copied into Tokens
0No signature-time-stamp attribute was found, or the blob is not a SignedData; Tokens is left empty

Remarks

This Pascal unit function has no separate DLL or ActiveX forwarding entry point.

See also

FetchTimeStampToken, ApplyPAdESSignatureTimeStamp, SetPAdESSignatureTimeStampToken, PLCheckCMSSignedDataStructure