|
|
@ -62,6 +62,18 @@ namespace cryptoki { |
|
|
|
return data; |
|
|
|
return data; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
inline std::string string(CK_ULONG num) { |
|
|
|
|
|
|
|
switch (num) { |
|
|
|
|
|
|
|
case CK_UNAVAILABLE_INFORMATION: return "-"; |
|
|
|
|
|
|
|
case CK_EFFECTIVELY_INFINITE: return "∞"; |
|
|
|
|
|
|
|
default: { |
|
|
|
|
|
|
|
std::stringstream ss; |
|
|
|
|
|
|
|
ss<<num; |
|
|
|
|
|
|
|
return ss.str(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
template <int NUM, typename TYPE> std::vector<TYPE> toVector(TYPE in[NUM]) { |
|
|
|
template <int NUM, typename TYPE> std::vector<TYPE> toVector(TYPE in[NUM]) { |
|
|
|
return std::vector<TYPE>(in, in+NUM); |
|
|
|
return std::vector<TYPE>(in, in+NUM); |
|
|
|
} |
|
|
|
} |
|
|
|