Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #ifndef GWEN_CRYPT_KEY_BE_H
00015 #define GWEN_CRYPT_KEY_BE_H
00016
00017 #include <gwenhywfar/cryptkey.h>
00018
00019
00020
00021 typedef int (*GWEN_CRYPT_KEY_SIGN_FN)(GWEN_CRYPT_KEY *k,
00022 const uint8_t *pInData,
00023 uint32_t inLen,
00024 uint8_t *pSignatureData,
00025 uint32_t *pSignatureLen);
00026 typedef int (*GWEN_CRYPT_KEY_VERIFY_FN)(GWEN_CRYPT_KEY *k,
00027 const uint8_t *pInData,
00028 uint32_t inLen,
00029 const uint8_t *pSignatureData,
00030 uint32_t signatureLen);
00031 typedef int (*GWEN_CRYPT_KEY_ENCIPHER_FN)(GWEN_CRYPT_KEY *k,
00032 const uint8_t *pInData,
00033 uint32_t inLen,
00034 uint8_t *pOutData,
00035 uint32_t *pOutLen);
00036 typedef int (*GWEN_CRYPT_KEY_DECIPHER_FN)(GWEN_CRYPT_KEY *k,
00037 const uint8_t *pInData,
00038 uint32_t inLen,
00039 uint8_t *pOutData,
00040 uint32_t *pOutLen);
00041
00042
00043 #ifdef __cplusplus
00044 extern "C" {
00045 #endif
00046
00047 GWENHYWFAR_API GWEN_CRYPT_KEY *GWEN_Crypt_Key_new(GWEN_CRYPT_CRYPTALGOID cryptAlgoId, int keySize);
00048
00049 GWENHYWFAR_API GWEN_CRYPT_KEY *GWEN_Crypt_Key_fromDb(GWEN_DB_NODE *db);
00050 GWENHYWFAR_API int GWEN_Crypt_Key_toDb(const GWEN_CRYPT_KEY *k, GWEN_DB_NODE *db);
00051 GWENHYWFAR_API GWEN_CRYPT_KEY *GWEN_Crypt_Key_dup(const GWEN_CRYPT_KEY *k);
00052
00053
00054 GWENHYWFAR_API GWEN_CRYPT_KEY_SIGN_FN GWEN_Crypt_Key_SetSignFn(GWEN_CRYPT_KEY *k,
00055 GWEN_CRYPT_KEY_SIGN_FN f);
00056 GWENHYWFAR_API GWEN_CRYPT_KEY_VERIFY_FN GWEN_Crypt_Key_SetVerifyFn(GWEN_CRYPT_KEY *k,
00057 GWEN_CRYPT_KEY_VERIFY_FN f);
00058
00059 GWENHYWFAR_API GWEN_CRYPT_KEY_ENCIPHER_FN
00060 GWEN_Crypt_Key_SetEncipherFn(GWEN_CRYPT_KEY *k,
00061 GWEN_CRYPT_KEY_ENCIPHER_FN f);
00062 GWENHYWFAR_API GWEN_CRYPT_KEY_DECIPHER_FN
00063 GWEN_Crypt_Key_SetDecipherFn(GWEN_CRYPT_KEY *k,
00064 GWEN_CRYPT_KEY_DECIPHER_FN f);
00065
00066
00067 #ifdef __cplusplus
00068 }
00069 #endif
00070
00071
00072 #endif