cryptmgr.h File Reference
`#include <gwenhywfar/buffer.h>`

Go to the source code of this file.

## Macros

#define | GWEN_CRYPTMGR_TLV_ENCRYPTEDOBJECT 0x22
#define | GWEN_CRYPTMGR_TLV_SIGNEDOBJECT 0x21

## Typedefs

typedef struct GWEN_CRYPTMGR | GWEN_CRYPTMGR

## Enumerations

enum | GWEN_CRYPT_PROFILE { GWEN_CryptProfile_None =0 , GWEN_CryptProfile_1 =1 }
enum | GWEN_SIGNATURE_PROFILE { GWEN_SignatureProfile_None =0 , GWEN_SignatureProfile_1 =1 }

## Functions

GWENHYWFAR_API void | GWEN_CryptMgr_free (GWEN_CRYPTMGR *cm)
Information About the Local Key
GWENHYWFAR_API const char * | GWEN_CryptMgr_GetLocalKeyName (const GWEN_CRYPTMGR *cm)
GWENHYWFAR_API int | GWEN_CryptMgr_GetLocalKeyNumber (const GWEN_CRYPTMGR *cm)
GWENHYWFAR_API int | GWEN_CryptMgr_GetLocalKeyVersion (const GWEN_CRYPTMGR *cm)
Information About the Peer Key
GWENHYWFAR_API const char * | GWEN_CryptMgr_GetPeerKeyName (const GWEN_CRYPTMGR *cm)
GWENHYWFAR_API int | GWEN_CryptMgr_GetPeerKeyNumber (const GWEN_CRYPTMGR *cm)
GWENHYWFAR_API int | GWEN_CryptMgr_GetPeerKeyVersion (const GWEN_CRYPTMGR *cm)
Information About the Algorithms for Signing and Encrypting
GWENHYWFAR_API int | GWEN_CryptMgr_GetCryptProfile (const GWEN_CRYPTMGR *cm)
GWENHYWFAR_API int | GWEN_CryptMgr_GetSignatureProfile (const GWEN_CRYPTMGR *cm)
GWENHYWFAR_API void | GWEN_CryptMgr_SetCryptProfile (GWEN_CRYPTMGR *cm, int i)
GWENHYWFAR_API void | GWEN_CryptMgr_SetSignatureProfile (GWEN_CRYPTMGR *cm, int i)
Basic Cryptographic Functions
GWENHYWFAR_API int | GWEN_CryptMgr_Decrypt (GWEN_CRYPTMGR *cm, const uint8_t *pData, uint32_t lData, GWEN_BUFFER *dbuf)
GWENHYWFAR_API int | GWEN_CryptMgr_Encrypt (GWEN_CRYPTMGR *cm, const uint8_t *pData, uint32_t lData, GWEN_BUFFER *dbuf)
GWENHYWFAR_API int | GWEN_CryptMgr_Sign (GWEN_CRYPTMGR *cm, const uint8_t *pData, uint32_t lData, GWEN_BUFFER *dbuf)
GWENHYWFAR_API int | GWEN_CryptMgr_Verify (GWEN_CRYPTMGR *cm, const uint8_t *pData, uint32_t lData, GWEN_BUFFER *dbuf)
Complex Cryptographic Functions
Functions of this group perform multiple operations in one setting (e.g. signing and encrypting or decrypting and verifying a signature).
GWENHYWFAR_API int | GWEN_CryptMgr_Decode (GWEN_CRYPTMGR *cm, const uint8_t *pData, uint32_t lData, GWEN_BUFFER *dbuf)
GWENHYWFAR_API int | GWEN_CryptMgr_Encode (GWEN_CRYPTMGR *cm, const uint8_t *pData, uint32_t lData, GWEN_BUFFER *dbuf)

## Macro Definition Documentation

## GWEN_CRYPTMGR_TLV_ENCRYPTEDOBJECT

#define GWEN_CRYPTMGR_TLV_ENCRYPTEDOBJECT 0x22

Definition at line 61 of file cryptmgr.h.

## GWEN_CRYPTMGR_TLV_SIGNEDOBJECT

#define GWEN_CRYPTMGR_TLV_SIGNEDOBJECT 0x21

Definition at line 60 of file cryptmgr.h.

## Typedef Documentation

## GWEN_CRYPTMGR

typedef struct GWEN_CRYPTMGR GWEN_CRYPTMGR

Definition at line 64 of file cryptmgr.h.

## Enumeration Type Documentation

## GWEN_CRYPT_PROFILE

enum GWEN_CRYPT_PROFILE

Enumerator
GWEN_CryptProfile_None |
GWEN_CryptProfile_1 | Padding for key : ISO 9796-2 Encryption for key : RSA 2048 Padding for data : ANSIX9_23 Encryption for data: BLOWFISH-256

Definition at line 67 of file cryptmgr.h.

## GWEN_SIGNATURE_PROFILE

enum GWEN_SIGNATURE_PROFILE

Enumerator
GWEN_SignatureProfile_None |
GWEN_SignatureProfile_1 | Hash: RMD-160 Padd: ISO 9796-2 Sign: RSA 2048

Definition at line 79 of file cryptmgr.h.

