Discuss this help topic in SecureBlackbox Forum

Validate timestamp over data

This article explains how to validate an RFC5544-compliant timestamp made over a piece of arbitrary, unsigned data. If you are looking for information about validating timestamped digital signatures (CMS or CAdES), please consider this article instead.

SecureBlackbox offers TElMessageTimestampVerifier component (SBMessages class) for validating RFC5544-based timestamped messages. To perform validation:

  1. Create an instance of TElMessageTimestampVerifier: TElMessageTimestampVerifier verifier = new TElMessageTimestampVerifier();
  2. Pass the timestamped message to Verify() (if verifying an enveloping/non-detached message) or VerifyDetached() (if verifying a detached message). You can find out whether a particular message is detached using the IsTimestampDetached() method.
    int res = verifier.Verify(timestampedMessageStream, extractedContentStream); // for enveloping messages; the content will be extracted to extractedContentStream
    int res = verifier.VerifyDetached(timestampedMessageStream, contentStream); // for detached messages; provide the content in contentStream
    Always check the return value of the Verify() methods. The return value of 0 indicates success; any non-zero value reports a failure, and indicates the corresponding error code.
When validation is completed, you can access individual timestamps via the Timestamps[] property of the verifier component. You can also extract auxiliary details such as the original name of the timestamped file and its media type (if included by the timestamping party).

How To articles about PKCS7 signing and encryption

Discuss this help topic in SecureBlackbox Forum