#include <CVRequest.h>
CVRequest ::= SEQUENCE { cvRequestVersion INTEGER DEFAULT 1, query Query, requestorRef [0] GeneralNames OPTIONAL, requestNonce [1] OCTET STRING OPTIONAL, requestorName [2] GeneralName OPTIONAL, responderName [3] GeneralName OPTIONAL, requestExtensions [4] Extensions OPTIONAL, signatureAlg [5] AlgorithmIdentifier OPTIONAL, hashAlg [6] OBJECT IDENTIFIER OPTIONAL, requestorText [7] UTF8String (SIZE (1..256)) OPTIONAL }
TSP-enforcing: No
Definition at line 48 of file CVRequest.h.
Public Member Functions | |
CPKIFCVRequest () | |
virtual | ~CPKIFCVRequest (void) |
int | GetVersion () const |
void | SetVersion (int v) |
void | SetQuery (CPKIFQueryPtr &query) |
const CPKIFQueryPtr | GetQuery () const |
void | SetRequestorRef (CPKIFGeneralNameListPtr &requestorRef) |
void | GetRequestorRef (CPKIFGeneralNameListPtr &requestorRef) const |
void | SetNonce (CPKIFBufferPtr &nonce) |
const CPKIFBufferPtr | GetNonce () const |
void | SetRequestorName (CPKIFGeneralNamePtr &requestorName) |
const CPKIFGeneralNamePtr | GetRequestorName () const |
void | SetResponderName (CPKIFGeneralNamePtr &responderName) |
const CPKIFGeneralNamePtr | GetResponderName () const |
void | SetSigAlgorithm (CPKIFAlgorithmIdentifierPtr &sigAlgorithm) |
const CPKIFAlgorithmIdentifierPtr | GetSigAlgorithm () const |
void | SetHashAlgorithm (CPKIFOIDPtr &hashAlgorithm) |
const CPKIFOIDPtr | GetHashAlgorithm () const |
void | SetRequestorText (CPKIFStringPtr &nonce) |
const CPKIFStringPtr | GetRequestorText () const |
void | SetGenerateNonce (bool generateNonce) |
void | SetGenerateNonce (bool generateNonce, IPKIFMediatorPtr &m) |
bool | GetGenerateNonce () const |
bool | ExtensionsPresent () const |
template<class T> | |
boost::shared_ptr< T > | GetExtension () |
void | GetExtensionByOID (const CPKIFOID &oid, CPKIFX509ExtensionPtr &ref) |
void | GetEncodedExtensions (CPKIFBufferPtr &buf) |
bool | AreThereAnyUnprocessedCriticalExtensions () |
CPKIFBufferPtr | Encode () const |
void | Decode (CPKIFBufferPtr &msg) |
CPKIFCVRequest::CPKIFCVRequest | ( | ) |
Interface: External
This function creates and initializes an instance of CPKIFCVRequest. The Version property is initialized to 1. The GenerateNonce property is initialized to false.
Definition at line 297 of file CVRequest.cpp.
References LOG_STRING_DEBUG, and TOOLKIT_SCVP_ASN.
CPKIFCVRequest::~CPKIFCVRequest | ( | void | ) | [virtual] |
Interface: External
This function destroys an instance of CPKIFCVRequest.
Definition at line 317 of file CVRequest.cpp.
References LOG_STRING_DEBUG, and TOOLKIT_SCVP_ASN.
int CPKIFCVRequest::GetVersion | ( | ) | const |
Interface: External
This function is returns the SCVP version of a request. PKIF only supports version 1 requests.
Definition at line 336 of file CVRequest.cpp.
void CPKIFCVRequest::SetVersion | ( | int | v | ) |
Interface: External
This function sets the version. Default version is 1
Definition at line 348 of file CVRequest.cpp.
void CPKIFCVRequest::SetQuery | ( | CPKIFQueryPtr & | query | ) |
Interface: External
This function is used to set query item
query | [in] Smart pointer to CPKIFQuery object |
Definition at line 665 of file CVRequest.cpp.
const CPKIFQueryPtr CPKIFCVRequest::GetQuery | ( | ) | const |
Interface: External
This function is used to set query item
Definition at line 678 of file CVRequest.cpp.
void CPKIFCVRequest::SetRequestorRef | ( | CPKIFGeneralNameListPtr & | requestorRef | ) |
Interface: External
This function is used to set the requestor reference
requestorRef | [in] Reference to a smart pointer to a CPKIFGeneralNamesPtr object containing information identifying the requestor reference associated with a CPKIFCVRequest object |
Definition at line 611 of file CVRequest.cpp.
void CPKIFCVRequest::GetRequestorRef | ( | CPKIFGeneralNameListPtr & | requestorRef | ) | const |
Interface: External
This function is used to get the requestor reference
requestorRef | [out] Reference to a smart pointer to a CPKIFGeneralNamesPtr objectwhich will contain information identifying the requestor reference associated with a CPKIFCVRequest object |
Definition at line 625 of file CVRequest.cpp.
Referenced by Encode().
void CPKIFCVRequest::SetNonce | ( | CPKIFBufferPtr & | nonce | ) |
Interface: External
This function is used to set the nonce associated with a CPKIFCVRequest 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 410 of file CVRequest.cpp.
References LOG_STRING_DEBUG, and TOOLKIT_SCVP_ASN.
const CPKIFBufferPtr CPKIFCVRequest::GetNonce | ( | ) | const |
Interface: External
This function is used to get the nonce associated with a CPKIFCVRequest instance.
Definition at line 427 of file CVRequest.cpp.
Referenced by Encode().
void CPKIFCVRequest::SetRequestorName | ( | CPKIFGeneralNamePtr & | requestorName | ) |
Interface: External
This function is used to set the requestor name
requestorName | [in] Reference to a smart pointer to a CPKIFGeneralNamePtr object containing information identifying the requestor name associated with a CPKIFCVRequest object |
Definition at line 559 of file CVRequest.cpp.
const CPKIFGeneralNamePtr CPKIFCVRequest::GetRequestorName | ( | ) | const |
Interface: External
This function is used to get the requestor name
Definition at line 573 of file CVRequest.cpp.
Referenced by Encode().
void CPKIFCVRequest::SetResponderName | ( | CPKIFGeneralNamePtr & | responderName | ) |
Interface: External
This function is used to set the responder name
responderName | [in] Reference to a smart pointer to a CPKIFGeneralNamePtr object containing information identifying the responder name associated with a CPKIFCVRequest object |
Definition at line 585 of file CVRequest.cpp.
const CPKIFGeneralNamePtr CPKIFCVRequest::GetResponderName | ( | ) | const |
Interface: External
This function is used to get the responder name
Definition at line 599 of file CVRequest.cpp.
Referenced by Encode().
void CPKIFCVRequest::SetSigAlgorithm | ( | CPKIFAlgorithmIdentifierPtr & | sigAlgorithm | ) |
Interface: External
This function is used to set the signature algorithm
sigAlgorithm | [in] Reference to a smart pointer to a CPKIFAlgorithmIdentifier object containing information identifying the hash algorithm associated with a CPKIFCVRequest object |
Definition at line 532 of file CVRequest.cpp.
const CPKIFAlgorithmIdentifierPtr CPKIFCVRequest::GetSigAlgorithm | ( | ) | const |
Interface: External
This function is used to get the signature algorithm
Definition at line 547 of file CVRequest.cpp.
Referenced by Encode().
void CPKIFCVRequest::SetHashAlgorithm | ( | CPKIFOIDPtr & | hashAlgorithm | ) |
Interface: External
This function is used to set the hash algorithm
hashAlgorithm | [in] Reference to a smart pointer to a CPKIFOID object containing information identifying the hash algorithm associated with a CVrequest object |
Definition at line 505 of file CVRequest.cpp.
const CPKIFOIDPtr CPKIFCVRequest::GetHashAlgorithm | ( | ) | const |
Interface: External
This function is used to get the oid identifying hash algorithm
Definition at line 520 of file CVRequest.cpp.
Referenced by Encode().
void CPKIFCVRequest::SetRequestorText | ( | CPKIFStringPtr & | requestorText | ) |
Interface: External
This function is used to set the requestor text
requestorText | [in] Reference to a smart pointer to a CPKIFStringPtr object containing information identifying the requestor text associated with a CPKIFCVRequest object |
Definition at line 640 of file CVRequest.cpp.
const CPKIFStringPtr CPKIFCVRequest::GetRequestorText | ( | ) | const |
Interface: External
This function is used to get the requestor text
Definition at line 654 of file CVRequest.cpp.
Referenced by Encode().
void CPKIFCVRequest::SetGenerateNonce | ( | bool | generateNonce | ) |
Interface: External
This function is used to set an indicator that is used to turn on/off automatic nonce generation.
generateNonce | [in] Boolean value indicating whether a nonce value should be randomly generated when the TimeStampRequest is encoded |
Definition at line 455 of file CVRequest.cpp.
References LOG_STRING_DEBUG, and TOOLKIT_SCVP_ASN.
void CPKIFCVRequest::SetGenerateNonce | ( | bool | generateNonce, | |
IPKIFMediatorPtr & | m | |||
) |
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] Reference to a smart pointer to a IPKIFMediator to use when generating the random nonce value |
Definition at line 474 of file CVRequest.cpp.
References LOG_STRING_DEBUG, and TOOLKIT_SCVP_ASN.
bool CPKIFCVRequest::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 493 of file CVRequest.cpp.
bool CPKIFCVRequest::ExtensionsPresent | ( | ) | const |
Interface: External
This function returns true if CPKIFCVRequest contained extensions.
True | if a CPKIFCVRequest contained extensions | |
False | if a CPKIFCVRequest did not contain extensions |
Definition at line 393 of file CVRequest.cpp.
References LOG_STRING_DEBUG, and TOOLKIT_SCVP_ASN.
boost::shared_ptr<T> CPKIFCVRequest::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.
void CPKIFCVRequest::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 268 of file CVRequest.cpp.
void CPKIFCVRequest::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 360 of file CVRequest.cpp.
References CACASNWRAPPER_CREATE, and data.
bool CPKIFCVRequest::AreThereAnyUnprocessedCriticalExtensions | ( | ) |
Interface: External
This function determines if a CVRequest object holds any unprocessed critical extensions.
Definition at line 985 of file CVRequest.cpp.
References LOG_STRING_DEBUG, and TOOLKIT_OCSP_ASN.
CPKIFBufferPtr CPKIFCVRequest::Encode | ( | ) | const |
Interface: External
This function is used to generate an encoded a SCVP request. If auto-nonce generation is enabled, a randomly generated nonce value will be included in the request.
CPKIFSCVPException(SCVP_MISSING_REQUIRED_FIELD) | ||
CPKIFSCVPException(COMMON_NOT_IMPLEMENTED) |
Definition at line 694 of file CVRequest.cpp.
References CACASNWRAPPER_CREATE, COMMON_NOT_IMPLEMENTED, ConvertStringToASN1OBJID(), CopyGeneralName(), CopyOID(), GetHashAlgorithm(), GetNonce(), GetRequestorName(), GetRequestorRef(), GetRequestorText(), GetResponderName(), GetSigAlgorithm(), LOG_STRING_DEBUG, NEW_NEXT_AND_ADVANCE, NEW_NODE, PopulateQuery(), PKIFSCVPMemoryHelper::pRequest, SET_HEAD_TAIL_INCREMENT, and TOOLKIT_SCVP_ASN.
void CPKIFCVRequest::Decode | ( | CPKIFBufferPtr & | msg | ) |
Interface: External
This function is used to decode an encoded cvrequest request.
CPKIFSCVPException(COMMON_INVALID_INPUT) | ||
CPKIFSCVPException(MSG_DECODE_FAILED) |
msg | [in] Reference to a smart pointer to a CPKIFBuffer object containing a CVRequest to decode |
Definition at line 850 of file CVRequest.cpp.
References CACASNWRAPPER_CREATE, COMMON_INVALID_INPUT, MSG_DECODE_FAILED, and TOOLKIT_SCVP_ASN.