gwenhywfar 5.10.1
Macros | Functions
cryptkey.c File Reference
#include "cryptkey_p.h"
#include <gwenhywfar/misc.h>
#include <gwenhywfar/debug.h>
#include <gcrypt.h>
Include dependency graph for cryptkey.c:

Go to the source code of this file.

Macros

#define DISABLE_DEBUGLOG
 

Functions

int GWEN_Crypt3_ModuleFini (void)
 
int GWEN_Crypt3_ModuleInit (void)
 
int GWEN_Crypt_Key_Decipher (GWEN_CRYPT_KEY *k, const uint8_t *pInData, uint32_t inLen, uint8_t *pOutData, uint32_t *pOutLen)
 
GWEN_CRYPT_KEYGWEN_Crypt_Key_dup (const GWEN_CRYPT_KEY *k)
 
int GWEN_Crypt_Key_Encipher (GWEN_CRYPT_KEY *k, const uint8_t *pInData, uint32_t inLen, uint8_t *pOutData, uint32_t *pOutLen)
 
void GWEN_Crypt_Key_free (GWEN_CRYPT_KEY *k)
 
GWEN_CRYPT_KEYGWEN_Crypt_Key_fromDb (GWEN_DB_NODE *db)
 
GWEN_CRYPT_CRYPTALGOID GWEN_Crypt_Key_GetCryptAlgoId (const GWEN_CRYPT_KEY *k)
 
int GWEN_Crypt_Key_GetKeyNumber (const GWEN_CRYPT_KEY *k)
 
int GWEN_Crypt_Key_GetKeySize (const GWEN_CRYPT_KEY *k)
 
int GWEN_Crypt_Key_GetKeyVersion (const GWEN_CRYPT_KEY *k)
 
GWEN_CRYPT_KEYGWEN_Crypt_Key_new (GWEN_CRYPT_CRYPTALGOID cryptAlgoId, int keySize)
 
GWEN_CRYPT_KEY_DECIPHER_FN GWEN_Crypt_Key_SetDecipherFn (GWEN_CRYPT_KEY *k, GWEN_CRYPT_KEY_DECIPHER_FN f)
 
GWEN_CRYPT_KEY_ENCIPHER_FN GWEN_Crypt_Key_SetEncipherFn (GWEN_CRYPT_KEY *k, GWEN_CRYPT_KEY_ENCIPHER_FN f)
 
void GWEN_Crypt_Key_SetKeyNumber (GWEN_CRYPT_KEY *k, int i)
 
void GWEN_Crypt_Key_SetKeyVersion (GWEN_CRYPT_KEY *k, int i)
 
GWEN_CRYPT_KEY_SIGN_FN GWEN_Crypt_Key_SetSignFn (GWEN_CRYPT_KEY *k, GWEN_CRYPT_KEY_SIGN_FN f)
 
GWEN_CRYPT_KEY_VERIFY_FN GWEN_Crypt_Key_SetVerifyFn (GWEN_CRYPT_KEY *k, GWEN_CRYPT_KEY_VERIFY_FN f)
 
int GWEN_Crypt_Key_Sign (GWEN_CRYPT_KEY *k, const uint8_t *pInData, uint32_t inLen, uint8_t *pSignatureData, uint32_t *pSignatureLen)
 
int GWEN_Crypt_Key_toDb (const GWEN_CRYPT_KEY *k, GWEN_DB_NODE *db)
 
int GWEN_Crypt_Key_Verify (GWEN_CRYPT_KEY *k, const uint8_t *pInData, uint32_t inLen, const uint8_t *pSignatureData, uint32_t signatureLen)
 

Macro Definition Documentation

◆ DISABLE_DEBUGLOG

#define DISABLE_DEBUGLOG

Definition at line 15 of file cryptkey.c.

Function Documentation

◆ GWEN_Crypt3_ModuleFini()

int GWEN_Crypt3_ModuleFini ( void  )

Definition at line 54 of file cryptkey.c.

Referenced by GWEN_Fini().

Here is the caller graph for this function:

◆ GWEN_Crypt3_ModuleInit()

int GWEN_Crypt3_ModuleInit ( void  )

Definition at line 34 of file cryptkey.c.

References DBG_ERROR, GWEN_ERROR_GENERIC, and GWEN_LOGDOMAIN.

Referenced by GWEN_Init().

Here is the caller graph for this function:

◆ GWEN_Crypt_Key_Decipher()

int GWEN_Crypt_Key_Decipher ( GWEN_CRYPT_KEY k,
const uint8_t *  pInData,
uint32_t  inLen,
uint8_t *  pOutData,
uint32_t *  pOutLen 
)

Definition at line 318 of file cryptkey.c.

References GWEN_ERROR_NOT_IMPLEMENTED.

Referenced by _decodeData(), GWEN_Crypt_TokenFile__Decipher(), GWEN_Crypt_TokenOHBCI__DecryptFile(), GWEN_CryptMgr_Decrypt(), and GWEN_CryptMgrKeys_DecryptKey().

Here is the caller graph for this function:

◆ GWEN_Crypt_Key_dup()

GWEN_CRYPT_KEY * GWEN_Crypt_Key_dup ( const GWEN_CRYPT_KEY k)

Definition at line 137 of file cryptkey.c.

References GWEN_Crypt_Key_new(), and NULL.

Here is the call graph for this function:

◆ GWEN_Crypt_Key_Encipher()

int GWEN_Crypt_Key_Encipher ( GWEN_CRYPT_KEY k,
const uint8_t *  pInData,
uint32_t  inLen,
uint8_t *  pOutData,
uint32_t *  pOutLen 
)

◆ GWEN_Crypt_Key_free()

