SecureTime API Toolkit
Toolkit Home  

DgsTSHash


The DgsTSHash function creates an encoded time stamp request that includes the supplied hash value. The time stamp request can then be sent via the Internet to DigiStamp to retrieve a time stamp.  Based on the request, the DigiStamp service signs the hash with the current time and returns a signed CMS structure.

DWORD DgsTSHash(
  BYTE *hashAlgorithmID,              // in
  BYTE *hashAlgorithmParm,            // in
  BYTE *hashToBeTimeStamped           // in
  DWORD hashSize,                     // in
  LONG nonce                          // in
  BYTE **pbTSReqBlob,                 // out
  DWORD *pcbTSReqBlob                 // out
);

Parameters

hashAlgorithmID
Identifier of the hash algorithm used to create the hash.  Defaults to "1.3.14.3.2.26"(SHA1) if not specified.  Only SHA-1 is supported in current release.
hashAlgorithmParm
Parameters used in hash function.  Current release supports only NULL.
hashToBeTimeStamped
Buffers that contain the contents to be signed.
hashSize
Size of the hashToBeTimeStamped
nonce
Optional random number to be included in the time stamp.
pbTSReqBlob
The encoded time stamp request.  This is both DER and Base64 encoded.   If status is an error condition then pbTSReqBlob is not returned.  The caller of the function is responsible for deleting the memory allocated to hold this value
pcbTSReqBlob
Pointer to a DWORD specifying the size, in bytes, of the pbTSReqBlob buffer. When the function returns, this variable contains the size, in bytes, of the signed and encoded message.  On output, the this parameter is updated to reflect the actual size of the data copied to the pbTSReqBlob.

Return Values

If the function succeeds, the return value is zero.  Return codes other that zero are describe below.  The numberical values are defined of the toolkit header files.

Error code Description
DGS_ERROR_MORE_DATA If the buffer specified by the pbTSReqBlob 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 pcbTSReqBlob.
DGS_NOT_SUPPORTED Unsupported Hash Algorithm
DGS_FORMAT Data submitted has wrong format (e.g. Hash length does not match Algorithm)


  18 April, 2000

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.