CPKIFCVRequest Class Reference

#include <CVRequest.h>

Inheritance diagram for CPKIFCVRequest:

Inheritance graph
[legend]
Collaboration diagram for CPKIFCVRequest:

Collaboration graph
[legend]

List of all members.


Detailed Description

The CPKIFCVRequest class provides an interface to SCVP request objects.
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)

Constructor & Destructor Documentation

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.

Returns:
None

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.

Returns:
None

Definition at line 317 of file CVRequest.cpp.

References LOG_STRING_DEBUG, and TOOLKIT_SCVP_ASN.


Member Function Documentation

int CPKIFCVRequest::GetVersion (  )  const

Interface: External

This function is returns the SCVP version of a request. PKIF only supports version 1 requests.

Returns:
The version of SCVP request.

Definition at line 336 of file CVRequest.cpp.

void CPKIFCVRequest::SetVersion ( int  v  ) 

Interface: External

This function sets the version. Default version is 1

Returns:
None

Definition at line 348 of file CVRequest.cpp.

void CPKIFCVRequest::SetQuery ( CPKIFQueryPtr &  query  ) 

Interface: External

This function is used to set query item

Returns:
None
Parameters:
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

Returns:
Smart pointer to CPKIFQuery object

Definition at line 678 of file CVRequest.cpp.

void CPKIFCVRequest::SetRequestorRef ( CPKIFGeneralNameListPtr &  requestorRef  ) 

Interface: External

This function is used to set the requestor reference

Returns:
None
Parameters:
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

Returns:
The responder reference
Parameters:
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.

Returns:
None
Parameters:
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.

Returns:
Smart pointer to CPKIFBuffer object containing the nonce

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

Returns:
None
Parameters:
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

Returns:
The responder 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

Returns:
None
Parameters:
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

Returns:
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

Returns:
None
Parameters:
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

Returns:
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

Returns:
None
Parameters:
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

Returns:
Smart pointer to CPKIFOID object identifying the 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

Returns:
None
Parameters:
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

Returns:
The responder 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.

Returns:
None
Parameters:
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.

Returns:
None
Parameters:
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.

Returns:
The GetGenerateNonce function returns true if nonces are randomly generated at Encode-time and false otherwise.

Definition at line 493 of file CVRequest.cpp.

bool CPKIFCVRequest::ExtensionsPresent (  )  const

Interface: External

This function returns true if CPKIFCVRequest contained extensions.

Return values:
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.

template<class T>
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).

Returns:
A smart pointer to the appropriate extension

Reimplemented from IPKIFHasExtensions.

void CPKIFCVRequest::GetExtensionByOID ( const CPKIFOID oid,
CPKIFX509ExtensionPtr &  ref 
) [virtual]

Interface: External

This function retrives the extension identified by CPKIFOID object

Returns:
None
Parameters:
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

Returns:
A smart pointer to CPKIFBuffer object which will contain the encoded extensions
Parameters:
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.

Returns:
Returns true if there are any critical extensions present in the CVRequest object.

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.

Returns:
A buffer that contains the encoded CVRequest
Exceptions:
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.

Returns:
None
Exceptions:
CPKIFSCVPException(COMMON_INVALID_INPUT) 
CPKIFSCVPException(MSG_DECODE_FAILED) 
Parameters:
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.


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

Generated on Mon Nov 15 11:20:13 2010 for PublicKeyInfrastructureFramework(PKIF) by  doxygen 1.5.6