void GWEN_Crypt_Key_free ( GWEN_CRYPT_KEY k)

◆ GWEN_Crypt_Key_fromDb()

GWEN_CRYPT_KEY * GWEN_Crypt_Key_fromDb ( GWEN_DB_NODE db)

Definition at line 80 of file cryptkey.c.

References DBG_ERROR, GWEN_CRYPT_CRYPTALGOID, GWEN_Crypt_CryptAlgoId_fromString(), GWEN_Crypt_Key_new(), GWEN_DB_GetCharValue(), GWEN_DB_GetIntValue(), GWEN_LOGDOMAIN, and NULL.

Referenced by GWEN_Crypt_KeyRsa_fromDb(), GWEN_Crypt_KeySym__fromDb(), and GWEN_Crypt_KeySym_fromDb().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GWEN_Crypt_Key_GetCryptAlgoId()

GWEN_CRYPT_CRYPTALGOID GWEN_Crypt_Key_GetCryptAlgoId ( const GWEN_CRYPT_KEY k)

◆ GWEN_Crypt_Key_GetKeyNumber()

int GWEN_Crypt_Key_GetKeyNumber ( const GWEN_CRYPT_KEY k)

◆ GWEN_Crypt_Key_GetKeySize()

int GWEN_Crypt_Key_GetKeySize ( const GWEN_CRYPT_KEY k)

◆ GWEN_Crypt_Key_GetKeyVersion()

int GWEN_Crypt_Key_GetKeyVersion ( const GWEN_CRYPT_KEY k)

◆ GWEN_Crypt_Key_new()

GWEN_CRYPT_KEY * GWEN_Crypt_Key_new ( GWEN_CRYPT_CRYPTALGOID  cryptAlgoId,
int  keySize 
)

◆ GWEN_Crypt_Key_SetDecipherFn()

GWEN_CRYPT_KEY_DECIPHER_FN GWEN_Crypt_Key_SetDecipherFn ( GWEN_CRYPT_KEY k,
GWEN_CRYPT_KEY_DECIPHER_FN  f 
)

◆ GWEN_Crypt_Key_SetEncipherFn()

GWEN_CRYPT_KEY_ENCIPHER_FN GWEN_Crypt_Key_SetEncipherFn ( GWEN_CRYPT_KEY k,
GWEN_CRYPT_KEY_ENCIPHER_FN  f 
)

◆ GWEN_Crypt_Key_SetKeyNumber()

void GWEN_Crypt_Key_SetKeyNumber ( GWEN_CRYPT_KEY k,
int  i 
)

Definition at line 195 of file cryptkey.c.

Referenced by GWEN_Crypt_TokenFile__SetKeyInfo().

Here is the caller graph for this function:

◆ GWEN_Crypt_Key_SetKeyVersion()

void GWEN_Crypt_Key_SetKeyVersion ( GWEN_CRYPT_KEY k,
int  i 
)

Definition at line 211 of file cryptkey.c.

Referenced by GWEN_Crypt_TokenFile__SetKeyInfo().

Here is the caller graph for this function:

◆ GWEN_Crypt_Key_SetSignFn()

GWEN_CRYPT_KEY_SIGN_FN GWEN_Crypt_Key_SetSignFn ( GWEN_CRYPT_KEY k,
GWEN_CRYPT_KEY_SIGN_FN  f 
)

Definition at line 219 of file cryptkey.c.

Referenced by GWEN_Crypt_KeyRsa_fromDb(), and GWEN_Crypt_KeyRsa_GeneratePair().

Here is the caller graph for this function:

◆ GWEN_Crypt_Key_SetVerifyFn()

GWEN_CRYPT_KEY_VERIFY_FN GWEN_Crypt_Key_SetVerifyFn ( GWEN_CRYPT_KEY k,
GWEN_CRYPT_KEY_VERIFY_FN  f 
)

Definition at line 232 of file cryptkey.c.

Referenced by GWEN_Crypt_KeyRsa_fromDb(), and GWEN_Crypt_KeyRsa_GeneratePair().

Here is the caller graph for this function:

◆ GWEN_Crypt_Key_Sign()

int GWEN_Crypt_Key_Sign ( GWEN_CRYPT_KEY k,
const uint8_t *  pInData,
uint32_t  inLen,
uint8_t *  pSignatureData,
uint32_t *  pSignatureLen 
)

Definition at line 273 of file cryptkey.c.

References GWEN_ERROR_NOT_IMPLEMENTED.

Referenced by GWEN_Crypt_TokenFile__Sign(), and GWEN_CryptMgrKeys_SignData().

Here is the caller graph for this function:

◆ GWEN_Crypt_Key_toDb()

int GWEN_Crypt_Key_toDb ( const GWEN_CRYPT_KEY k,
GWEN_DB_NODE db 
)

Definition at line 117 of file cryptkey.c.

References GWEN_Crypt_CryptAlgoId_toString(), GWEN_DB_FLAGS_OVERWRITE_VARS, GWEN_DB_SetCharValue(), and GWEN_DB_SetIntValue().

Referenced by GWEN_Crypt_KeyRsa_toDb(), GWEN_Crypt_KeySym__toDb(), and GWEN_Crypt_KeySym_toDb().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GWEN_Crypt_Key_Verify()

int GWEN_Crypt_Key_Verify ( GWEN_CRYPT_KEY k,
const uint8_t *  pInData,
uint32_t  inLen,
const uint8_t *  pSignatureData,
uint32_t  signatureLen 
)

Definition at line 288 of file cryptkey.c.

References GWEN_ERROR_NOT_IMPLEMENTED.

Referenced by GWEN_Crypt_TokenFile__Verify().

Here is the caller graph for this function: