nl_ssl.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  $RCSfile$
00003  -------------------
00004  cvs         : $Id: nl_ssl.h 922 2005-11-18 03:41:02Z aquamaniac $
00005  begin       : Wed May 05 2004
00006  copyright   : (C) 2004 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 
00028 
00029 #ifndef GWEN_NL_SSL_H
00030 #define GWEN_NL_SSL_H
00031 
00032 
00033 #define GWEN_NL_SSL_NAME "SSL"
00034 
00035 #include <gwenhywfar/netlayer.h>
00036 #include <gwenhywfar/db.h>
00037 #include <gwenhywfar/ssl_cipher.h>
00038 #include <gwenhywfar/ssl_cert_descr.h>
00039 
00040 
00041 typedef enum {
00043   GWEN_NetLayerSsl_AskAddCertResult_Error=0,
00045   GWEN_NetLayerSsl_AskAddCertResult_No,
00047   GWEN_NetLayerSsl_AskAddCertResult_Tmp,
00049   GWEN_NetLayerSsl_AskAddCertResult_Perm,
00051   GWEN_NetLayerSsl_AskAddCertResult_Incoming
00052 } GWEN_NL_SSL_ASKADDCERT_RESULT;
00053 
00054 
00055 typedef GWEN_NL_SSL_ASKADDCERT_RESULT
00056 (*GWEN_NL_SSL_ASKADDCERT_FN)(GWEN_NETLAYER *nl,
00057                              const GWEN_SSLCERTDESCR *cert,
00058                              void *user_data);
00059 
00060 GWENHYWFAR_API
00061 void GWEN_NetLayerSsl_SetAskAddCertFn(GWEN_NETLAYER *nl,
00062                                       GWEN_NL_SSL_ASKADDCERT_FN fn,
00063                                       void *user_data);
00064 
00065 
00066 GWENHYWFAR_API
00067 GWEN_NL_SSL_ASKADDCERT_RESULT
00068   GWEN_NetLayerSsl_AskAddCert(GWEN_NETLAYER *nl,
00069                               const GWEN_SSLCERTDESCR *cd);
00070 
00071 
00072 GWENHYWFAR_API
00073 GWEN_NETLAYER *GWEN_NetLayerSsl_new(GWEN_NETLAYER *baseLayer,
00074                                     const char *capath,
00075                                     const char *newcapath,
00076                                     const char *ownCertFile,
00077                                     const char *dhFolder,
00078                                     int secure);
00079 
00080 GWENHYWFAR_API
00081 const GWEN_SSLCERTDESCR*
00082   GWEN_NetLayerSsl_GetPeerCertificate(const GWEN_NETLAYER *nl);
00083 
00084 GWENHYWFAR_API
00085 int GWEN_NetLayerSsl_GetIsSecure(const GWEN_NETLAYER *nl);
00086 
00087 GWENHYWFAR_API
00088 void GWEN_NetLayerSsl_SetCiphers(GWEN_NETLAYER *nl, const char *ciphers);
00089 
00090 GWENHYWFAR_API
00091 GWEN_SSLCIPHER_LIST *GWEN_NetLayerSsl_GetCipherList();
00092 
00093 GWENHYWFAR_API
00094 int GWEN_NetLayerSsl_GenerateDhFile(const char *fname, int bits);
00095 
00096 GWENHYWFAR_API
00097 int GWEN_NetLayerSsl_GenerateCertAndKeyFile(const char *fname,
00098                                             int bits,
00099                                             int serial,
00100                                             int days,
00101                                             const GWEN_SSLCERTDESCR *cd);
00102 
00112 GWENHYWFAR_API
00113 int GWEN_NetLayerSsl_ImportCertFile(const char *fname,
00114                                     const char *dname,
00115                                     int overwrite);
00116 
00117 
00118 
00119 #endif /* GWEN_NL_SSL_H */
00120 
00121 

Generated on Sat Sep 16 11:19:15 2006 for gwenhywfar by  doxygen 1.4.7