|
|
@ -63,26 +63,32 @@ namespace cryptoki { |
|
|
|
|
|
|
|
|
|
|
|
typedef std::set<CK_MECHANISM_TYPE> MechanismList; |
|
|
|
typedef std::set<CK_MECHANISM_TYPE> MechanismList; |
|
|
|
|
|
|
|
|
|
|
|
//! Map Attribute Class to type
|
|
|
|
typedef std::vector<CK_ATTRIBUTE_TYPE> AttributeTypeList; |
|
|
|
/*! @todo to be completed ... */ |
|
|
|
typedef std::vector<CK_ATTRIBUTE> AttributeList; |
|
|
|
template<CK_ATTRIBUTE_TYPE Attribute> class AttributeType {}; |
|
|
|
|
|
|
|
template<> class AttributeType<CKA_CLASS> { |
|
|
|
// //! Map Attribute Class to type
|
|
|
|
public: typedef CK_OBJECT_CLASS Type; |
|
|
|
// /*! @todo to be completed ... */
|
|
|
|
}; |
|
|
|
// template<CK_ATTRIBUTE_TYPE Attribute> class AttributeType {};
|
|
|
|
/*
|
|
|
|
// template<> class AttributeType<CKA_CLASS> {
|
|
|
|
template<> class AttributeType<> { |
|
|
|
// public: typedef CK_OBJECT_CLASS Type;
|
|
|
|
public: typedef Type; |
|
|
|
// public: typedef Type Param;
|
|
|
|
}; |
|
|
|
// };
|
|
|
|
template<> class AttributeType<> { |
|
|
|
// template<> class AttributeType<CKA_KEY_TYPE> {
|
|
|
|
public: typedef Type; |
|
|
|
// public: typedef CK_KEY_TYPE Type;
|
|
|
|
}; |
|
|
|
// public: typedef Type Param;
|
|
|
|
template<> class AttributeType<> { |
|
|
|
// };
|
|
|
|
public: typedef Type; |
|
|
|
// template<> class AttributeType<CKA_APPLICATION> {
|
|
|
|
}; |
|
|
|
// public: typedef CK_CHAR Type;
|
|
|
|
template<> class AttributeType<> { |
|
|
|
// public: typedef std::string Param;
|
|
|
|
public: typedef Type; |
|
|
|
// };
|
|
|
|
};*/ |
|
|
|
// template<> class AttributeType<CKA_VALUE> {
|
|
|
|
|
|
|
|
// public: typedef CKA_BYTE Type;
|
|
|
|
|
|
|
|
// public: typedef std::string Param;
|
|
|
|
|
|
|
|
// };
|
|
|
|
|
|
|
|
// template<> class AttributeType<> {
|
|
|
|
|
|
|
|
// public: typedef Type;
|
|
|
|
|
|
|
|
// public: typedef Type Param;
|
|
|
|
|
|
|
|
// };
|
|
|
|
|
|
|
|
|
|
|
|
template<std::string::size_type SIZE> |
|
|
|
template<std::string::size_type SIZE> |
|
|
|
class FixString: public std::string { |
|
|
|
class FixString: public std::string { |
|
|
@ -1208,15 +1214,17 @@ namespace cryptoki { |
|
|
|
} |
|
|
|
} |
|
|
|
@endcode */ |
|
|
|
@endcode */ |
|
|
|
|
|
|
|
|
|
|
|
/*! @todo Not implemented:
|
|
|
|
AttributeList getattributevalue(const AttributeTypeList& attributes) { |
|
|
|
@code |
|
|
|
AttributeList res; |
|
|
|
bool getattributevalue() { |
|
|
|
for (AttributeTypeList::const_iterator it(attributes.begin()); |
|
|
|
|
|
|
|
it!=attributes.end(); ++it) |
|
|
|
|
|
|
|
res.push_back((CK_ATTRIBUTE){*it, 0, 0}); |
|
|
|
//! calls @c C_GetAttributeValue
|
|
|
|
//! calls @c C_GetAttributeValue
|
|
|
|
return check(_session._slot._init->_fn->C_GetAttributeValue(_session, CK_OBJECT_HANDLE, |
|
|
|
// return check(_session._slot._init->_fn->C_GetAttributeValue(_session, _object,
|
|
|
|
CK_ATTRIBUTE_PTR, CK_ULONG), |
|
|
|
// CK_ATTRIBUTE_PTR, CK_ULONG),
|
|
|
|
CRYPTOKI_FN_LOG("C_GetAttributeValue")); |
|
|
|
// CRYPTOKI_FN_LOG("C_GetAttributeValue"));
|
|
|
|
|
|
|
|
return res; |
|
|
|
} |
|
|
|
} |
|
|
|
@endcode */ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*! @todo Not implemented:
|
|
|
|
/*! @todo Not implemented:
|
|
|
|
@code |
|
|
|
@code |
|
|
|