TPDFlibTimeStampVerificationReport

Data types, security and signatures

Description

TPDFlibTimeStampVerificationReport is filled by the document timestamp and signature timestamp verification methods of TPDFlibSignatureVerifier, including the Ex variants that accept a revocation mode, an expected policy OID and an expected nonce.

Every check is reported in a separate field, so a caller can distinguish a broken token from a valid token whose TSA certificate is untrusted or whose revocation state stays unknown.

Syntax

Delphi

TPDFlibTimeStampVerificationReport = Record
  FieldName: WideString;
  Kind: TPDFlibTimeStampKind;
  SignerIndex: Integer;
  TimeStampIndex: Integer;
  SignerCount: Integer;
  Result: TPDFlibSignatureVerifierResult;
  TokenSignatureValid: Boolean;
  MessageImprintValid: Boolean;
  ExtendedKeyUsageValid: Boolean;
  TSANamePresent: Boolean;
  TSANameMatched: Boolean;
  PolicyOID: AnsiString;
  HashAlgorithmOID: AnsiString;
  SerialNumberHex: AnsiString;
  NonceHex: AnsiString;
  PolicyMatched: Boolean;
  NonceMatched: Boolean;
  GenerationTime: TDateTime;
  RevocationMode: TPDFlibSignatureRevocationMode;
  ChainResult: TPDFlibSignatureVerifierResult;
  TrustStatus: TPDFlibSignatureTrustStatus;
  NativeError: Cardinal;
  OCSPRequestSigningError: Cardinal;
  CRLSignerCheckedCount, CRLSignerGoodCount, CRLSignerRevokedCount, CRLSignerUnknownCount: Integer;
End;

Fields

FieldNameSignature field that carries the timestamp: the timestamp field itself for a document timestamp, the signed field for a signature timestamp
KindtskDocument for a document timestamp, tskSignature for a signature timestamp attribute, tskUnknown before the kind is set
SignerIndexZero-based CMS signer index requested by the caller
TimeStampIndexZero-based index among the signer's timestamp attributes; -1 for a document timestamp
SignerCountNumber of CMS signers in the token; a valid token has exactly one
ResultOverall result of the timestamp verification
TokenSignatureValidToken CMS signature verified, with one signer and the TSTInfo content type
MessageImprintValidHash computed over the covered bytes equals the token message imprint
ExtendedKeyUsageValidTSA certificate carries the id-kp-timeStamping extended key usage
TSANamePresentTSTInfo contains a TSA GeneralName
TSANameMatchedTSA name matches the signing certificate subject or subject alternative name; True when the token carries no name
PolicyOIDPolicy OID from the TSTInfo
HashAlgorithmOIDMessage-imprint hash algorithm OID from the TSTInfo
SerialNumberHexToken serial number as an uppercase hexadecimal string
NonceHexNonce from the TSTInfo as hexadecimal; empty when the token has none
PolicyMatchedTrue when no expected policy was supplied or it equals PolicyOID
NonceMatchedTrue when no expected nonce was supplied or it equals NonceHex
GenerationTimeTSA generation time (genTime) in UTC
RevocationModeRevocation mode used for the TSA certificate chain
ChainResultResult of the TSA certificate chain validation
TrustStatusTrust classification of the TSA chain
NativeErrorPlatform or native verification error code; 0 when no error was reported
OCSPRequestSigningErrorLocal error from signing an OCSP request; 0 when no signed request was configured
CRLSignerCheckedCountAuxiliary CRL signer evaluations completed
CRLSignerGoodCountAuxiliary CRL signers with authenticated good status
CRLSignerRevokedCountAuxiliary CRL signers with authenticated revocation
CRLSignerUnknownCountAuxiliary CRL signers whose status stayed unresolved

Remarks

TokenSignatureValid alone does not make the timestamp trustworthy: the imprint, extended key usage, TSA name, policy, nonce and chain fields each gate the final result.

GenerationTime is the TSA's claim. The verifier trusts it only as far as the TSA chain validates, either at the requested time or at the control time supplied by newer evidence during historical validation.

A token with more than one signer, or with an inner content type other than TSTInfo, fails before the timestamp fields are decoded.

The report is initialized before any decoding, so an early failure leaves FieldName, Kind and SignerIndex populated and the remaining fields at their defaults. The CRL signer counts are populated by the native route and stay zero on Windows.

See also

TPDFlibSignatureVerifier, VerifyDocumentTimeStampEx, VerifySignatureTimeStampEx, NativeTimeStampRevocation, TPDFlibSignatureVerifierResult