00001 00010 #if !defined(__PKIFCRYPTOPPKEYMATERIAL_H__) 00011 #define __PKIFCRYPTOPPKEYMATERIAL_H__ 00012 00013 #include "PKIFdll.h" 00014 #include "PKIFKeyMaterial.h" 00015 00016 FD_SMART_PTR(CPKIFCertificate); 00017 FD_SMART_PTR(CPKIFSubjectPublicKeyInfo); 00018 FD_SMART_PTR(CPKIFBuffer); 00019 class CPKIFAlgorithm; 00020 00029 class CAC_API CPKIFCryptoPPKeyMaterial : public CPKIFKeyMaterial 00030 { 00031 public: 00032 CPKIFCryptoPPKeyMaterial(void); 00033 CPKIFCryptoPPKeyMaterial(const CPKIFCertificate & cert); 00034 CPKIFCryptoPPKeyMaterial(CPKIFSubjectPublicKeyInfoPtr & spki ); 00035 CPKIFCryptoPPKeyMaterial(const CPKIFKeyMaterial & km); 00036 ~CPKIFCryptoPPKeyMaterial(void); 00037 00038 CPKIFBufferPtr GetRawSPKI(void) const; 00039 const CPKIFAlgorithm * GetKeyAlg(void) const; 00040 00041 void SetRawSPKI(const CPKIFBufferPtr &); 00042 void SetKeyAlg(const CPKIFAlgorithm *); 00043 00044 bool HasParams() const; 00045 00046 protected: 00047 void InitWithKeyMaterial(const CPKIFKeyMaterial & km); 00048 void InitWithSPKI(CPKIFSubjectPublicKeyInfoPtr & spki); 00049 void InitWithCert(const CPKIFCertificate & cert); 00050 00051 protected: 00052 CPKIFBufferPtr m_rawSPKI; 00053 const CPKIFAlgorithm * m_alg; 00054 bool m_hasParams; 00055 00056 }; 00057 DECLARE_SMART_POINTERS(CPKIFCryptoPPKeyMaterial); 00058 00059 #endif