SignDoc SDK (C)  5.0.0
SIGNDOC_TimeStamper Class Reference

Interface for creating an RFC 3161 timestamp. More...

#include <SignDocSDK-c.h>

Public Member Functions

const char * SIGNDOC_TimeStamper_getHashAlgorithmOID (const struct SIGNDOC_TimeStamper *aObj)
 Get the object ID of the message digest algorithm. More...
 
const char * SIGNDOC_TimeStamper_getFallbackHashAlgorithmOID (const struct SIGNDOC_TimeStamper *aObj)
 Get the object ID of the fallback message digest algorithm. More...
 
int SIGNDOC_TimeStamper_stamp (struct SIGNDOC_Exception **aEx, struct SIGNDOC_TimeStamper *aObj, const unsigned char *aHashPtr, size_t aHashSize, unsigned aRandomNonceSize, int aFlags, struct SIGNDOC_ByteArray *aOutput, int *aStatus, unsigned *aFailureInfo)
 Create a time-stamp request, send the request to the configured time stamping authority, and evaluate the response. More...
 
void SIGNDOC_TimeStamper_stop (struct SIGNDOC_TimeStamper *aObj)
 Interrupt a SIGNDOC_TimeStamper_stamp() call from another thread. More...
 
const char * SIGNDOC_TimeStamper_getErrorMessage (const struct SIGNDOC_TimeStamper *aObj)
 Get an error message for the last SIGNDOC_TimeStamper_stamp() call. More...
 

Detailed Description

Interface for creating an RFC 3161 timestamp.

Member Function Documentation

const char * SIGNDOC_TimeStamper_getErrorMessage ( const struct SIGNDOC_TimeStamper aObj)

Get an error message for the last SIGNDOC_TimeStamper_stamp() call.

Parameters
[in]aObjA pointer to the SIGNDOC_TimeStamper object.
Returns
A pointer to a string describing the reason for the failure of the last SIGNDOC_TimeStamper_stamp() call. The string is empty if the last call succeeded. The pointer is valid until aObj is destroyed or SIGNDOC_TimeStamper_stamp() is called again. The string is ASCII encoded, the error message is in English.
const char * SIGNDOC_TimeStamper_getFallbackHashAlgorithmOID ( const struct SIGNDOC_TimeStamper aObj)

Get the object ID of the fallback message digest algorithm.

Parameters
[in]aObjA pointer to the SIGNDOC_TimeStamper object.
Returns
A pointer to the object ID of the fallback message digest algorithm as string, e.g., "1.3.14.3.2.26" for SHA-1. The pointer is valid until aObj is destroyed.
const char * SIGNDOC_TimeStamper_getHashAlgorithmOID ( const struct SIGNDOC_TimeStamper aObj)

Get the object ID of the message digest algorithm.

Parameters
[in]aObjA pointer to the SIGNDOC_TimeStamper object.
Returns
A pointer to the object ID of the message digest algorithm as string, e.g., "1.3.14.3.2.26" for SHA-1. The pointer is valid until aObj is destroyed.
int SIGNDOC_TimeStamper_stamp ( struct SIGNDOC_Exception **  aEx,
struct SIGNDOC_TimeStamper aObj,
const unsigned char *  aHashPtr,
size_t  aHashSize,
unsigned  aRandomNonceSize,
int  aFlags,
struct SIGNDOC_ByteArray aOutput,
int *  aStatus,
unsigned *  aFailureInfo 
)

Create a time-stamp request, send the request to the configured time stamping authority, and evaluate the response.

The signature in the returned time-stamp token is not verified by this function.

Parameters
[out]aExAny exception will be returned in the object pointed to by this parameter.
[in]aObjA pointer to the SIGNDOC_TimeStamper object.
[in]aHashPtrA pointer to the first octet of the document message digest to be hashed (unless SIGNDOC_TIMESTAMPER_STAMPFLAGS_DONT_HASH is set in aFlags) and signed.
[in]aHashSizeThe size (in octets) of the document message digest pointed to by aHashPtr).
[in]aRandomNonceSizeThe size (in octets, 1 through 256) of the random nonce in the time-stamp request.
[in]aFlagsFlags modifying the behavior of this function, see SIGNDOC_TIMESTAMPER_STAMPFLAGS_DONT_CHECK_REVOCATION and SIGNDOC_TIMESTAMPER_STAMPFLAGS_DONT_HASH.
[in,out]aOutputThe time-stamp token sent by the server will be stored here as blob if this function returns SIGNDOC_TIMESTAMPER_STAMPRESULT_OK. Otherwise, aOutput will be empty.
[out]aStatusThe PKIStatus value of the response from the server will be stored here. 0 if no response from the server is available.
[out]aFailureInfoThe PKIFailureInfo value of the response from the server will be stored here. 0 if no response from the server is available.
Returns
Return code: SIGNDOC_TIMESTAMPER_STAMPRESULT_OK, SIGNDOC_TIMESTAMPER_STAMPRESULT_INVALID_INPUT, SIGNDOC_TIMESTAMPER_STAMPRESULT_TIMEOUT, SIGNDOC_TIMESTAMPER_STAMPRESULT_STOPPED, SIGNDOC_TIMESTAMPER_STAMPRESULT_TCP_ERROR, SIGNDOC_TIMESTAMPER_STAMPRESULT_SSL_ERROR, SIGNDOC_TIMESTAMPER_STAMPRESULT_HTTP_ERROR, SIGNDOC_TIMESTAMPER_STAMPRESULT_SERVER_ERROR, or SIGNDOC_TIMESTAMPER_STAMPRESULT_INVALID_RESPONSE. Use SIGNDOC_TimeStamper_getErrorMessage() to get an error message.
void SIGNDOC_TimeStamper_stop ( struct SIGNDOC_TimeStamper aObj)

Interrupt a SIGNDOC_TimeStamper_stamp() call from another thread.

If this function is called while SIGNDOC_TimeStamper_stamp() is waiting for the response from the server, SIGNDOC_TimeStamper_stamp() will return SIGNDOC_TIMESTAMPER_STAMPRESULT_STOPPED.

Parameters
[in]aObjA pointer to the SIGNDOC_TimeStamper object.

The documentation for this class was generated from the following file: