00001 00010 #if !defined(__PKIFBCRYPTPUBLICKEY_H__) 00011 #define __PKIFBCRYPTPUBLICKEY_H__ 00012 00013 #include "PKIFdll.h" 00014 00015 #include <bcrypt.h> 00016 00017 class CPKIFKeyMaterial; 00018 FD_SMART_PTR(CPKIFSubjectPublicKeyInfo); 00019 FD_SMART_PTR(CPKIFAlgorithmIdentifier); 00020 FD_SMART_PTR(CPKIFBuffer); 00021 00025 class CPKIFBCryptPublicKey 00026 { 00027 public: 00028 CPKIFBCryptPublicKey(); 00029 ~CPKIFBCryptPublicKey(); 00030 00031 BCRYPT_KEY_HANDLE Initialize(const CPKIFKeyMaterial & km); 00032 BCRYPT_KEY_HANDLE Initialize(const CPKIFBufferPtr & km); 00033 BCRYPT_KEY_HANDLE GetCNGHandle() const; 00034 CPKIFAlgorithmIdentifierPtr GetAlgId() const; 00035 00036 protected: 00038 CPKIFBCryptPublicKey(const CPKIFBCryptPublicKey &); 00039 void clear(); 00040 BCRYPT_KEY_HANDLE m_hKey; 00041 BCRYPT_ALG_HANDLE m_hAlg; 00042 CPKIFSubjectPublicKeyInfoPtr(m_spki); 00043 }; 00044 00045 00046 00047 #endif