keymanager.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  $RCSfile$
00003                              -------------------
00004     cvs         : $Id: keymanager.h 462 2004-07-30 10:33:08Z cstim $
00005     begin       : Mon Nov 17 2003
00006     copyright   : (C) 2003 by Martin Preuss
00007     email       : martin@libchipcard.de
00008 
00009  ***************************************************************************
00010  *                                                                         *
00011  *   This library is free software; you can redistribute it and/or         *
00012  *   modify it under the terms of the GNU Lesser General Public            *
00013  *   License as published by the Free Software Foundation; either          *
00014  *   version 2.1 of the License, or (at your option) any later version.    *
00015  *                                                                         *
00016  *   This library is distributed in the hope that it will be useful,       *
00017  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00018  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
00019  *   Lesser General Public License for more details.                       *
00020  *                                                                         *
00021  *   You should have received a copy of the GNU Lesser General Public      *
00022  *   License along with this library; if not, write to the Free Software   *
00023  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston,                 *
00024  *   MA  02111-1307  USA                                                   *
00025  *                                                                         *
00026  ***************************************************************************/
00027 
00041 #ifndef GWENHYWFAR_KEYMANAGER_H
00042 #define GWENHYWFAR_KEYMANAGER_H
00043 
00044 
00045 #include <gwenhywfar/crypt.h>
00046 #include <gwenhywfar/keyspec.h>
00047 
00048 #ifdef __cplusplus
00049 extern "C" {
00050 #endif
00051 
00052 
00053 typedef struct GWEN_KEYMANAGER GWEN_KEYMANAGER;
00054 
00055 
00056 typedef const GWEN_CRYPTKEY*
00057   (*GWEN_KEYMANAGER_GETKEYFN)(GWEN_KEYMANAGER *km,
00058                               const GWEN_KEYSPEC *ks);
00059 typedef int (*GWEN_KEYMANAGER_ADDKEYFN)(GWEN_KEYMANAGER *km,
00060                                         const GWEN_CRYPTKEY *key);
00061 typedef int (*GWEN_KEYMANAGER_DELKEYFN)(GWEN_KEYMANAGER *km,
00062                                         const GWEN_CRYPTKEY *key);
00063 typedef void (*GWEN_KEYMANAGER_FREEDATAFN)(GWEN_KEYMANAGER *km);
00064 
00065 
00066 
00067 GWENHYWFAR_API
00068 void GWEN_KeyManager_free(GWEN_KEYMANAGER *km);
00069 
00070 
00071 GWENHYWFAR_API
00072 const GWEN_CRYPTKEY *GWEN_KeyManager_GetKey(GWEN_KEYMANAGER *km,
00073                                             const GWEN_KEYSPEC *ks);
00074 GWENHYWFAR_API
00075 int GWEN_KeyManager_AddKey(GWEN_KEYMANAGER *km,
00076                            const GWEN_CRYPTKEY *key);
00077 GWENHYWFAR_API
00078 int GWEN_KeyManager_DeleteKey(GWEN_KEYMANAGER *km,
00079                               const GWEN_CRYPTKEY *key);
00080 
00081 
00088 GWENHYWFAR_API
00089 GWEN_KEYMANAGER *GWEN_KeyManager_new();
00090 
00091 GWENHYWFAR_API
00092 void GWEN_KeyManager_SetGetKeyFn(GWEN_KEYMANAGER *km,
00093                                  GWEN_KEYMANAGER_GETKEYFN fn);
00094 GWENHYWFAR_API
00095 void GWEN_KeyManager_SetAddKeyFn(GWEN_KEYMANAGER *km,
00096                                  GWEN_KEYMANAGER_ADDKEYFN fn);
00097 GWENHYWFAR_API
00098 void GWEN_KeyManager_SetDelKeyFn(GWEN_KEYMANAGER *km,
00099                                  GWEN_KEYMANAGER_DELKEYFN fn);
00100 GWENHYWFAR_API
00101 void GWEN_KeyManager_SetFreeDataFn(GWEN_KEYMANAGER *km,
00102                                    GWEN_KEYMANAGER_FREEDATAFN fn);
00103 GWENHYWFAR_API
00104 void GWEN_KeyManager_SetData(GWEN_KEYMANAGER *km,
00105                              void *data);
00106 GWENHYWFAR_API
00107 void *GWEN_KeyManager_GetData(GWEN_KEYMANAGER *km);
00108 
00109 #ifdef __cplusplus
00110 }
00111 #endif
00112 
00113 
00117 #endif
00118 
00119 
00120 
00121 

Generated on Wed Jun 21 00:59:52 2006 for gwenhywfar by  doxygen 1.4.6