# keymanager.h File Reference

This file contains the description of the basic key manager. More...

`#include <gwenhywfar/crypt.h>`
`#include <gwenhywfar/keyspec.h>`

Go to the source code of this file.

## Functions for Inheritors

These functiuons are not to be used by the application but by inheritors (like "protected" in C++)
GWENHYWFAR_API void * | GWEN_KeyManager_GetData (GWEN_KEYMANAGER *km)
GWENHYWFAR_API GWEN_KEYMANAGER * | GWEN_KeyManager_new ()
GWENHYWFAR_API void | GWEN_KeyManager_SetAddKeyFn (GWEN_KEYMANAGER *km, GWEN_KEYMANAGER_ADDKEYFN fn)
GWENHYWFAR_API void | GWEN_KeyManager_SetData (GWEN_KEYMANAGER *km, void *data)
GWENHYWFAR_API void | GWEN_KeyManager_SetDelKeyFn (GWEN_KEYMANAGER *km, GWEN_KEYMANAGER_DELKEYFN fn)
GWENHYWFAR_API void | GWEN_KeyManager_SetFreeDataFn (GWEN_KEYMANAGER *km, GWEN_KEYMANAGER_FREEDATAFN fn)
GWENHYWFAR_API void | GWEN_KeyManager_SetGetKeyFn (GWEN_KEYMANAGER *km, GWEN_KEYMANAGER_GETKEYFN fn)

## Typedefs

typedef GWEN_KEYMANAGER | GWEN_KEYMANAGER
typedef int(* | GWEN_KEYMANAGER_ADDKEYFN )(GWEN_KEYMANAGER *km, const GWEN_CRYPTKEY *key)
typedef int(* | GWEN_KEYMANAGER_DELKEYFN )(GWEN_KEYMANAGER *km, const GWEN_CRYPTKEY *key)
typedef void(* | GWEN_KEYMANAGER_FREEDATAFN )(GWEN_KEYMANAGER *km)
typedef const GWEN_CRYPTKEY *(* | GWEN_KEYMANAGER_GETKEYFN )(GWEN_KEYMANAGER *km, const GWEN_KEYSPEC *ks)

## Functions

GWENHYWFAR_API int | GWEN_KeyManager_AddKey (GWEN_KEYMANAGER *km, const GWEN_CRYPTKEY *key)
GWENHYWFAR_API int | GWEN_KeyManager_DeleteKey (GWEN_KEYMANAGER *km, const GWEN_CRYPTKEY *key)
GWENHYWFAR_API void | GWEN_KeyManager_free (GWEN_KEYMANAGER *km)
GWENHYWFAR_API const GWEN_CRYPTKEY * | GWEN_KeyManager_GetKey (GWEN_KEYMANAGER *km, const GWEN_KEYSPEC *ks)

## Detailed Description

This file contains the description of the basic key manager.

A key manager is used to store, retrieve, add and delete keys. It is used by IPC functions to manage the keys to be used. This is just a base "class", it really doesn't do anything. However, inheriting "classes" can provide services for reading keys from files, or simply hold a list of keys which is forgotten after the program terminates.

## Typedef Documentation

typedef struct GWEN_KEYMANAGER GWEN_KEYMANAGER

typedef int(* GWEN_KEYMANAGER_ADDKEYFN)(GWEN_KEYMANAGER *km, const GWEN_CRYPTKEY *key)

typedef int(* GWEN_KEYMANAGER_DELKEYFN)(GWEN_KEYMANAGER *km, const GWEN_CRYPTKEY *key)

typedef void(* GWEN_KEYMANAGER_FREEDATAFN)(GWEN_KEYMANAGER *km)

typedef const GWEN_CRYPTKEY*(* GWEN_KEYMANAGER_GETKEYFN)(GWEN_KEYMANAGER *km, const GWEN_KEYSPEC *ks)

## Function Documentation

GWENHYWFAR_API int GWEN_KeyManager_AddKey | ( | GWEN_KEYMANAGER * | km,
|  | const GWEN_CRYPTKEY * | key
| ) |

GWENHYWFAR_API int GWEN_KeyManager_DeleteKey | ( | GWEN_KEYMANAGER * | km,
|  | const GWEN_CRYPTKEY * | key
| ) |

GWENHYWFAR_API void GWEN_KeyManager_free | ( | GWEN_KEYMANAGER * | km | ) |

GWENHYWFAR_API void* GWEN_KeyManager_GetData | ( | GWEN_KEYMANAGER * | km | ) |

GWENHYWFAR_API const GWEN_CRYPTKEY* GWEN_KeyManager_GetKey | ( | GWEN_KEYMANAGER * | km,
|  | const GWEN_KEYSPEC * | ks
| ) |

GWENHYWFAR_API GWEN_KEYMANAGER* GWEN_KeyManager_new | ( |  | ) |

GWENHYWFAR_API void GWEN_KeyManager_SetAddKeyFn | ( | GWEN_KEYMANAGER * | km,
|  | GWEN_KEYMANAGER_ADDKEYFN | fn
| ) |

GWENHYWFAR_API void GWEN_KeyManager_SetData | ( | GWEN_KEYMANAGER * | km,
|  | void * | data
| ) |

GWENHYWFAR_API void GWEN_KeyManager_SetDelKeyFn | ( | GWEN_KEYMANAGER * | km,
|  | GWEN_KEYMANAGER_DELKEYFN | fn
| ) |

GWENHYWFAR_API void GWEN_KeyManager_SetFreeDataFn | ( | GWEN_KEYMANAGER * | km,
|  | GWEN_KEYMANAGER_FREEDATAFN | fn
| ) |

GWENHYWFAR_API void GWEN_KeyManager_SetGetKeyFn | ( | GWEN_KEYMANAGER * | km,
|  | GWEN_KEYMANAGER_GETKEYFN | fn
| ) |