00001 #ifndef GENERIC_CRYPTO_H 00002 #define GENERIC_CRYPTO_H 00003 00004 #include "CryptoObject.h" 00005 #include <openssl/x509.h> 00006 #include "AttributeContainer.h" 00007 00012 class GenericCryptoObject : public CryptoObject { 00013 public: 00017 virtual ~GenericCryptoObject(void); 00018 00022 CK_OBJECT_HANDLE getHandle(); 00027 CK_ATTRIBUTE* getAttribute(CK_ATTRIBUTE_TYPE type); 00031 map<CK_ATTRIBUTE_TYPE,CK_ATTRIBUTE*> getAttributes(); 00036 virtual CK_OBJECT_CLASS getClass(); 00041 CK_ATTRIBUTE* matchAttribute(CK_ATTRIBUTE* attrib); 00047 bool doAllAttribsMatch(CK_ATTRIBUTE* attributes,CK_ULONG numAttribs); 00048 00049 00050 protected: 00054 static const CK_BBOOL _TRUE; 00058 static const CK_BBOOL _FALSE; 00062 AttributeContainer container; 00066 GenericCryptoObject(); 00067 private: 00071 CK_OBJECT_HANDLE handle; 00075 static CK_OBJECT_HANDLE uniqueId; 00076 00077 00078 00079 }; 00080 #endif