inherits from Exception
(no public members)
(no public members)
(no public members)
(no public members)
(no public members)
(no public members)
inherits from tASN1CustomStruct
tTspAlgorithmIdentifier AlgorithmIdentifier ::= SEQUENCE {
algorithm OBJECT IDENTIFIER, parameters NULL OPTIONAL The digest AlgorithmIdentifier of a MessageImprint (absent or NULL parameters; RFC 5816 prefers absent for the SHA-2 family).
(no public members)
inherits from iASN1CustomStruct
iMessageImprint / tMessageImprint MessageImprint ::= SEQUENCE { hashAlgorithm AlgorithmIdentifier, hashedMessage OCTET STRING The digest of the data being time-stamped (RFC 3161 2.4.1).
function get_hashAlgorithm: ObjectIdentifier;
function get_hashedMessage: OctetString;
procedure set_hashAlgorithm(const aValue: ObjectIdentifier);
procedure set_hashedMessage(const aValue: OctetString);
property hashAlgorithm: ObjectIdentifier read get_hashAlgorithm write set_hashAlgorithm;
property hashedMessage: OctetString read get_hashedMessage write set_hashedMessage;
inherits from tASN1CustomStruct
implements iMessageImprint
property hashAlgorithm: ObjectIdentifier read get_hashAlgorithm write set_hashAlgorithm;
property hashedMessage: OctetString read get_hashedMessage write set_hashedMessage;
inherits from iASN1CustomStruct
iTimeStampReq / tTimeStampReq TimeStampReq ::= SEQUENCE {
version INTEGER { v1(1) }, messageImprint MessageImprint,
reqPolicy TSAPolicyId OPTIONAL,
nonce INTEGER OPTIONAL,
certReq BOOLEAN DEFAULT FALSE,
extensions [0] IMPLICIT Extensions OPTIONAL The request that is DER encoded and posted to the TSA (RFC 3161 2.4.1).
function get_version: Integer;
function get_messageImprint: iMessageImprint;
function get_hasNonce: Boolean;
function get_nonce: OctetString;
function get_certReq: Boolean;
property version: Integer read get_version;
property messageImprint: iMessageImprint read get_messageImprint;
property hasNonce: Boolean read get_hasNonce;
property nonce: OctetString read get_nonce;
property certReq: Boolean read get_certReq;
inherits from tASN1CustomStruct
implements iTimeStampReq
property version: Integer read get_version;
property messageImprint: iMessageImprint read get_messageImprint;
property hasNonce: Boolean read get_hasNonce;
property nonce: OctetString read get_nonce;
property certReq: Boolean read get_certReq;
inherits from tASN1CustomOFStruct
tPKIFreeText PKIFreeText ::= SEQUENCE SIZE (1..MAX) OF UTF8String
(no public members)
inherits from iASN1CustomStruct
iPKIStatusInfo / tPKIStatusInfo PKIStatusInfo ::= SEQUENCE {
status PKIStatus, statusString PKIFreeText OPTIONAL,
failInfo PKIFailureInfo OPTIONAL The TSA verdict; see the cPKIStatus* constants (RFC 3161 2.4.2).
function get_status: Integer;
function get_statusText: string;
function get_hasFailInfo: Boolean;
function get_failInfo: OctetString;
property status: Integer read get_status;
property statusText: string read get_statusText;
property hasFailInfo: Boolean read get_hasFailInfo;
property failInfo: OctetString read get_failInfo;
inherits from tASN1CustomStruct
implements iPKIStatusInfo
property status: Integer read get_status;
property statusText: string read get_statusText;
property hasFailInfo: Boolean read get_hasFailInfo;
property failInfo: OctetString read get_failInfo;
inherits from iASN1CustomStruct
iTimeStampResp / tTimeStampResp TimeStampResp ::= SEQUENCE {
status PKIStatusInfo, timeStampToken TimeStampToken OPTIONAL where TimeStampToken ::= ContentInfo (a CMS SignedData whose eContent is a TSTInfo). The token is decoded with the StreamSec.DSI.CMS classes.
function get_status: iPKIStatusInfo;
function get_hasToken: Boolean;
function get_token: iContentInfo;
property status: iPKIStatusInfo read get_status;
property hasToken: Boolean read get_hasToken;
property token: iContentInfo read get_token;
inherits from tASN1CustomStruct
implements iTimeStampResp
property status: iPKIStatusInfo read get_status;
property hasToken: Boolean read get_hasToken;
property token: iContentInfo read get_token;
inherits from tASN1CustomStruct
tAccuracy Accuracy ::= SEQUENCE { seconds INTEGER OPTIONAL,
millis [0] IMPLICIT INTEGER (1..999) OPTIONAL,
micros [1] IMPLICIT INTEGER (1..999) OPTIONAL
(no public members)
inherits from iASN1CustomStruct
iTSTInfo / tTSTInfo TSTInfo ::= SEQUENCE {
version INTEGER { v1(1) },
policy TSAPolicyId, messageImprint MessageImprint,
serialNumber INTEGER,
genTime GeneralizedTime,
accuracy Accuracy OPTIONAL,
ordering BOOLEAN DEFAULT FALSE,
nonce INTEGER OPTIONAL,
tsa [0] GeneralName OPTIONAL,
extensions [1] IMPLICIT Extensions OPTIONAL The signed payload of a time-stamp token (RFC 3161 2.4.2). The tsa field is encoded explicitly because GeneralName is a CHOICE.
function get_version: Integer;
function get_policy: ObjectIdentifier;
function get_messageImprint: iMessageImprint;
function get_serialNumber: OctetString;
function get_genTime: TDateTime;
function get_hasAccuracy: Boolean;
function get_accuracySeconds: Integer;
function get_accuracyMillis: Integer;
function get_accuracyMicros: Integer;
function get_ordering: Boolean;
function get_hasNonce: Boolean;
function get_nonce: OctetString;
property version: Integer read get_version;
property policy: ObjectIdentifier read get_policy;
property messageImprint: iMessageImprint read get_messageImprint;
property serialNumber: OctetString read get_serialNumber;
property genTime: TDateTime read get_genTime;
property hasAccuracy: Boolean read get_hasAccuracy;
property accuracySeconds: Integer read get_accuracySeconds;
property accuracyMillis: Integer read get_accuracyMillis;
property accuracyMicros: Integer read get_accuracyMicros;
property ordering: Boolean read get_ordering;
property hasNonce: Boolean read get_hasNonce;
property nonce: OctetString read get_nonce;
inherits from tASN1CustomStruct
implements iTSTInfo
property version: Integer read get_version;
property policy: ObjectIdentifier read get_policy;
property messageImprint: iMessageImprint read get_messageImprint;
property serialNumber: OctetString read get_serialNumber;
property genTime: TDateTime read get_genTime;
property hasAccuracy: Boolean read get_hasAccuracy;
property accuracySeconds: Integer read get_accuracySeconds;
property accuracyMillis: Integer read get_accuracyMillis;
property accuracyMicros: Integer read get_accuracyMicros;
property ordering: Boolean read get_ordering;
property hasNonce: Boolean read get_hasNonce;
property nonce: OctetString read get_nonce;
inherits from TComponent
TstTimeStampClient
RFC 3161 time-stamp client. Configure TsaURL (plus HashAlgorithm / Nonce / RequestCertificates / PolicyOID as needed), then call RequestTimeStamp with the data to stamp - for a CMS signature time-stamp that is the SignerInfo signature value, which AddSignatureTimeStamp does for you. The returned token has already passed the full verification described in the unit header; the TSA certificate is in LastTsaCertificate for the caller's trust decision. VerifyToken / VerifyTokenDigest re-verify a stored token without any network exchange (nonce and clock-skew checks do not apply there - a stored token is historical).
constructor Create(aOwner: TComponent); override;
function RequestTimeStamp(const aData : OctetString; out aToken: iContentInfo): Boolean;
function RequestTimeStampDigest(const aDigest : OctetString; aDigestAlg: tHashAlgorithm; out aToken : iContentInfo): Boolean;
function VerifyToken(const aToken: iContentInfo; const aData : OctetString; out aInfo : iTSTInfo): Boolean;
function VerifyTokenDigest(const aToken : iContentInfo; const aDigest : OctetString; aDigestAlg: tHashAlgorithm; out aInfo : iTSTInfo): Boolean;
property LastError: string read fLastError;
property LastStatus: Integer read fLastStatus;
property LastStatusText: string read fLastStatusText;
property LastGenTime: TDateTime read fLastGenTime;
property LastTsaCertificate: iCertificate read fLastTsaCertificate;
property LastTokenDER: OctetString read fLastTokenDER;
property TsaURL: string read fTsaURL write fTsaURL;
property Timeout: Cardinal read fTimeout write fTimeout default 15000;
property HashAlgorithm: tHashAlgorithm read fHashAlgorithm write fHashAlgorithm default haSHA256;
property Nonce: Boolean read fNonce write fNonce default True;
property NonceLength: Integer read fNonceLength write fNonceLength default 8;
property RequestCertificates: Boolean read fRequestCertificates write fRequestCertificates default True;
property PolicyOID: string read fPolicyOID write fPolicyOID;
property TsaCertificate: iCertificate read fTsaCertificate write fTsaCertificate;
property MaxClockSkew: Cardinal read fMaxClockSkew write fMaxClockSkew default 300;
property ExtKeyUsagePolicy: tExtKeyUsagePolicy read fExtKeyUsagePolicy write fExtKeyUsagePolicy default ekupAllowUnconstrained;