00001 00009 #ifndef __TBSRequest_H__ 00010 #define __TBSRequest_H__ 00011 00012 #include "PKIFdll.h" 00013 #include "IPKIFHasExtensions.h" 00014 00015 FD_SMART_PTR(CPKIFGeneralName); 00016 FD_LIST_PTR(CPKIFRequest); 00017 FD_SMART_PTR(CPKIFBuffer); 00018 FD_SMART_PTR(CPKIFX509Extension); 00019 class CPKIFOID; 00020 // changed with the merger of mediator and colleague interfaces 00021 FD_MC_PTR(); 00022 00023 struct TBSRequest; 00024 00041 class CAC_API CPKIFTBSRequest: public IPKIFHasExtensions 00042 { 00043 friend struct CPKIFTBSRequestImpl; 00044 public: 00045 CPKIFTBSRequest(); 00046 CPKIFTBSRequest(const CPKIFBufferPtr& r); 00047 virtual ~CPKIFTBSRequest(); 00048 00049 //version 00050 int GetVersion() const; 00051 00052 //requestorName 00053 void SetRequestorName(CPKIFGeneralNamePtr& gn); 00054 CPKIFGeneralNamePtr GetRequestorName() const; 00055 00056 //requestList 00057 void AddRequest(CPKIFRequestPtr& req); 00058 void GetRequests(CPKIFRequestList& reqs); 00059 00060 //requestExtensions (supporting nonce only in this version - not supporting extensions in general) 00061 void SetNonce(CPKIFBufferPtr& nonce); //nonce is set in binary format 00062 CPKIFBufferPtr GetNonce() const; 00063 00064 //convenience function to trigger automatic generation and inclusion 00065 //of a random nonce. the mediator param allows caller to control what 00066 //random number generator will be used. if m is NULL (or does not contain 00067 //the IPKIFCryptoMisc interface) then an instance of CPKIFCAPIRaw will be 00068 //used to produce the nonce. The value passed as m MUST NOT be destroyed 00069 //prior to calling encode. 00070 void SetGenerateNonce(bool generateNonce, IPKIFMediator* m = NULL); 00071 bool GetGenerateNonce() const; 00072 00073 CPKIFBufferPtr Encode(); //this is here to facilitate signing 00074 00075 void GetExtension(const CPKIFOID& oid, CPKIFX509ExtensionPtr& ref); 00076 00077 void GetExtensionByOID(const CPKIFOID& oid, CPKIFX509ExtensionPtr& ref); 00078 void GetEncodedExtensions (CPKIFBufferPtr& buf); 00079 00080 private: 00082 CPKIFTBSRequest(const CPKIFTBSRequest& copy); 00084 CPKIFTBSRequest& operator=(const CPKIFTBSRequest& rhs); //added 4/6/2004 00085 00086 struct CPKIFTBSRequestImpl *m_impl; 00087 00088 }; 00089 DECLARE_SMART_POINTERS(CPKIFTBSRequest); 00090 00091 00092 #endif