#include <TimeStampRequest.h>
TimeStampReq ::= SEQUENCE { version INTEGER { v1(1) }, messageImprint MessageImprint, --a hash algorithm OID and the hash value of the data to be time-stamped reqPolicy TSAPolicyId OPTIONAL, nonce INTEGER OPTIONAL, certReq BOOLEAN DEFAULT FALSE, extensions [0] IMPLICIT Extensions OPTIONAL }
TSP-enforcing: No
Definition at line 37 of file TimeStampRequest.h.
Public Member Functions | |
CPKIFTimeStampRequest () | |
virtual | ~CPKIFTimeStampRequest (void) |
int | GetVersion () const |
void | SetMessageImprint (CPKIFMessageImprintPtr &messageImprint) |
CPKIFMessageImprintPtr | GetMessageImprint () const |
void | SetPolicy (CPKIFOIDPtr &policy) |
CPKIFOIDPtr | GetPolicy () const |
void | SetNonce (CPKIFStringPtr &nonce) |
const char * | GetNonce () const |
void | SetGenerateNonce (bool generateNonce, IPKIFMediator *m=NULL) |
bool | GetGenerateNonce () const |
void | SetReqCert (bool reqCert) |
bool | GetReqCert () const |
bool | ExtensionsPresent () const |
template<class T> | |
boost::shared_ptr< T > | GetExtension () |
CPKIFBufferPtr | Encode () const |
void | Decode (CPKIFBufferPtr &msg) |
void | GetExtensionByOID (const CPKIFOID &oid, CPKIFX509ExtensionPtr &ref) |
void | GetEncodedExtensions (CPKIFBufferPtr &buf) |
CPKIFTimeStampRequest::CPKIFTimeStampRequest | ( | ) |
Interface: External
This function creates and initializes an instance of CPKIFTimeStampRequest. The Version property is initialized to PKIFTSPv1. The GenerateNonce property is initialized to false. The ReqCert property is initialized to false.
Definition at line 288 of file TimeStampRequest.cpp.
References LOG_STRING_DEBUG, and TOOLKIT_TSP_ASN.
CPKIFTimeStampRequest::~CPKIFTimeStampRequest | ( | void | ) | [virtual] |
Interface: External
This function destroys an instance of CPKIFTimeStampRequest.
Definition at line 310 of file TimeStampRequest.cpp.
References LOG_STRING_DEBUG, and TOOLKIT_TSP_ASN.
int CPKIFTimeStampRequest::GetVersion | ( | ) | const |
Interface: External
This function is returns the TSP version of a request. PKIF only supports version 1 timestamp requests.
Definition at line 329 of file TimeStampRequest.cpp.
References LOG_STRING_DEBUG, m_impl, and TOOLKIT_TSP_ASN.
void CPKIFTimeStampRequest::SetMessageImprint | ( | CPKIFMessageImprintPtr & | messageImprint | ) |
Interface: External
This function is used to set the message imprint associated with a CPKIFTimeStampRequest instance.
messageImprint | [in] Reference to a smart pointer to a CPKIFMessageImprint object containing information regarding the MessageImprint included in a TimeStampRequest |
Definition at line 348 of file TimeStampRequest.cpp.
References LOG_STRING_DEBUG, and TOOLKIT_TSP_ASN.
CPKIFMessageImprintPtr CPKIFTimeStampRequest::GetMessageImprint | ( | ) | const |
Interface: External
This function is used to get the message imprint associated with a CPKIFTimeStampRequest instance.
Definition at line 367 of file TimeStampRequest.cpp.
References CACASNWRAPPER_CREATE, data, LOG_STRING_DEBUG, m_impl, and TOOLKIT_TSP_ASN.
Referenced by Encode().
void CPKIFTimeStampRequest::SetPolicy | ( | CPKIFOIDPtr & | policy | ) |
Interface: External
These functions are used to set the policy associated with a CPKIFTimeStampRequest instance.
policy | [in] Reference to a smart pointer to a CPKIFOID object identifying the policy to include in a TimeStampRequest |
Definition at line 422 of file TimeStampRequest.cpp.
References LOG_STRING_DEBUG, and TOOLKIT_TSP_ASN.
CPKIFOIDPtr CPKIFTimeStampRequest::GetPolicy | ( | ) | const |
Interface: External
These functions are used to get the policy associated with a CPKIFTimeStampRequest instance.
Definition at line 439 of file TimeStampRequest.cpp.
References LOG_STRING_DEBUG, m_impl, and TOOLKIT_TSP_ASN.
Referenced by Encode().
void CPKIFTimeStampRequest::SetNonce | ( | CPKIFStringPtr & | nonce | ) |
Interface: External
This function is used to set the nonce associated with a CPKIFTimeStampRequest instance.
nonce | [in] Reference to a CPKIFStringPtr object containing a NULL terminated ASCII Hex representation of a nonce value to include in a TimeStampRequest |
Definition at line 466 of file TimeStampRequest.cpp.
References LOG_STRING_DEBUG, and TOOLKIT_TSP_ASN.
const char * CPKIFTimeStampRequest::GetNonce | ( | ) | const |
Interface: External
This function is used to get the nonce associated with a CPKIFTimeStampRequest instance.
Definition at line 485 of file TimeStampRequest.cpp.
References LOG_STRING_DEBUG, m_impl, and TOOLKIT_TSP_ASN.
Referenced by Encode().
void CPKIFTimeStampRequest::SetGenerateNonce | ( | bool | generateNonce, | |
IPKIFMediator * | m = NULL | |||
) |
Interface: External
This function is used to set an indicator that is used to turn on/off automatic nonce generation. The optional m parameter to SetGenerateNonce can be used to pass a mediator containing the IPKIFCryptoMisc interface to use when generating the nonce value. Automatic nonce generation is disabled by default.
generateNonce | [in] Boolean value indicating whether a nonce value should be randomly generated when the TimeStampRequest is encoded |
m | [in] Pointer to an IPKIFMediator to use when generating the random nonce value |
Definition at line 512 of file TimeStampRequest.cpp.
References LOG_STRING_DEBUG, and TOOLKIT_TSP_ASN.
bool CPKIFTimeStampRequest::GetGenerateNonce | ( | ) | const |
Interface: External
This function is used to get an indicator that is used to turn on/off automatic nonce generation.
Definition at line 531 of file TimeStampRequest.cpp.
void CPKIFTimeStampRequest::SetReqCert | ( | bool | reqCert | ) |
Interface: External
This function are used to set the certificate request flag associated with a CPKIFTimeStampRequest instance. When set to true in a request, compliant TSAs return the TSA certificate along with the requested timestamp token. This value is set to false by default.
reqCert | [in] Boolean value indicating whether a TSA should include its certificate in the resulting TimeStampResponse |
Definition at line 544 of file TimeStampRequest.cpp.
References LOG_STRING_DEBUG, and TOOLKIT_TSP_ASN.
bool CPKIFTimeStampRequest::GetReqCert | ( | ) | const |
Interface: External
This function are used to get the certificate request flag associated with a CPKIFTimeStampRequest instance. When set to true in a request, compliant TSAs return the TSA certificate along with the requested timestamp token. This value is set to false by default.
Definition at line 562 of file TimeStampRequest.cpp.
References LOG_STRING_DEBUG, m_impl, and TOOLKIT_TSP_ASN.
bool CPKIFTimeStampRequest::ExtensionsPresent | ( | ) | const |
Interface: External
This function returns true if a decoded TimeStampRequest contained extensions. PKIF does not currently support processing or generating extensions in timestamp-related objects.
True | if a decoded TimeStampRequest contained extensions | |
False | if a decoded TimeStampRequest did not contain extensions |
Definition at line 405 of file TimeStampRequest.cpp.
References LOG_STRING_DEBUG, and TOOLKIT_TSP_ASN.
boost::shared_ptr<T> CPKIFTimeStampRequest::GetExtension | ( | ) | [inline] |
this function should be used to retrieve extensions in a type-safe manner you pass a type as a param and the function returns a default smart pointer to that type Interface: External
This function is used to retrieve an extension from an IPKIFHasExtensions object. It takes the type of extension sought by an application as a template parameter and returns a smart pointer to that type (containing a NULL pointer if the extension was not found).
Reimplemented from IPKIFHasExtensions.
CPKIFBufferPtr CPKIFTimeStampRequest::Encode | ( | ) | const |
Interface: External
This function is used to generate an encoded a timestamp request. If auto-nonce generation is enabled, a randomly generated nonce value will be included in the request. This function may generate an exception containing the following error code TSP_MISSING_REQUIRED_FIELD.
CPKIFTSPException(TSP_MISSING_REQUIRED_FIELD) | ||
CPKIFTSPException(COMMON_NOT_IMPLEMENTED) |
Definition at line 591 of file TimeStampRequest.cpp.
References CACASNWRAPPER_CREATE, COMMON_NOT_IMPLEMENTED, ConvertStringToASN1OBJID(), CopyOID(), g_nullParams, GetMessageImprint(), GetNonce(), GetPolicy(), LOG_STRING_DEBUG, PKIFTSPMemoryHelper::pRequest, TOOLKIT_TSP, and TOOLKIT_TSP_ASN.
void CPKIFTimeStampRequest::Decode | ( | CPKIFBufferPtr & | msg | ) |
Interface: External
This function is used to decode an encoded timestamp request.
CPKIFTSPException(COMMON_INVALID_INPUT) | ||
CPKIFTSPException(MSG_DECODE_FAILED) |
msg | [in] Reference to a smart pointer to a CPKIFBuffer object containing a TimeStampRequest to decode |
Definition at line 689 of file TimeStampRequest.cpp.
References COMMON_INVALID_INPUT, LOG_STRING_DEBUG, MSG_DECODE_FAILED, and TOOLKIT_TSP_ASN.
void CPKIFTimeStampRequest::GetExtensionByOID | ( | const CPKIFOID & | oid, | |
CPKIFX509ExtensionPtr & | ref | |||
) | [virtual] |
Interface: External
This function retrives the extension identified by CPKIFOID object
oid | [in] Identifies the extension sought |
ref | [out] The extension (if present). |
Implements IPKIFHasExtensions.
Definition at line 258 of file TimeStampRequest.cpp.
void CPKIFTimeStampRequest::GetEncodedExtensions | ( | CPKIFBufferPtr & | buf | ) | [virtual] |
Interface: External
This function returns a smart pointer to CPKIFBuffer object which will contain the encoded extensions
buf | [out] A reference to a smart pointer to CPKIFBuffer object which will contain the encoded extensions |
Implements IPKIFHasExtensions.
Definition at line 725 of file TimeStampRequest.cpp.
References CACASNWRAPPER_CREATE, and data.