cryptmgr.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #ifndef GWEN_CRYPTMGR_CRYPTMGR_H
00012 #define GWEN_CRYPTMGR_CRYPTMGR_H
00013
00014
00015 #include <gwenhywfar/buffer.h>
00016
00059
00060 #define GWEN_CRYPTMGR_TLV_SIGNEDOBJECT 0x21
00061 #define GWEN_CRYPTMGR_TLV_ENCRYPTEDOBJECT 0x22
00062
00063
00064 typedef struct GWEN_CRYPTMGR GWEN_CRYPTMGR;
00065
00066
00067 typedef enum {
00068 GWEN_CryptProfile_None=0,
00075 GWEN_CryptProfile_1=1
00076 } GWEN_CRYPT_PROFILE;
00077
00078
00079 typedef enum {
00080 GWEN_SignatureProfile_None=0,
00086 GWEN_SignatureProfile_1=1
00087 } GWEN_SIGNATURE_PROFILE;
00088
00089
00090 #ifdef __cplusplus
00091 extern "C" {
00092 #endif
00093
00094
00095 GWENHYWFAR_API
00096 void GWEN_CryptMgr_free(GWEN_CRYPTMGR *cm);
00097
00102 GWENHYWFAR_API
00103 const char *GWEN_CryptMgr_GetLocalKeyName(const GWEN_CRYPTMGR *cm);
00104
00105 GWENHYWFAR_API
00106 int GWEN_CryptMgr_GetLocalKeyNumber(const GWEN_CRYPTMGR *cm);
00107
00108 GWENHYWFAR_API
00109 int GWEN_CryptMgr_GetLocalKeyVersion(const GWEN_CRYPTMGR *cm);
00117 GWENHYWFAR_API
00118 const char *GWEN_CryptMgr_GetPeerKeyName(const GWEN_CRYPTMGR *cm);
00119
00120 GWENHYWFAR_API
00121 int GWEN_CryptMgr_GetPeerKeyNumber(const GWEN_CRYPTMGR *cm);
00122
00123 GWENHYWFAR_API
00124 int GWEN_CryptMgr_GetPeerKeyVersion(const GWEN_CRYPTMGR *cm);
00132 GWENHYWFAR_API
00133 int GWEN_CryptMgr_GetCryptProfile(const GWEN_CRYPTMGR *cm);
00134
00135 GWENHYWFAR_API
00136 void GWEN_CryptMgr_SetCryptProfile(GWEN_CRYPTMGR *cm, int i);
00137
00138 GWENHYWFAR_API
00139 int GWEN_CryptMgr_GetSignatureProfile(const GWEN_CRYPTMGR *cm);
00140
00141 GWENHYWFAR_API
00142 void GWEN_CryptMgr_SetSignatureProfile(GWEN_CRYPTMGR *cm, int i);
00150
00154 GWENHYWFAR_API
00155 int GWEN_CryptMgr_Sign(GWEN_CRYPTMGR *cm, const uint8_t *pData, uint32_t lData, GWEN_BUFFER *dbuf);
00156
00160 GWENHYWFAR_API
00161 int GWEN_CryptMgr_Encrypt(GWEN_CRYPTMGR *cm, const uint8_t *pData, uint32_t lData, GWEN_BUFFER *dbuf);
00162
00166 GWENHYWFAR_API
00167 int GWEN_CryptMgr_Verify(GWEN_CRYPTMGR *cm, const uint8_t *pData, uint32_t lData, GWEN_BUFFER *dbuf);
00168
00172 GWENHYWFAR_API
00173 int GWEN_CryptMgr_Decrypt(GWEN_CRYPTMGR *cm, const uint8_t *pData, uint32_t lData, GWEN_BUFFER *dbuf);
00183
00188 GWENHYWFAR_API
00189 int GWEN_CryptMgr_Encode(GWEN_CRYPTMGR *cm, const uint8_t *pData, uint32_t lData, GWEN_BUFFER *dbuf);
00190
00195 GWENHYWFAR_API
00196 int GWEN_CryptMgr_Decode(GWEN_CRYPTMGR *cm, const uint8_t *pData, uint32_t lData, GWEN_BUFFER *dbuf);
00200 #ifdef __cplusplus
00201 }
00202 #endif
00203
00205
00206
00207 #endif
00208
00209