AddArchiveTimestamp
function AddArchiveTimestamp(aSource, aDest: TStream; const aTsaURL: string; out aError: string; aSignerIndex: Integer = 0; aHashAlg: tHashAlgorithm = haSHA256; const aContentDigest: OctetString = ''): Boolean;
AddArchiveTimestamp raises a signature to CAdES B-LTA by attaching an archive-time-stamp-v3. aTsaURL must name an RFC 3161 TSA.
Order is forced by a data dependency, not convention: the ATSHashIndexV3 is built over the SignedData as it stands, its exact octets become element E9 of the imprint, the TSA stamps that imprint, and only then is the index injected into the returned token. So the SignedData must be COMPLETE - run ExtendToLT first - because anything added afterwards is outside this timestamp.
aContentDigest is required only for a detached signature (the digest of the external document under aHashAlg); pass '' otherwise.