|
|
@ -36,7 +36,7 @@ namespace cryptoki { |
|
|
|
#define UNDEF_CRYPTOKI_FN_LOG |
|
|
|
#define UNDEF_CRYPTOKI_FN_LOG |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
std::string hex(const std::string& data) { |
|
|
|
inline std::string hex(const std::string& data) { |
|
|
|
std::stringstream res; |
|
|
|
std::stringstream res; |
|
|
|
for (std::string::const_iterator it(data.begin()); it!=data.end(); ++it) |
|
|
|
for (std::string::const_iterator it(data.begin()); it!=data.end(); ++it) |
|
|
|
res<<std::hex<<std::setfill('0')<<std::setw(2) |
|
|
|
res<<std::hex<<std::setfill('0')<<std::setw(2) |
|
|
@ -55,7 +55,7 @@ namespace cryptoki { |
|
|
|
static const std::string VALID_CHARS |
|
|
|
static const std::string VALID_CHARS |
|
|
|
(LETTER_CHARS+NUMBER_CHARS+GRAFIC_CHARS+BLANK_CHARS); |
|
|
|
(LETTER_CHARS+NUMBER_CHARS+GRAFIC_CHARS+BLANK_CHARS); |
|
|
|
|
|
|
|
|
|
|
|
std::string readable(const std::string& data) { |
|
|
|
inline std::string readable(const std::string& data) { |
|
|
|
if (data.find_first_not_of(VALID_CHARS)<data.size()) |
|
|
|
if (data.find_first_not_of(VALID_CHARS)<data.size()) |
|
|
|
return hex(data); |
|
|
|
return hex(data); |
|
|
|
else |
|
|
|
else |
|
|
@ -263,209 +263,209 @@ namespace cryptoki { |
|
|
|
CK_FLAGS flags; |
|
|
|
CK_FLAGS flags; |
|
|
|
MechanismInfo(CK_MECHANISM_TYPE type): id(type) { |
|
|
|
MechanismInfo(CK_MECHANISM_TYPE type): id(type) { |
|
|
|
switch (id) { |
|
|
|
switch (id) { |
|
|
|
case CKM_RSA_PKCS_KEY_PAIR_GEN: name="CKM_RSA_PKCS_KEY_PAIR_GEN"; break; |
|
|
|
case CKM_RSA_PKCS_KEY_PAIR_GEN: name="RSA_PKCS_KEY_PAIR_GEN"; break; |
|
|
|
case CKM_RSA_PKCS: name="CKM_RSA_PKCS"; break; |
|
|
|
case CKM_RSA_PKCS: name="RSA_PKCS"; break; |
|
|
|
case CKM_RSA_9796: name="CKM_RSA_9796"; break; |
|
|
|
case CKM_RSA_9796: name="RSA_9796"; break; |
|
|
|
case CKM_RSA_X_509: name="CKM_RSA_X_509"; break; |
|
|
|
case CKM_RSA_X_509: name="RSA_X_509"; break; |
|
|
|
case CKM_MD2_RSA_PKCS: name="CKM_MD2_RSA_PKCS"; break; |
|
|
|
case CKM_MD2_RSA_PKCS: name="MD2_RSA_PKCS"; break; |
|
|
|
case CKM_MD5_RSA_PKCS: name="CKM_MD5_RSA_PKCS"; break; |
|
|
|
case CKM_MD5_RSA_PKCS: name="MD5_RSA_PKCS"; break; |
|
|
|
case CKM_SHA1_RSA_PKCS: name="CKM_SHA1_RSA_PKCS"; break; |
|
|
|
case CKM_SHA1_RSA_PKCS: name="SHA1_RSA_PKCS"; break; |
|
|
|
case CKM_RIPEMD128_RSA_PKCS: name="CKM_RIPEMD128_RSA_PKCS"; break; |
|
|
|
case CKM_RIPEMD128_RSA_PKCS: name="RIPEMD128_RSA_PKCS"; break; |
|
|
|
case CKM_RIPEMD160_RSA_PKCS: name="CKM_RIPEMD160_RSA_PKCS"; break; |
|
|
|
case CKM_RIPEMD160_RSA_PKCS: name="RIPEMD160_RSA_PKCS"; break; |
|
|
|
case CKM_RSA_PKCS_OAEP: name="CKM_RSA_PKCS_OAEP"; break; |
|
|
|
case CKM_RSA_PKCS_OAEP: name="RSA_PKCS_OAEP"; break; |
|
|
|
case CKM_RSA_X9_31_KEY_PAIR_GEN: name="CKM_RSA_X9_31_KEY_PAIR_GEN"; break; |
|
|
|
case CKM_RSA_X9_31_KEY_PAIR_GEN: name="RSA_X9_31_KEY_PAIR_GEN"; break; |
|
|
|
case CKM_RSA_X9_31: name="CKM_RSA_X9_31"; break; |
|
|
|
case CKM_RSA_X9_31: name="RSA_X9_31"; break; |
|
|
|
case CKM_SHA1_RSA_X9_31: name="CKM_SHA1_RSA_X9_31"; break; |
|
|
|
case CKM_SHA1_RSA_X9_31: name="SHA1_RSA_X9_31"; break; |
|
|
|
case CKM_RSA_PKCS_PSS: name="CKM_RSA_PKCS_PSS"; break; |
|
|
|
case CKM_RSA_PKCS_PSS: name="RSA_PKCS_PSS"; break; |
|
|
|
case CKM_SHA1_RSA_PKCS_PSS: name="CKM_SHA1_RSA_PKCS_PSS"; break; |
|
|
|
case CKM_SHA1_RSA_PKCS_PSS: name="SHA1_RSA_PKCS_PSS"; break; |
|
|
|
case CKM_DSA_KEY_PAIR_GEN: name="CKM_DSA_KEY_PAIR_GEN"; break; |
|
|
|
case CKM_DSA_KEY_PAIR_GEN: name="DSA_KEY_PAIR_GEN"; break; |
|
|
|
case CKM_DSA: name="CKM_DSA"; break; |
|
|
|
case CKM_DSA: name="DSA"; break; |
|
|
|
case CKM_DSA_SHA1: name="CKM_DSA_SHA1"; break; |
|
|
|
case CKM_DSA_SHA1: name="DSA_SHA1"; break; |
|
|
|
case CKM_DH_PKCS_KEY_PAIR_GEN: name="CKM_DH_PKCS_KEY_PAIR_GEN"; break; |
|
|
|
case CKM_DH_PKCS_KEY_PAIR_GEN: name="DH_PKCS_KEY_PAIR_GEN"; break; |
|
|
|
case CKM_DH_PKCS_DERIVE: name="CKM_DH_PKCS_DERIVE"; break; |
|
|
|
case CKM_DH_PKCS_DERIVE: name="DH_PKCS_DERIVE"; break; |
|
|
|
case CKM_X9_42_DH_KEY_PAIR_GEN: name="CKM_X9_42_DH_KEY_PAIR_GEN"; break; |
|
|
|
case CKM_X9_42_DH_KEY_PAIR_GEN: name="X9_42_DH_KEY_PAIR_GEN"; break; |
|
|
|
case CKM_X9_42_DH_DERIVE: name="CKM_X9_42_DH_DERIVE"; break; |
|
|
|
case CKM_X9_42_DH_DERIVE: name="X9_42_DH_DERIVE"; break; |
|
|
|
case CKM_X9_42_DH_HYBRID_DERIVE: name="CKM_X9_42_DH_HYBRID_DERIVE"; break; |
|
|
|
case CKM_X9_42_DH_HYBRID_DERIVE: name="X9_42_DH_HYBRID_DERIVE"; break; |
|
|
|
case CKM_X9_42_MQV_DERIVE: name="CKM_X9_42_MQV_DERIVE"; break; |
|
|
|
case CKM_X9_42_MQV_DERIVE: name="X9_42_MQV_DERIVE"; break; |
|
|
|
case CKM_SHA256_RSA_PKCS: name="CKM_SHA256_RSA_PKCS"; break; |
|
|
|
case CKM_SHA256_RSA_PKCS: name="SHA256_RSA_PKCS"; break; |
|
|
|
case CKM_RC2_KEY_GEN: name="CKM_RC2_KEY_GEN"; break; |
|
|
|
case CKM_RC2_KEY_GEN: name="RC2_KEY_GEN"; break; |
|
|
|
case CKM_RC2_ECB: name="CKM_RC2_ECB"; break; |
|
|
|
case CKM_RC2_ECB: name="RC2_ECB"; break; |
|
|
|
case CKM_RC2_CBC: name="CKM_RC2_CBC"; break; |
|
|
|
case CKM_RC2_CBC: name="RC2_CBC"; break; |
|
|
|
case CKM_RC2_MAC: name="CKM_RC2_MAC"; break; |
|
|
|
case CKM_RC2_MAC: name="RC2_MAC"; break; |
|
|
|
case CKM_RC2_MAC_GENERAL: name="CKM_RC2_MAC_GENERAL"; break; |
|
|
|
case CKM_RC2_MAC_GENERAL: name="RC2_MAC_GENERAL"; break; |
|
|
|
case CKM_RC2_CBC_PAD: name="CKM_RC2_CBC_PAD"; break; |
|
|
|
case CKM_RC2_CBC_PAD: name="RC2_CBC_PAD"; break; |
|
|
|
case CKM_RC4_KEY_GEN: name="CKM_RC4_KEY_GEN"; break; |
|
|
|
case CKM_RC4_KEY_GEN: name="RC4_KEY_GEN"; break; |
|
|
|
case CKM_RC4: name="CKM_RC4"; break; |
|
|
|
case CKM_RC4: name="RC4"; break; |
|
|
|
case CKM_DES_KEY_GEN: name="CKM_DES_KEY_GEN"; break; |
|
|
|
case CKM_DES_KEY_GEN: name="DES_KEY_GEN"; break; |
|
|
|
case CKM_DES_ECB: name="CKM_DES_ECB"; break; |
|
|
|
case CKM_DES_ECB: name="DES_ECB"; break; |
|
|
|
case CKM_DES_CBC: name="CKM_DES_CBC"; break; |
|
|
|
case CKM_DES_CBC: name="DES_CBC"; break; |
|
|
|
case CKM_DES_MAC: name="CKM_DES_MAC"; break; |
|
|
|
case CKM_DES_MAC: name="DES_MAC"; break; |
|
|
|
case CKM_DES_MAC_GENERAL: name="CKM_DES_MAC_GENERAL"; break; |
|
|
|
case CKM_DES_MAC_GENERAL: name="DES_MAC_GENERAL"; break; |
|
|
|
case CKM_DES_CBC_PAD: name="CKM_DES_CBC_PAD"; break; |
|
|
|
case CKM_DES_CBC_PAD: name="DES_CBC_PAD"; break; |
|
|
|
case CKM_DES2_KEY_GEN: name="CKM_DES2_KEY_GEN"; break; |
|
|
|
case CKM_DES2_KEY_GEN: name="DES2_KEY_GEN"; break; |
|
|
|
case CKM_DES3_KEY_GEN: name="CKM_DES3_KEY_GEN"; break; |
|
|
|
case CKM_DES3_KEY_GEN: name="DES3_KEY_GEN"; break; |
|
|
|
case CKM_DES3_ECB: name="CKM_DES3_ECB"; break; |
|
|
|
case CKM_DES3_ECB: name="DES3_ECB"; break; |
|
|
|
case CKM_DES3_CBC: name="CKM_DES3_CBC"; break; |
|
|
|
case CKM_DES3_CBC: name="DES3_CBC"; break; |
|
|
|
case CKM_DES3_MAC: name="CKM_DES3_MAC"; break; |
|
|
|
case CKM_DES3_MAC: name="DES3_MAC"; break; |
|
|
|
case CKM_DES3_MAC_GENERAL: name="CKM_DES3_MAC_GENERAL"; break; |
|
|
|
case CKM_DES3_MAC_GENERAL: name="DES3_MAC_GENERAL"; break; |
|
|
|
case CKM_DES3_CBC_PAD: name="CKM_DES3_CBC_PAD"; break; |
|
|
|
case CKM_DES3_CBC_PAD: name="DES3_CBC_PAD"; break; |
|
|
|
case CKM_CDMF_KEY_GEN: name="CKM_CDMF_KEY_GEN"; break; |
|
|
|
case CKM_CDMF_KEY_GEN: name="CDMF_KEY_GEN"; break; |
|
|
|
case CKM_CDMF_ECB: name="CKM_CDMF_ECB"; break; |
|
|
|
case CKM_CDMF_ECB: name="CDMF_ECB"; break; |
|
|
|
case CKM_CDMF_CBC: name="CKM_CDMF_CBC"; break; |
|
|
|
case CKM_CDMF_CBC: name="CDMF_CBC"; break; |
|
|
|
case CKM_CDMF_MAC: name="CKM_CDMF_MAC"; break; |
|
|
|
case CKM_CDMF_MAC: name="CDMF_MAC"; break; |
|
|
|
case CKM_CDMF_MAC_GENERAL: name="CKM_CDMF_MAC_GENERAL"; break; |
|
|
|
case CKM_CDMF_MAC_GENERAL: name="CDMF_MAC_GENERAL"; break; |
|
|
|
case CKM_CDMF_CBC_PAD: name="CKM_CDMF_CBC_PAD"; break; |
|
|
|
case CKM_CDMF_CBC_PAD: name="CDMF_CBC_PAD"; break; |
|
|
|
case CKM_MD2: name="CKM_MD2"; break; |
|
|
|
case CKM_MD2: name="MD2"; break; |
|
|
|
case CKM_MD2_HMAC: name="CKM_MD2_HMAC"; break; |
|
|
|
case CKM_MD2_HMAC: name="MD2_HMAC"; break; |
|
|
|
case CKM_MD2_HMAC_GENERAL: name="CKM_MD2_HMAC_GENERAL"; break; |
|
|
|
case CKM_MD2_HMAC_GENERAL: name="MD2_HMAC_GENERAL"; break; |
|
|
|
case CKM_MD5: name="CKM_MD5"; break; |
|
|
|
case CKM_MD5: name="MD5"; break; |
|
|
|
case CKM_MD5_HMAC: name="CKM_MD5_HMAC"; break; |
|
|
|
case CKM_MD5_HMAC: name="MD5_HMAC"; break; |
|
|
|
case CKM_MD5_HMAC_GENERAL: name="CKM_MD5_HMAC_GENERAL"; break; |
|
|
|
case CKM_MD5_HMAC_GENERAL: name="MD5_HMAC_GENERAL"; break; |
|
|
|
case CKM_SHA_1: name="CKM_SHA_1"; break; |
|
|
|
case CKM_SHA_1: name="SHA_1"; break; |
|
|
|
case CKM_SHA_1_HMAC: name="CKM_SHA_1_HMAC"; break; |
|
|
|
case CKM_SHA_1_HMAC: name="SHA_1_HMAC"; break; |
|
|
|
case CKM_SHA_1_HMAC_GENERAL: name="CKM_SHA_1_HMAC_GENERAL"; break; |
|
|
|
case CKM_SHA_1_HMAC_GENERAL: name="SHA_1_HMAC_GENERAL"; break; |
|
|
|
case CKM_RIPEMD128: name="CKM_RIPEMD128"; break; |
|
|
|
case CKM_RIPEMD128: name="RIPEMD128"; break; |
|
|
|
case CKM_RIPEMD128_HMAC: name="CKM_RIPEMD128_HMAC"; break; |
|
|
|
case CKM_RIPEMD128_HMAC: name="RIPEMD128_HMAC"; break; |
|
|
|
case CKM_RIPEMD128_HMAC_GENERAL: name="CKM_RIPEMD128_HMAC_GENERAL"; break; |
|
|
|
case CKM_RIPEMD128_HMAC_GENERAL: name="RIPEMD128_HMAC_GENERAL"; break; |
|
|
|
case CKM_RIPEMD160: name="CKM_RIPEMD160"; break; |
|
|
|
case CKM_RIPEMD160: name="RIPEMD160"; break; |
|
|
|
case CKM_RIPEMD160_HMAC: name="CKM_RIPEMD160_HMAC"; break; |
|
|
|
case CKM_RIPEMD160_HMAC: name="RIPEMD160_HMAC"; break; |
|
|
|
case CKM_RIPEMD160_HMAC_GENERAL: name="CKM_RIPEMD160_HMAC_GENERAL"; break; |
|
|
|
case CKM_RIPEMD160_HMAC_GENERAL: name="RIPEMD160_HMAC_GENERAL"; break; |
|
|
|
case CKM_SHA256: name="CKM_SHA256"; break; |
|
|
|
case CKM_SHA256: name="SHA256"; break; |
|
|
|
case CKM_SHA256_HMAC: name="CKM_SHA256_HMAC"; break; |
|
|
|
case CKM_SHA256_HMAC: name="SHA256_HMAC"; break; |
|
|
|
case CKM_SHA256_HMAC_GENERAL: name="CKM_SHA256_HMAC_GENERAL"; break; |
|
|
|
case CKM_SHA256_HMAC_GENERAL: name="SHA256_HMAC_GENERAL"; break; |
|
|
|
case CKM_SHA384: name="CKM_SHA384"; break; |
|
|
|
case CKM_SHA384: name="SHA384"; break; |
|
|
|
case CKM_SHA384_HMAC: name="CKM_SHA384_HMAC"; break; |
|
|
|
case CKM_SHA384_HMAC: name="SHA384_HMAC"; break; |
|
|
|
case CKM_SHA384_HMAC_GENERAL: name="CKM_SHA384_HMAC_GENERAL"; break; |
|
|
|
case CKM_SHA384_HMAC_GENERAL: name="SHA384_HMAC_GENERAL"; break; |
|
|
|
case CKM_SHA512: name="CKM_SHA512"; break; |
|
|
|
case CKM_SHA512: name="SHA512"; break; |
|
|
|
case CKM_SHA512_HMAC: name="CKM_SHA512_HMAC"; break; |
|
|
|
case CKM_SHA512_HMAC: name="SHA512_HMAC"; break; |
|
|
|
case CKM_SHA512_HMAC_GENERAL: name="CKM_SHA512_HMAC_GENERAL"; break; |
|
|
|
case CKM_SHA512_HMAC_GENERAL: name="SHA512_HMAC_GENERAL"; break; |
|
|
|
case CKM_CAST_KEY_GEN: name="CKM_CAST_KEY_GEN"; break; |
|
|
|
case CKM_CAST_KEY_GEN: name="CAST_KEY_GEN"; break; |
|
|
|
case CKM_CAST_ECB: name="CKM_CAST_ECB"; break; |
|
|
|
case CKM_CAST_ECB: name="CAST_ECB"; break; |
|
|
|
case CKM_CAST_CBC: name="CKM_CAST_CBC"; break; |
|
|
|
case CKM_CAST_CBC: name="CAST_CBC"; break; |
|
|
|
case CKM_CAST_MAC: name="CKM_CAST_MAC"; break; |
|
|
|
case CKM_CAST_MAC: name="CAST_MAC"; break; |
|
|
|
case CKM_CAST_MAC_GENERAL: name="CKM_CAST_MAC_GENERAL"; break; |
|
|
|
case CKM_CAST_MAC_GENERAL: name="CAST_MAC_GENERAL"; break; |
|
|
|
case CKM_CAST_CBC_PAD: name="CKM_CAST_CBC_PAD"; break; |
|
|
|
case CKM_CAST_CBC_PAD: name="CAST_CBC_PAD"; break; |
|
|
|
case CKM_CAST3_KEY_GEN: name="CKM_CAST3_KEY_GEN"; break; |
|
|
|
case CKM_CAST3_KEY_GEN: name="CAST3_KEY_GEN"; break; |
|
|
|
case CKM_CAST3_ECB: name="CKM_CAST3_ECB"; break; |
|
|
|
case CKM_CAST3_ECB: name="CAST3_ECB"; break; |
|
|
|
case CKM_CAST3_CBC: name="CKM_CAST3_CBC"; break; |
|
|
|
case CKM_CAST3_CBC: name="CAST3_CBC"; break; |
|
|
|
case CKM_CAST3_MAC: name="CKM_CAST3_MAC"; break; |
|
|
|
case CKM_CAST3_MAC: name="CAST3_MAC"; break; |
|
|
|
case CKM_CAST3_MAC_GENERAL: name="CKM_CAST3_MAC_GENERAL"; break; |
|
|
|
case CKM_CAST3_MAC_GENERAL: name="CAST3_MAC_GENERAL"; break; |
|
|
|
case CKM_CAST3_CBC_PAD: name="CKM_CAST3_CBC_PAD"; break; |
|
|
|
case CKM_CAST3_CBC_PAD: name="CAST3_CBC_PAD"; break; |
|
|
|
//case CKM_CAST5_KEY_GEN: name="CKM_CAST5_KEY_GEN"; break;
|
|
|
|
//case CKM_CAST5_KEY_GEN: name="CAST5_KEY_GEN"; break;
|
|
|
|
case CKM_CAST128_KEY_GEN: name="CKM_CAST5_KEY_GEN or CKM_CAST128_KEY_GEN"; break; |
|
|
|
case CKM_CAST128_KEY_GEN: name="CAST5_KEY_GEN or CAST128_KEY_GEN"; break; |
|
|
|
//case CKM_CAST5_ECB: name="CKM_CAST5_ECB"; break;
|
|
|
|
//case CKM_CAST5_ECB: name="CAST5_ECB"; break;
|
|
|
|
case CKM_CAST128_ECB: name="CKM_CAST5_ECB or CKM_CAST128_ECB"; break; |
|
|
|
case CKM_CAST128_ECB: name="CAST5_ECB or CAST128_ECB"; break; |
|
|
|
//case CKM_CAST5_CBC: name="CKM_CAST5_CBC"; break;
|
|
|
|
//case CKM_CAST5_CBC: name="CAST5_CBC"; break;
|
|
|
|
case CKM_CAST128_CBC: name="CKM_CAST5_CBC or CKM_CAST128_CBC"; break; |
|
|
|
case CKM_CAST128_CBC: name="CAST5_CBC or CAST128_CBC"; break; |
|
|
|
//case CKM_CAST5_MAC: name="CKM_CAST5_MAC"; break;
|
|
|
|
//case CKM_CAST5_MAC: name="CAST5_MAC"; break;
|
|
|
|
case CKM_CAST128_MAC: name="CKM_CAST5_MAC or CKM_CAST128_MAC"; break; |
|
|
|
case CKM_CAST128_MAC: name="CAST5_MAC or CAST128_MAC"; break; |
|
|
|
//case CKM_CAST5_MAC_GENERAL: name="CKM_CAST5_MAC_GENERAL"; break;
|
|
|
|
//case CKM_CAST5_MAC_GENERAL: name="CAST5_MAC_GENERAL"; break;
|
|
|
|
case CKM_CAST128_MAC_GENERAL: |
|
|
|
case CKM_CAST128_MAC_GENERAL: |
|
|
|
name="CKM_CAST5_MAC_GENERAL or CKM_CAST128_MAC_GENERAL"; break; |
|
|
|
name="CAST5_MAC_GENERAL or CAST128_MAC_GENERAL"; break; |
|
|
|
//case CKM_CAST5_CBC_PAD: name="CKM_CAST5_CBC_PAD"; break;
|
|
|
|
//case CKM_CAST5_CBC_PAD: name="CAST5_CBC_PAD"; break;
|
|
|
|
case CKM_CAST128_CBC_PAD: name="CKM_CAST5_CBC_PAD or CKM_CAST128_CBC_PAD"; break; |
|
|
|
case CKM_CAST128_CBC_PAD: name="CAST5_CBC_PAD or CAST128_CBC_PAD"; break; |
|
|
|
case CKM_RC5_KEY_GEN: name="CKM_RC5_KEY_GEN"; break; |
|
|
|
case CKM_RC5_KEY_GEN: name="RC5_KEY_GEN"; break; |
|
|
|
case CKM_RC5_ECB: name="CKM_RC5_ECB"; break; |
|
|
|
case CKM_RC5_ECB: name="RC5_ECB"; break; |
|
|
|
case CKM_RC5_CBC: name="CKM_RC5_CBC"; break; |
|
|
|
case CKM_RC5_CBC: name="RC5_CBC"; break; |
|
|
|
case CKM_RC5_MAC: name="CKM_RC5_MAC"; break; |
|
|
|
case CKM_RC5_MAC: name="RC5_MAC"; break; |
|
|
|
case CKM_RC5_MAC_GENERAL: name="CKM_RC5_MAC_GENERAL"; break; |
|
|
|
case CKM_RC5_MAC_GENERAL: name="RC5_MAC_GENERAL"; break; |
|
|
|
case CKM_RC5_CBC_PAD: name="CKM_RC5_CBC_PAD"; break; |
|
|
|
case CKM_RC5_CBC_PAD: name="RC5_CBC_PAD"; break; |
|
|
|
case CKM_IDEA_KEY_GEN: name="CKM_IDEA_KEY_GEN"; break; |
|
|
|
case CKM_IDEA_KEY_GEN: name="IDEA_KEY_GEN"; break; |
|
|
|
case CKM_IDEA_ECB: name="CKM_IDEA_ECB"; break; |
|
|
|
case CKM_IDEA_ECB: name="IDEA_ECB"; break; |
|
|
|
case CKM_IDEA_CBC: name="CKM_IDEA_CBC"; break; |
|
|
|
case CKM_IDEA_CBC: name="IDEA_CBC"; break; |
|
|
|
case CKM_IDEA_MAC: name="CKM_IDEA_MAC"; break; |
|
|
|
case CKM_IDEA_MAC: name="IDEA_MAC"; break; |
|
|
|
case CKM_IDEA_MAC_GENERAL: name="CKM_IDEA_MAC_GENERAL"; break; |
|
|
|
case CKM_IDEA_MAC_GENERAL: name="IDEA_MAC_GENERAL"; break; |
|
|
|
case CKM_IDEA_CBC_PAD: name="CKM_IDEA_CBC_PAD"; break; |
|
|
|
case CKM_IDEA_CBC_PAD: name="IDEA_CBC_PAD"; break; |
|
|
|
case CKM_GENERIC_SECRET_KEY_GEN: name="CKM_GENERIC_SECRET_KEY_GEN"; break; |
|
|
|
case CKM_GENERIC_SECRET_KEY_GEN: name="GENERIC_SECRET_KEY_GEN"; break; |
|
|
|
case CKM_CONCATENATE_BASE_AND_KEY: |
|
|
|
case CKM_CONCATENATE_BASE_AND_KEY: |
|
|
|
name="CKM_CONCATENATE_BASE_AND_KEY"; break; |
|
|
|
name="CONCATENATE_BASE_AND_KEY"; break; |
|
|
|
case CKM_CONCATENATE_BASE_AND_DATA: |
|
|
|
case CKM_CONCATENATE_BASE_AND_DATA: |
|
|
|
name="CKM_CONCATENATE_BASE_AND_DATA"; break; |
|
|
|
name="CONCATENATE_BASE_AND_DATA"; break; |
|
|
|
case CKM_CONCATENATE_DATA_AND_BASE: |
|
|
|
case CKM_CONCATENATE_DATA_AND_BASE: |
|
|
|
name="CKM_CONCATENATE_DATA_AND_BASE"; break; |
|
|
|
name="CONCATENATE_DATA_AND_BASE"; break; |
|
|
|
case CKM_XOR_BASE_AND_DATA: name="CKM_XOR_BASE_AND_DATA"; break; |
|
|
|
case CKM_XOR_BASE_AND_DATA: name="XOR_BASE_AND_DATA"; break; |
|
|
|
case CKM_EXTRACT_KEY_FROM_KEY: name="CKM_EXTRACT_KEY_FROM_KEY"; break; |
|
|
|
case CKM_EXTRACT_KEY_FROM_KEY: name="EXTRACT_KEY_FROM_KEY"; break; |
|
|
|
case CKM_SSL3_PRE_MASTER_KEY_GEN: name="CKM_SSL3_PRE_MASTER_KEY_GEN"; break; |
|
|
|
case CKM_SSL3_PRE_MASTER_KEY_GEN: name="SSL3_PRE_MASTER_KEY_GEN"; break; |
|
|
|
case CKM_SSL3_MASTER_KEY_DERIVE: name="CKM_SSL3_MASTER_KEY_DERIVE"; break; |
|
|
|
case CKM_SSL3_MASTER_KEY_DERIVE: name="SSL3_MASTER_KEY_DERIVE"; break; |
|
|
|
case CKM_SSL3_KEY_AND_MAC_DERIVE: name="CKM_SSL3_KEY_AND_MAC_DERIVE"; break; |
|
|
|
case CKM_SSL3_KEY_AND_MAC_DERIVE: name="SSL3_KEY_AND_MAC_DERIVE"; break; |
|
|
|
case CKM_SSL3_MASTER_KEY_DERIVE_DH: |
|
|
|
case CKM_SSL3_MASTER_KEY_DERIVE_DH: |
|
|
|
name="CKM_SSL3_MASTER_KEY_DERIVE_DH"; break; |
|
|
|
name="SSL3_MASTER_KEY_DERIVE_DH"; break; |
|
|
|
case CKM_TLS_PRE_MASTER_KEY_GEN: name="CKM_TLS_PRE_MASTER_KEY_GEN"; break; |
|
|
|
case CKM_TLS_PRE_MASTER_KEY_GEN: name="TLS_PRE_MASTER_KEY_GEN"; break; |
|
|
|
case CKM_TLS_MASTER_KEY_DERIVE: name="CKM_TLS_MASTER_KEY_DERIVE"; break; |
|
|
|
case CKM_TLS_MASTER_KEY_DERIVE: name="TLS_MASTER_KEY_DERIVE"; break; |
|
|
|
case CKM_TLS_KEY_AND_MAC_DERIVE: name="CKM_TLS_KEY_AND_MAC_DERIVE"; break; |
|
|
|
case CKM_TLS_KEY_AND_MAC_DERIVE: name="TLS_KEY_AND_MAC_DERIVE"; break; |
|
|
|
case CKM_TLS_MASTER_KEY_DERIVE_DH: name="CKM_TLS_MASTER_KEY_DERIVE_DH"; break; |
|
|
|
case CKM_TLS_MASTER_KEY_DERIVE_DH: name="TLS_MASTER_KEY_DERIVE_DH"; break; |
|
|
|
case CKM_SSL3_MD5_MAC: name="CKM_SSL3_MD5_MAC"; break; |
|
|
|
case CKM_SSL3_MD5_MAC: name="SSL3_MD5_MAC"; break; |
|
|
|
case CKM_SSL3_SHA1_MAC: name="CKM_SSL3_SHA1_MAC"; break; |
|
|
|
case CKM_SSL3_SHA1_MAC: name="SSL3_SHA1_MAC"; break; |
|
|
|
case CKM_MD5_KEY_DERIVATION: name="CKM_MD5_KEY_DERIVATION"; break; |
|
|
|
case CKM_MD5_KEY_DERIVATION: name="MD5_KEY_DERIVATION"; break; |
|
|
|
case CKM_MD2_KEY_DERIVATION: name="CKM_MD2_KEY_DERIVATION"; break; |
|
|
|
case CKM_MD2_KEY_DERIVATION: name="MD2_KEY_DERIVATION"; break; |
|
|
|
case CKM_SHA1_KEY_DERIVATION: name="CKM_SHA1_KEY_DERIVATION"; break; |
|
|
|
case CKM_SHA1_KEY_DERIVATION: name="SHA1_KEY_DERIVATION"; break; |
|
|
|
case CKM_SHA256_KEY_DERIVATION: name="CKM_SHA256_KEY_DERIVATION"; break; |
|
|
|
case CKM_SHA256_KEY_DERIVATION: name="SHA256_KEY_DERIVATION"; break; |
|
|
|
case CKM_PBE_MD2_DES_CBC: name="CKM_PBE_MD2_DES_CBC"; break; |
|
|
|
case CKM_PBE_MD2_DES_CBC: name="PBE_MD2_DES_CBC"; break; |
|
|
|
case CKM_PBE_MD5_DES_CBC: name="CKM_PBE_MD5_DES_CBC"; break; |
|
|
|
case CKM_PBE_MD5_DES_CBC: name="PBE_MD5_DES_CBC"; break; |
|
|
|
case CKM_PBE_MD5_CAST_CBC: name="CKM_PBE_MD5_CAST_CBC"; break; |
|
|
|
case CKM_PBE_MD5_CAST_CBC: name="PBE_MD5_CAST_CBC"; break; |
|
|
|
case CKM_PBE_MD5_CAST3_CBC: name="CKM_PBE_MD5_CAST3_CBC"; break; |
|
|
|
case CKM_PBE_MD5_CAST3_CBC: name="PBE_MD5_CAST3_CBC"; break; |
|
|
|
//case CKM_PBE_MD5_CAST5_CBC: name="CKM_PBE_MD5_CAST5_CBC"; break;
|
|
|
|
//case CKM_PBE_MD5_CAST5_CBC: name="PBE_MD5_CAST5_CBC"; break;
|
|
|
|
case CKM_PBE_MD5_CAST128_CBC: |
|
|
|
case CKM_PBE_MD5_CAST128_CBC: |
|
|
|
name="CKM_PBE_MD5_CAST5_CBC or CKM_PBE_MD5_CAST128_CBC"; break; |
|
|
|
name="PBE_MD5_CAST5_CBC or PBE_MD5_CAST128_CBC"; break; |
|
|
|
//case CKM_PBE_SHA1_CAST5_CBC: name="CKM_PBE_SHA1_CAST5_CBC"; break;
|
|
|
|
//case CKM_PBE_SHA1_CAST5_CBC: name="PBE_SHA1_CAST5_CBC"; break;
|
|
|
|
case CKM_PBE_SHA1_CAST128_CBC: |
|
|
|
case CKM_PBE_SHA1_CAST128_CBC: |
|
|
|
name="CKM_PBE_SHA1_CAST5_CBC or CKM_PBE_SHA1_CAST128_CBC"; break; |
|
|
|
name="PBE_SHA1_CAST5_CBC or PBE_SHA1_CAST128_CBC"; break; |
|
|
|
case CKM_PBE_SHA1_RC4_128: name="CKM_PBE_SHA1_RC4_128"; break; |
|
|
|
case CKM_PBE_SHA1_RC4_128: name="PBE_SHA1_RC4_128"; break; |
|
|
|
case CKM_PBE_SHA1_RC4_40: name="CKM_PBE_SHA1_RC4_40"; break; |
|
|
|
case CKM_PBE_SHA1_RC4_40: name="PBE_SHA1_RC4_40"; break; |
|
|
|
case CKM_PBE_SHA1_DES3_EDE_CBC: name="CKM_PBE_SHA1_DES3_EDE_CBC"; break; |
|
|
|
case CKM_PBE_SHA1_DES3_EDE_CBC: name="PBE_SHA1_DES3_EDE_CBC"; break; |
|
|
|
case CKM_PBE_SHA1_DES2_EDE_CBC: name="CKM_PBE_SHA1_DES2_EDE_CBC"; break; |
|
|
|
case CKM_PBE_SHA1_DES2_EDE_CBC: name="PBE_SHA1_DES2_EDE_CBC"; break; |
|
|
|
case CKM_PBE_SHA1_RC2_128_CBC: name="CKM_PBE_SHA1_RC2_128_CBC"; break; |
|
|
|
case CKM_PBE_SHA1_RC2_128_CBC: name="PBE_SHA1_RC2_128_CBC"; break; |
|
|
|
case CKM_PBE_SHA1_RC2_40_CBC: name="CKM_PBE_SHA1_RC2_40_CBC"; break; |
|
|
|
case CKM_PBE_SHA1_RC2_40_CBC: name="PBE_SHA1_RC2_40_CBC"; break; |
|
|
|
case CKM_PKCS5_PBKD2: name="CKM_PKCS5_PBKD2"; break; |
|
|
|
case CKM_PKCS5_PBKD2: name="PKCS5_PBKD2"; break; |
|
|
|
case CKM_PBA_SHA1_WITH_SHA1_HMAC: name="CKM_PBA_SHA1_WITH_SHA1_HMAC"; break; |
|
|
|
case CKM_PBA_SHA1_WITH_SHA1_HMAC: name="PBA_SHA1_WITH_SHA1_HMAC"; break; |
|
|
|
case CKM_KEY_WRAP_LYNKS: name="CKM_KEY_WRAP_LYNKS"; break; |
|
|
|
case CKM_KEY_WRAP_LYNKS: name="KEY_WRAP_LYNKS"; break; |
|
|
|
case CKM_KEY_WRAP_SET_OAEP: name="CKM_KEY_WRAP_SET_OAEP"; break; |
|
|
|
case CKM_KEY_WRAP_SET_OAEP: name="KEY_WRAP_SET_OAEP"; break; |
|
|
|
case CKM_SKIPJACK_KEY_GEN: name="CKM_SKIPJACK_KEY_GEN"; break; |
|
|
|
case CKM_SKIPJACK_KEY_GEN: name="SKIPJACK_KEY_GEN"; break; |
|
|
|
case CKM_SKIPJACK_ECB64: name="CKM_SKIPJACK_ECB64"; break; |
|
|
|
case CKM_SKIPJACK_ECB64: name="SKIPJACK_ECB64"; break; |
|
|
|
case CKM_SKIPJACK_CBC64: name="CKM_SKIPJACK_CBC64"; break; |
|
|
|
case CKM_SKIPJACK_CBC64: name="SKIPJACK_CBC64"; break; |
|
|
|
case CKM_SKIPJACK_OFB64: name="CKM_SKIPJACK_OFB64"; break; |
|
|
|
case CKM_SKIPJACK_OFB64: name="SKIPJACK_OFB64"; break; |
|
|
|
case CKM_SKIPJACK_CFB64: name="CKM_SKIPJACK_CFB64"; break; |
|
|
|
case CKM_SKIPJACK_CFB64: name="SKIPJACK_CFB64"; break; |
|
|
|
case CKM_SKIPJACK_CFB32: name="CKM_SKIPJACK_CFB32"; break; |
|
|
|
case CKM_SKIPJACK_CFB32: name="SKIPJACK_CFB32"; break; |
|
|
|
case CKM_SKIPJACK_CFB16: name="CKM_SKIPJACK_CFB16"; break; |
|
|
|
case CKM_SKIPJACK_CFB16: name="SKIPJACK_CFB16"; break; |
|
|
|
case CKM_SKIPJACK_CFB8: name="CKM_SKIPJACK_CFB8"; break; |
|
|
|
case CKM_SKIPJACK_CFB8: name="SKIPJACK_CFB8"; break; |
|
|
|
case CKM_SKIPJACK_WRAP: name="CKM_SKIPJACK_WRAP"; break; |
|
|
|
case CKM_SKIPJACK_WRAP: name="SKIPJACK_WRAP"; break; |
|
|
|
case CKM_SKIPJACK_PRIVATE_WRAP: name="CKM_SKIPJACK_PRIVATE_WRAP"; break; |
|
|
|
case CKM_SKIPJACK_PRIVATE_WRAP: name="SKIPJACK_PRIVATE_WRAP"; break; |
|
|
|
case CKM_SKIPJACK_RELAYX: name="CKM_SKIPJACK_RELAYX"; break; |
|
|
|
case CKM_SKIPJACK_RELAYX: name="SKIPJACK_RELAYX"; break; |
|
|
|
case CKM_KEA_KEY_PAIR_GEN: name="CKM_KEA_KEY_PAIR_GEN"; break; |
|
|
|
case CKM_KEA_KEY_PAIR_GEN: name="KEA_KEY_PAIR_GEN"; break; |
|
|
|
case CKM_KEA_KEY_DERIVE: name="CKM_KEA_KEY_DERIVE"; break; |
|
|
|
case CKM_KEA_KEY_DERIVE: name="KEA_KEY_DERIVE"; break; |
|
|
|
case CKM_FORTEZZA_TIMESTAMP: name="CKM_FORTEZZA_TIMESTAMP"; break; |
|
|
|
case CKM_FORTEZZA_TIMESTAMP: name="FORTEZZA_TIMESTAMP"; break; |
|
|
|
case CKM_BATON_KEY_GEN: name="CKM_BATON_KEY_GEN"; break; |
|
|
|
case CKM_BATON_KEY_GEN: name="BATON_KEY_GEN"; break; |
|
|
|
case CKM_BATON_ECB128: name="CKM_BATON_ECB128"; break; |
|
|
|
case CKM_BATON_ECB128: name="BATON_ECB128"; break; |
|
|
|
case CKM_BATON_ECB96: name="CKM_BATON_ECB96"; break; |
|
|
|
case CKM_BATON_ECB96: name="BATON_ECB96"; break; |
|
|
|
case CKM_BATON_CBC128: name="CKM_BATON_CBC128"; break; |
|
|
|
case CKM_BATON_CBC128: name="BATON_CBC128"; break; |
|
|
|
case CKM_BATON_COUNTER: name="CKM_BATON_COUNTER"; break; |
|
|
|
case CKM_BATON_COUNTER: name="BATON_COUNTER"; break; |
|
|
|
case CKM_BATON_SHUFFLE: name="CKM_BATON_SHUFFLE"; break; |
|
|
|
case CKM_BATON_SHUFFLE: name="BATON_SHUFFLE"; break; |
|
|
|
case CKM_BATON_WRAP: name="CKM_BATON_WRAP"; break; |
|
|
|
case CKM_BATON_WRAP: name="BATON_WRAP"; break; |
|
|
|
//case CKM_ECDSA_KEY_PAIR_GEN: name="CKM_ECDSA_KEY_PAIR_GEN"; break;
|
|
|
|
//case CKM_ECDSA_KEY_PAIR_GEN: name="ECDSA_KEY_PAIR_GEN"; break;
|
|
|
|
case CKM_EC_KEY_PAIR_GEN: |
|
|
|
case CKM_EC_KEY_PAIR_GEN: |
|
|
|
name="CKM_ECDSA_KEY_PAIR_GEN or CKM_EC_KEY_PAIR_GEN"; break; |
|
|
|
name="ECDSA_KEY_PAIR_GEN or EC_KEY_PAIR_GEN"; break; |
|
|
|
case CKM_ECDSA: name="CKM_ECDSA"; break; |
|
|
|
case CKM_ECDSA: name="ECDSA"; break; |
|
|
|
case CKM_ECDSA_SHA1: name="CKM_ECDSA_SHA1"; break; |
|
|
|
case CKM_ECDSA_SHA1: name="ECDSA_SHA1"; break; |
|
|
|
case CKM_ECDH1_DERIVE: name="CKM_ECDH1_DERIVE"; break; |
|
|
|
case CKM_ECDH1_DERIVE: name="ECDH1_DERIVE"; break; |
|
|
|
case CKM_ECDH1_COFACTOR_DERIVE: name="CKM_ECDH1_COFACTOR_DERIVE"; break; |
|
|
|
case CKM_ECDH1_COFACTOR_DERIVE: name="ECDH1_COFACTOR_DERIVE"; break; |
|
|
|
case CKM_ECMQV_DERIVE: name="CKM_ECMQV_DERIVE"; break; |
|
|
|
case CKM_ECMQV_DERIVE: name="ECMQV_DERIVE"; break; |
|
|
|
case CKM_JUNIPER_KEY_GEN: name="CKM_JUNIPER_KEY_GEN"; break; |
|
|
|
case CKM_JUNIPER_KEY_GEN: name="JUNIPER_KEY_GEN"; break; |
|
|
|
case CKM_JUNIPER_ECB128: name="CKM_JUNIPER_ECB128"; break; |
|
|
|
case CKM_JUNIPER_ECB128: name="JUNIPER_ECB128"; break; |
|
|
|
case CKM_JUNIPER_CBC128: name="CKM_JUNIPER_CBC128"; break; |
|
|
|
case CKM_JUNIPER_CBC128: name="JUNIPER_CBC128"; break; |
|
|
|
case CKM_JUNIPER_COUNTER: name="CKM_JUNIPER_COUNTER"; break; |
|
|
|
case CKM_JUNIPER_COUNTER: name="JUNIPER_COUNTER"; break; |
|
|
|
case CKM_JUNIPER_SHUFFLE: name="CKM_JUNIPER_SHUFFLE"; break; |
|
|
|
case CKM_JUNIPER_SHUFFLE: name="JUNIPER_SHUFFLE"; break; |
|
|
|
case CKM_JUNIPER_WRAP: name="CKM_JUNIPER_WRAP"; break; |
|
|
|
case CKM_JUNIPER_WRAP: name="JUNIPER_WRAP"; break; |
|
|
|
case CKM_FASTHASH: name="CKM_FASTHASH"; break; |
|
|
|
case CKM_FASTHASH: name="FASTHASH"; break; |
|
|
|
case CKM_AES_KEY_GEN: name="CKM_AES_KEY_GEN"; break; |
|
|
|
case CKM_AES_KEY_GEN: name="AES_KEY_GEN"; break; |
|
|
|
case CKM_AES_ECB: name="CKM_AES_ECB"; break; |
|
|
|
case CKM_AES_ECB: name="AES_ECB"; break; |
|
|
|
case CKM_AES_CBC: name="CKM_AES_CBC"; break; |
|
|
|
case CKM_AES_CBC: name="AES_CBC"; break; |
|
|
|
case CKM_AES_MAC: name="CKM_AES_MAC"; break; |
|
|
|
case CKM_AES_MAC: name="AES_MAC"; break; |
|
|
|
case CKM_AES_MAC_GENERAL: name="CKM_AES_MAC_GENERAL"; break; |
|
|
|
case CKM_AES_MAC_GENERAL: name="AES_MAC_GENERAL"; break; |
|
|
|
case CKM_AES_CBC_PAD: name="CKM_AES_CBC_PAD"; break; |
|
|
|
case CKM_AES_CBC_PAD: name="AES_CBC_PAD"; break; |
|
|
|
case CKM_DSA_PARAMETER_GEN: name="CKM_DSA_PARAMETER_GEN"; break; |
|
|
|
case CKM_DSA_PARAMETER_GEN: name="DSA_PARAMETER_GEN"; break; |
|
|
|
case CKM_DH_PKCS_PARAMETER_GEN: name="CKM_DH_PKCS_PARAMETER_GEN"; break; |
|
|
|
case CKM_DH_PKCS_PARAMETER_GEN: name="DH_PKCS_PARAMETER_GEN"; break; |
|
|
|
case CKM_X9_42_DH_PARAMETER_GEN: name="CKM_X9_42_DH_PARAMETER_GEN"; break; |
|
|
|
case CKM_X9_42_DH_PARAMETER_GEN: name="X9_42_DH_PARAMETER_GEN"; break; |
|
|
|
case CKM_VENDOR_DEFINED: name="CKM_VENDOR_DEFINED"; break; |
|
|
|
case CKM_VENDOR_DEFINED: name="VENDOR_DEFINED"; break; |
|
|
|
default: { |
|
|
|
default: { |
|
|
|
std::stringstream ss; |
|
|
|
std::stringstream ss; |
|
|
|
ss<<"unknown mechanism: "<<id; |
|
|
|
ss<<"unknown mechanism: "<<id; |
|
|
|