Interface for creating an RFC 3161 timestamp. More...
#include <SignDocSDK-cpp.h>
Public Types | |
enum | StampResult { sr_ok, sr_invalid_input, sr_timeout, sr_stopped, sr_tcp_error, sr_ssl_error, sr_http_error, sr_server_error, sr_invalid_response } |
Return value of stamp(). More... | |
enum | StampFlags { sf_dont_check_revocation = 0x01, sf_dont_hash = 0x02 } |
Flags for stamp(). More... | |
Public Member Functions | |
const char * | getHashAlgorithm () const |
Get the object ID of the message digest algorithm. | |
const char * | getFallbackHashAlgorithm () const |
Get the object ID of the fallback message digest algorithm. | |
StampResult | stamp (const unsigned char *aHashPtr, size_t aHashSize, unsigned aRandomNonceSize, int aFlags, std::vector< unsigned char > &aOutput, int &aStatus, unsigned &aFailureInfo) |
Create a time-stamp request, send the request to the configured time stamping authority, and evaluate the response. | |
void | stop () |
Interrupt a stamp() call from another thread. | |
const char * | getErrorMessage () const |
Get an error message for the last stamp() call. | |
~TimeStamper () | |
Destructor. | |
TimeStamper (SIGNDOC_TimeStamper *aP) | |
Internal function. | |
SIGNDOC_TimeStamper * | getImpl () |
Internal function. | |
const SIGNDOC_TimeStamper * | getImpl () const |
Internal function. |
Interface for creating an RFC 3161 timestamp.
Flags for stamp().
Return value of stamp().
sr_ok |
Success. |
sr_invalid_input |
Invalid argument or invalid time-stamp request. |
sr_timeout |
Timeout. |
sr_stopped |
Transaction interrupted by stop(). |
sr_tcp_error |
Some failure at the TCP/IP layer. |
sr_ssl_error |
Some failure at the SSL/TLS layer. |
sr_http_error |
Some failure at the HTTP layer. |
sr_server_error |
The server failed to create the time stamp (according to PKIStatus). |
sr_invalid_response |
The response from the server is invalid. |
de::softpro::doc::TimeStamper::~TimeStamper | ( | ) | [inline] |
Destructor.
de::softpro::doc::TimeStamper::TimeStamper | ( | SIGNDOC_TimeStamper * | aP ) | [inline] |
Internal function.
const char* de::softpro::doc::TimeStamper::getErrorMessage | ( | ) | const [inline] |
Get an error message for the last stamp() call.
const char* de::softpro::doc::TimeStamper::getFallbackHashAlgorithm | ( | ) | const [inline] |
Get the object ID of the fallback message digest algorithm.
const char* de::softpro::doc::TimeStamper::getHashAlgorithm | ( | ) | const [inline] |
Get the object ID of the message digest algorithm.
const SIGNDOC_TimeStamper* de::softpro::doc::TimeStamper::getImpl | ( | ) | const [inline] |
Internal function.
SIGNDOC_TimeStamper* de::softpro::doc::TimeStamper::getImpl | ( | ) | [inline] |
Internal function.
StampResult de::softpro::doc::TimeStamper::stamp | ( | const unsigned char * | aHashPtr, |
size_t | aHashSize, | ||
unsigned | aRandomNonceSize, | ||
int | aFlags, | ||
std::vector< unsigned char > & | aOutput, | ||
int & | aStatus, | ||
unsigned & | aFailureInfo | ||
) | [inline] |
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.
[in] | aHashPtr | A pointer to the first octet of the document message digest to be hashed (unless sf_dont_hash is set in aFlags) and signed. |
[in] | aHashSize | The size (in octets) of the document message digest pointed to by aHashPtr). |
[in] | aRandomNonceSize | The size (in octets, 1 through 256) of the random nonce in the time-stamp request. |
[in] | aFlags | Flags modifying the behavior of this function, see enum StampFlags. |
[out] | aOutput | The time-stamp token sent by the server will be stored here as blob if this function returns sr_ok. Otherwise, aOutput will be empty. |
[out] | aStatus | The PKIStatus value of the response from the server will be stored here. 0 if no response from the server is available. |
[out] | aFailureInfo | The PKIFailureInfo value of the response from the server will be stored here. 0 if no response from the server is available. |
void de::softpro::doc::TimeStamper::stop | ( | ) | [inline] |
Interrupt a stamp() call from another thread.
If this function is called while stamp() is waiting for the response from the server, stamp() will return sr_stopped.