CVRequest.h

Go to the documentation of this file.
00001 
00010 #ifndef __CVREQUEST_H__
00011 #define __CVREQUEST_H__
00012 
00013 #include "PKIFSCVPDLL.h"
00014 #include "IPKIFHasExtensions.h"
00015 
00016 // forward declarations
00017 struct CPKIFCVRequestImpl;
00018 
00019 FD_MC_PTR();
00020 FD_SMART_PTR(CPKIFQuery);
00021 FD_SMART_PTR(CPKIFAlgorithmIdentifier);
00022 
00023 FD_LIST_PTR(CPKIFGeneralName);
00024 
00025 //typedef CPKIFGeneralNameList CPKIFGeneralNames;
00026 //DECLARE_SMART_POINTERS(CPKIFGeneralNames);
00027 
00048 class PKIFSCVP_API CPKIFCVRequest: public IPKIFHasExtensions
00049 {
00050 public:
00051     CPKIFCVRequest();
00052     virtual ~CPKIFCVRequest(void);
00053 
00054     //Default version is 1
00055     int GetVersion() const;
00056     void SetVersion(int v);
00057 
00058     //query field
00059     void SetQuery(CPKIFQueryPtr& query); 
00060     const CPKIFQueryPtr GetQuery() const;
00061 
00062     //optional field
00063     void SetRequestorRef(CPKIFGeneralNameListPtr& requestorRef);
00064     void GetRequestorRef(CPKIFGeneralNameListPtr& requestorRef) const;
00065 
00066     //optional field
00067     void SetNonce(CPKIFBufferPtr& nonce); 
00068     const CPKIFBufferPtr GetNonce() const;
00069 
00070     //optional field
00071     void SetRequestorName(CPKIFGeneralNamePtr& requestorName);
00072     const CPKIFGeneralNamePtr GetRequestorName() const;
00073 
00074     //optional field
00075     void SetResponderName(CPKIFGeneralNamePtr& responderName);
00076     const CPKIFGeneralNamePtr GetResponderName() const;
00077 
00078     //optional field
00079     void SetSigAlgorithm(CPKIFAlgorithmIdentifierPtr& sigAlgorithm);
00080     const CPKIFAlgorithmIdentifierPtr GetSigAlgorithm() const;
00081 
00082     //optional field
00083     void SetHashAlgorithm(CPKIFOIDPtr& hashAlgorithm);
00084     const CPKIFOIDPtr GetHashAlgorithm() const;
00085 
00086     //optional field
00087     void SetRequestorText(CPKIFStringPtr& nonce); 
00088     const CPKIFStringPtr GetRequestorText() const;
00089 
00090     //CPKIFCVRequest supports automatic nonce generation.  The mediator parameter allows caller 
00091     //to control what random number generator will be used.  If m is NULL (or does not contain
00092     //the IPKIFCryptoMisc interface) then a temporary instance of CPKIFCAPIRaw or CPKIFNSSRaw will 
00093     //be used to produce the nonce.  
00094     void SetGenerateNonce(bool generateNonce);
00095     void SetGenerateNonce(bool generateNonce, IPKIFMediatorPtr& m);
00096     bool GetGenerateNonce() const;
00097 
00098     //convenience function to allow quick failure in the SCVP server, i.e., if the server does not 
00099     //implement support for extensions
00100     bool ExtensionsPresent() const;
00101 
00102     template <class T> boost::shared_ptr<T> GetExtension();
00103     void GetExtensionByOID(const CPKIFOID& oid, CPKIFX509ExtensionPtr& ref);
00104     void GetEncodedExtensions (CPKIFBufferPtr& buf);
00105     bool AreThereAnyUnprocessedCriticalExtensions();
00106 
00107     CPKIFBufferPtr Encode() const;
00108     void Decode(CPKIFBufferPtr& msg);
00109 
00110 private:
00112     CPKIFCVRequest(const CPKIFCVRequest& copy);
00114     CPKIFCVRequest& operator=(const CPKIFCVRequest& rhs);
00115 
00116     struct CPKIFCVRequestImpl *m_impl;
00117 };
00118 DECLARE_SMART_POINTERS(CPKIFCVRequest);
00119 
00120 #endif //__CVREQUEST_H__

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