/************************************************************************/
/* 错误码宏定义 */
/************************************************************************/
#define CFCA_CKR_SUCCESS 0 //成功
#define CFCA_ERR_CONFIGINI_OPEN -810001 //打开配置文件失败
#define CFCA_ERR_ENCDEVINI_GETITEM -810002 //获取ini文件具体值失败
#define CFCA_CKR_MEMORY_ERROR -810003 //内存错误
#define CFCA_CKR_DEVICETYPE_ERROR -810004 //加密设备类型错误
#define CFCA_CKR_LOAD_DLL -810005 //载入dll失败
#define CFCA_CKR_MECHANISM_INVALID -810011 //无效的机制
#define CFCA_CKR_MECHANISM_PARAM_INVALID -810012 //无效的机制参数
#define CFCA_CKR_KEY_INVALID -810021 //无效的密钥
#define CFCA_CKR_KEY_SIZE_RANGE -810022 //密钥的长度错误
#define CFCA_CKR_KEY_TYPE_INCONSISTENT -810023 //密钥类型矛盾
#define CFCA_CKR_NOT_PARALLEL -810031 //不能并行
#define CFCA_CKR_BUFFER_TOO_SMALL -810032 //分配的空间小
#define CFCA_CKR_MUTEX_BAD -810033 //互斥体坏
#define CFCA_CKR_CRYPTOKI_NOT_INITIALIZED -810041 //加密库未初始化
#define CFCA_CKR_CRYPTOKI_ERROR_INITIALIZED -810042 //加密库初始化错误
#define CFCA_CKR_PARAM_INVALID -810051 //参数错误
#define CFCA_CKR_DATA_INVALID -810052 //数据无效
#define CFCA_CKR_DATA_LEN_RANGE -810053 //数据长度错误
//add by mhl 2008.9.24
#define CFCA_CKR_FILEOPEN_FAILD -810054 //打开文件失败或文件不存在
#define CFCA_CKR_VERIFYLICENS_FAILD -810055 //验证LICENSE文件失败,文件可能被改动
#define CFCA_CKR_IP_INFO -810056 //获取IP信息失败
#define CFCA_VALIDATE_NOT_NULL -810057 //有效期不可以为空
#define CFCA_IP_NOT_NULL -810058 //IP不可以为空
#define CFCA_IP_ERR -810059 //IP不符
#define CFCA_VALIDATE_ERR -810060 //有效期过期
#define CFCA_CRL_LDAP_ERR -810061 //证书不含有LDAP方式的CRL
分布点,不支持在线验证。
//end add
#define CFCA_CKR_ENCRYPTED_DATA_INVALID -810101 //加密的数据无效
#define CFCA_CKR_ENCRYPTED_DATA_LEN_RANGE -810102 //加密的数据长度错误
#define CFCA_CKR_ENCRYPTED_ERRINIT -810103 //流加密初始化错误
#define CFCA_CKR_ENCRYPTED_ERRUPDATE -810104 //流加密更新数据错误
#define CFCA_CKR_ENCRYPTED_ERRFINAL -810105 //流加密结束错误
#define CFCA_CKR_DECRYPTED_DATA_INVALID -810201 //解密的数据无效
#define CFCA_CKR_DECRYPTED_DATA_LEN_RANGE -810202 //解密的数据长度错误
#define CFCA_CKR_DECRYPTED_ERRINIT -810203 //流解密初始化错误
#define CFCA_CKR_DECRYPTED_ERRUPDATE -810204 //流解密更新数据错误
#define CFCA_CKR_DECRYPTED_ERRFINAL -810205 //流解密结束错误
#define CFCA_CKR_MAC_INVALID -810301 //MAC无效
#define CFCA_CKR_MAC_LEN_RANGE -810302 //MAC的长度无效
#define CFCA_CKR_DIGEST_ERRINIT -810303 //流摘要初始化错误
#define CFCA_CKR_DIGEST_ERRUPDATE -810304 //流摘要更新数据错误
#define CFCA_CKR_DIGEST_ERRFINAL -810305 //流摘要结束数据错误
#define CFCA_CKR_SIGNATURE_INVALID -810401 //签名无效
#define CFCA_CKR_SIGNATURE_LEN_RANGE -810402 //签名长度无效
#define CFCA_CKR_HASH_ERROR -810403 //软算法MD2、DM5或SHA1产生HASH错误
#define CFCA_CKR_SIGNATURE_ERRINIT -810404 //流签名初始化错误
#define CFCA_CKR_SIGNATURE_ERRUPDATE -810405 //流签名更新数据错误
#define CFCA_CKR_SIGNATURE_ERRFINAL -810406 //流签名结束错误
#define CFCA_CKR_VERIFY_INVALID -810501 //验证无效
#define CFCA_CKR_VERIFY_LEN_RANGE -810502 //验证长度无效
#define CFCA_CKR_VERIFY_ERRINIT -810503 //流验证签名初始化错误
#define CFCA_CKR_VERIFY_ERRUPDATE -810504 //流验证签名更新数据快
错误
#define CFCA_CKR_GENERATE_KEY -810601 //产生对称密钥错误
#define CFCA_CKR_GENERATE_KEYPAIR -810602 //产生非对称密钥错误
#define CFCA_CKR_SESSION_COUNT -810701 //会话超出总数
#define CFCA_CKR_SESSION_HANDLE_INVALID -810702 //无效的会话句柄
//设备错误
#define CFCA_CKR_DEVICEID_INVALID -811001 //无效的设备ID
//硬件错误
#define CFCA_CKR_SLOT_ID_INVALID -812001 //SLOTID无效
#define CFCA_CKR_HARDDEVICE_NOTSUPPORT -812002 //不支持硬件设备加密
#define CFCA_CKR_PIN_INVALID -812003 //无效的PIN
#define CFCA_CKR_PIN_LEN_RANGE -812004 //无效的PIN的长度
#define CFCA_CKR_FUNCTIONLISTPTR_NULL -812005 //P11函数列表为空
#define CFCA_CKR_FUNCTIONPTR_NULL -812006 //P11函数指针为空
#define CFCA_CKR_KEYTYPE_NOTSUPPORT -812007 //不支持的密钥类型
#define CFCA_CKR_FINDOBJ_ERROR -812008 //P11查找对象错误
#define CFCA_CKR_DESOBJ_ERROR -812009 //销毁对象失败
#define CFCA_CKR_GENRANDOWM_ERROR -812010 //产生随机数错误
#define CFCA_CKR_ENCODE_KEYPAIR_ERROR -812011 //密钥对编码错误
#define CFCA_CKR_SIGNINIT_ERROR -812012 //签名初始化错误
#define CFCA_CKR_CREATCERTOBJ_ERROR -812013 //创建证书对象失败
#define CFCA_CKR_FINDCERTOBJ_ERROR -812014 //查找证书对象失败