## Function Documentation

## GWEN_CryptMgr_Decode()

GWENHYWFAR_API int GWEN_CryptMgr_Decode | ( | GWEN_CRYPTMGR * | cm,
|  | const uint8_t * | pData,
|  | uint32_t | lData,
|  | GWEN_BUFFER * | dbuf )

Decrypt the given data which is expected to be an encrypted object containing a signed object which actually contains the data. The signature of the contained signed object is verified.

## GWEN_CryptMgr_Decrypt()

GWENHYWFAR_API int GWEN_CryptMgr_Decrypt | ( | GWEN_CRYPTMGR * | cm,
|  | const uint8_t * | pData,
|  | uint32_t | lData,
|  | GWEN_BUFFER * | dbuf )

Extracts the data from an encrypted object and decrypts it.

References GWENHYWFAR_API.

## GWEN_CryptMgr_Encode()

GWENHYWFAR_API int GWEN_CryptMgr_Encode | ( | GWEN_CRYPTMGR * | cm,
|  | const uint8_t * | pData,
|  | uint32_t | lData,
|  | GWEN_BUFFER * | dbuf )

Sign the given data (thus creating a signed object) and encrypt the result of that operation (i.e. creating an encrypted object containing a signed object which actually contains the data).

References GWENHYWFAR_API.

## GWEN_CryptMgr_Encrypt()

GWENHYWFAR_API int GWEN_CryptMgr_Encrypt | ( | GWEN_CRYPTMGR * | cm,
|  | const uint8_t * | pData,
|  | uint32_t | lData,
|  | GWEN_BUFFER * | dbuf )

Encrypt the given data and create an encrypted object containing the encrypted data.

References GWENHYWFAR_API.

## GWEN_CryptMgr_free()

GWENHYWFAR_API void GWEN_CryptMgr_free | ( | GWEN_CRYPTMGR * | cm | ) |

References GWENHYWFAR_API.

## GWEN_CryptMgr_GetCryptProfile()

GWENHYWFAR_API int GWEN_CryptMgr_GetCryptProfile | ( | const GWEN_CRYPTMGR * | cm | ) |

References GWENHYWFAR_API.

## GWEN_CryptMgr_GetLocalKeyName()

GWENHYWFAR_API const char * GWEN_CryptMgr_GetLocalKeyName | ( | const GWEN_CRYPTMGR * | cm | ) |

References GWENHYWFAR_API.

## GWEN_CryptMgr_GetLocalKeyNumber()

GWENHYWFAR_API int GWEN_CryptMgr_GetLocalKeyNumber | ( | const GWEN_CRYPTMGR * | cm | ) |

References GWENHYWFAR_API.

## GWEN_CryptMgr_GetLocalKeyVersion()

GWENHYWFAR_API int GWEN_CryptMgr_GetLocalKeyVersion | ( | const GWEN_CRYPTMGR * | cm | ) |

References GWENHYWFAR_API.

## GWEN_CryptMgr_GetPeerKeyName()

GWENHYWFAR_API const char * GWEN_CryptMgr_GetPeerKeyName | ( | const GWEN_CRYPTMGR * | cm | ) |

References GWENHYWFAR_API.

## GWEN_CryptMgr_GetPeerKeyNumber()

GWENHYWFAR_API int GWEN_CryptMgr_GetPeerKeyNumber | ( | const GWEN_CRYPTMGR * | cm | ) |

References GWENHYWFAR_API.

## GWEN_CryptMgr_GetPeerKeyVersion()

GWENHYWFAR_API int GWEN_CryptMgr_GetPeerKeyVersion | ( | const GWEN_CRYPTMGR * | cm | ) |

References GWENHYWFAR_API.

## GWEN_CryptMgr_GetSignatureProfile()

GWENHYWFAR_API int GWEN_CryptMgr_GetSignatureProfile | ( | const GWEN_CRYPTMGR * | cm | ) |

References GWENHYWFAR_API.

## GWEN_CryptMgr_SetCryptProfile()

GWENHYWFAR_API void GWEN_CryptMgr_SetCryptProfile | ( | GWEN_CRYPTMGR * | cm,
|  | int | i )

References GWENHYWFAR_API.

## GWEN_CryptMgr_SetSignatureProfile()

GWENHYWFAR_API void GWEN_CryptMgr_SetSignatureProfile | ( | GWEN_CRYPTMGR * | cm,
|  | int | i )

References GWENHYWFAR_API.

## GWEN_CryptMgr_Sign()

GWENHYWFAR_API int GWEN_CryptMgr_Sign | ( | GWEN_CRYPTMGR * | cm,
|  | const uint8_t * | pData,
|  | uint32_t | lData,
|  | GWEN_BUFFER * | dbuf )

Sign the given data and create a signed object containing the signature and the given data.

References GWENHYWFAR_API.

## GWEN_CryptMgr_Verify()

GWENHYWFAR_API int GWEN_CryptMgr_Verify | ( | GWEN_CRYPTMGR * | cm,
|  | const uint8_t * | pData,
|  | uint32_t | lData,
|  | GWEN_BUFFER * | dbuf )

Extract the data from a signed object and verify the signature.

References GWENHYWFAR_API.