2 * Copyright (C) 2002 Nikos Mavroyanopoulos
4 * This file is part of GNUTLS.
6 * GNUTLS is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * GNUTLS is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
21 /* Note the libgnutls-extra is not a standalone library. It requires
22 * to link also against libgnutls.
25 #ifndef GNUTLS_EXTRA_H
26 # define GNUTLS_EXTRA_H
32 typedef struct DSTRUCT
* GNUTLS_SRP_SERVER_CREDENTIALS
;
33 typedef struct DSTRUCT
* GNUTLS_SRP_CLIENT_CREDENTIALS
;
35 void gnutls_srp_free_client_sc( GNUTLS_SRP_CLIENT_CREDENTIALS sc
);
36 int gnutls_srp_allocate_client_sc( GNUTLS_SRP_CLIENT_CREDENTIALS
*sc
);
37 int gnutls_srp_set_client_cred( GNUTLS_SRP_CLIENT_CREDENTIALS res
, char *username
, char* password
);
39 void gnutls_srp_free_server_sc( GNUTLS_SRP_SERVER_CREDENTIALS sc
);
40 int gnutls_srp_allocate_server_sc( GNUTLS_SRP_SERVER_CREDENTIALS
*sc
);
41 int gnutls_srp_set_server_cred_file( GNUTLS_SRP_SERVER_CREDENTIALS res
, char *password_file
, char* password_conf_file
);
43 const char* gnutls_srp_server_get_username( GNUTLS_STATE state
);
45 typedef int gnutls_srp_server_select_func(GNUTLS_STATE
, char **, char**, int);
47 void gnutls_srp_server_set_select_func( GNUTLS_STATE
, gnutls_srp_server_select_func
*);
49 /* Openpgp certificate stuff */
50 int gnutls_openpgp_fingerprint( const gnutls_datum
* data
, char* result
, size_t* result_size
);
52 int gnutls_openpgp_extract_key_name( const gnutls_datum
*cert
,
54 gnutls_openpgp_name
*dn
);
56 int gnutls_openpgp_extract_key_pk_algorithm(const gnutls_datum
*cert
,
59 int gnutls_openpgp_extract_key_version( const gnutls_datum
*cert
);
61 time_t gnutls_openpgp_extract_key_creation_time( const gnutls_datum
*cert
);
62 time_t gnutls_openpgp_extract_key_expiration_time( const gnutls_datum
*cert
);
64 int gnutls_openpgp_verify_key( const gnutls_datum
* keyring
,
65 const gnutls_datum
* key_list
,
68 int gnutls_certificate_set_openpgp_key_file( GNUTLS_CERTIFICATE_CREDENTIALS res
, char *CERTFILE
, char* KEYFILE
);
69 int gnutls_certificate_set_openpgp_key_mem( GNUTLS_CERTIFICATE_CREDENTIALS res
,
70 const gnutls_datum
* CERT
, const gnutls_datum
* KEY
);
72 int gnutls_certificate_set_openpgp_keyserver(GNUTLS_CERTIFICATE_CREDENTIALS res
,
73 char* keyserver
, int port
);
75 int gnutls_certificate_set_openpgp_trustdb(GNUTLS_CERTIFICATE_CREDENTIALS res
,
78 int gnutls_certificate_set_openpgp_keyring_mem( GNUTLS_CERTIFICATE_CREDENTIALS res
,
79 const char *data
, size_t len
);
81 int gnutls_certificate_set_openpgp_keyring_file( GNUTLS_CERTIFICATE_CREDENTIALS res
, const char *name
);
83 int gnutls_global_init_extra(void);