Bsae class for user-provided timestamping.
More...
#include <SignDocSDK-cpp.h>
Bsae class for user-provided timestamping.
You can derive from this class and pass the object to SignDocSignatureParameters::setTimeStamper().
Any exception object thrown must be derived from std::exception.
Flags for stamp().
Enumerator |
---|
f_get_size |
Get the size only.
This flag is set if only the size of the timestamp is needed.
|
Return value of stamp().
Enumerator |
---|
r_ok |
Success.
|
r_invalid_argument |
Invalid argument.
|
r_timeout |
Timeout.
|
r_stopped |
Transaction interrupted by stop().
|
r_error |
Error.
|
virtual const char* getErrorMessage |
( |
| ) |
const |
|
pure virtual |
Get an error message for the last init() or stamp() call.
This function must not throw any exception except for std::bad_alloc.
- Returns
- A pointer to a string describing the reason for the failure of the last init() or stamp() call. The pointer shall be valid until init() or stamp() is called or this object is destroyed. The string shall be ASCII-encoded, the error message shall be in English.
virtual const char* getHashAlgorithmOID |
( |
| ) |
const |
|
pure virtual |
Get the object ID of the message digest algorithm.
This function shall return the message digest algorithm expected to be used for the time-stamp token. If you know in advance that the algorithm specified in the SignDocSignatureParameters object passed to init() isn't supported, this function should return a supported message digest algorithm.
If the message digest algorithm turns out to be unsupported, stamp() should return a TimeStampResp with badAlg in failInfo to make falling back to another message digest algorithm work.
- 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 shall be valid until this object is destroyed.
SIGNDOC_UserTimeStamper* getImpl |
( |
| ) |
|
|
inline |
virtual ReturnCode init |
( |
const SignDocSignatureParameters * |
aParameters, |
|
|
const std::string & |
aHashAlgorithmOID, |
|
|
const std::string & |
aOverrideURL, |
|
|
const std::string & |
aDocumentHashAlgorithmOID |
|
) |
| |
|
pure virtual |
virtual Result stamp |
( |
const unsigned char * |
aHashPtr, |
|
|
size_t |
aHashSize, |
|
|
unsigned |
aRandomNonceSize, |
|
|
int |
aFlags, |
|
|
std::vector< unsigned char > & |
aOutput, |
|
|
size_t & |
aSize |
|
) |
| |
|
pure virtual |
Create a time stamp.
The signature in the returned time-stamp token need not verified by this function.
- Parameters
-
[in] | aHashPtr | A pointer to the first octet of the document message digest to be 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 to be used in the time-stamp request (if time-stamp requests are used). |
[in] | aFlags | Flags modifying the behavior of this function, see enum Flags. |
[out] | aOutput | The time-stamp token or time-stamp response shall be stored here as blob if this function returns r_ok and f_get_size is not set in aFlags. |
[out] | aSize | The expected size of the time-stamp token shall be stored here if this function returns r_ok and f_get_size is set in aFlags. |
- Returns
- r_ok iff successful.
- See also
- getErrorMessage(), getHashAlgorithmOID(), stop()
Interrupt a stamp() call from another thread.
If this function is called while stamp() is waiting for the response from the server, stamp() shall return r_stopped.
The documentation for this class was generated from the following file: