SecureTime API Toolkit
Toolkit Home  

DgsTimeStampRequest


The DgsTimeStampRequest function is given a digital signature or data file, communicates with DigiStamp time stamp servers and returns a Time Stamp.  The Time Stamp is returned as a PKCS 7 encoded message.  The time stamp that includes the supplied hash and optional nonce. The time stamp service signs the hash with the current time and returns a signed CMS structure.  Requires MicroSoft CryptoAPI.

BOOL DgsTimeStampRequest(
  DGS_TIMESTAMP_PARA pSignPara,                 // in/out
  CRYPT_ALGORITHM_IDENTIFIER hashAlgorithmID,   // in
  LPSTR contentType,                            // in
  BYTE *content,                                // in
  DWORD cContent,                               // in
  DWORD dwIndex,                                // in
  LONG nonce,                                   // in
  BYTE *pbTimeStampBlob,                        // out
  DWORD *pcbTimeStampBlob,                      // out
  LPSTR time                                    // out
);

Parameters

pSignPara
Pointer to DGS_TIMESTAMP_PARA structure containing the time-stamp service parameters.
hashAlgorithmID
Identifier of the hash algorithm that will be used to create the hash of the content.  Current release supports only SHA-1 and no parameter.
contentType
OID of the content type.  Currently release supports only a PKCS 7 signed message 1.2.840.11359.1.7.2, the literals "DATA" and "NO DIGEST&quot. "DATA" indicates that the function should calculate the message digest of the content supplied. "NO DIGEST" indicates that the content is the result of the pre-executing the message digest function.
content
The contents to be time stamped. 
cContent
The size of the buffer that contains content
dwIndex
Index to the SignerInfo signature to be time stamped.  The parameter is applicable when contentType is a PCKS 7 signed message.  Current release supports only 0, the first signature in the set.
nonce
Optional random number to be included in the time stamp.  If supplied, process will confirm that the server response includes the nonce value. The current version of the C toolkit supports only up to a 4 byte number (the Java toolkit version support full 20 byte nonce.) This will be upgraded in the next release.
pbTimeStampBlob
The encoded time stamp token is a PKCS 7 message.
pcbTimeStampBlob
Pointer to a DWORD specifying the size, in bytes, of the pbTimeStampBlob buffer. When the function returns, this variable contains the size, in bytes, of the signed and encoded message.
This parameter can be NULL to set the size of this information for memory allocation purposes.  On output, the this parameter is updated to reflect the actual size of the data copied to the pbTimeStampBlob.
time
The time (GMT) that was included in the time stamp.  Returned a separate data item for convenience.  If not NULL then the memory size provided must be 20 and will be returned with a null terminator.

Return Values

If the function succeeds, the return value is nonzero (TRUE).

If the function fails, the return value is zero (FALSE).

This function call subordinate functions DgsTSHash., DgsTSResponse and DgsTsGetParam.   Error messages from these functions can also be returned.

Error code Description
DGS_ERROR_MORE_DATA If the buffer specified by the pbTimeStampBlob parameter is not large enough to hold the returned data, the function sets the ERROR_MORE_DATA code, and stores the required buffer size, in bytes, into the variable pointed to by pcbTimeStampBlob.
DGS_NOT_SUPPORTED Unsupported Hash Algorithm
DGS_CONTENT_TYPE Unsupported content type.
DGS_GET_SIG Unable to extract signature from input PCKS 7 signed message. A prerequisite to performing hash

 

  28 January, 2005

Home

  Feedback      Related Links   Contact Us   Mailing List    Privacy Statement
Copyright 2000-2005 DigiStamp, Inc.
All Rights Reserved
SecureTime, IPVault, IPProtector, and e-TimeStamp  are service marks of the DigiStamp, Inc.