Simplified certificate verification by adding gnutls_certificate_verify_peers3().
[gnutls.git] / lib / openpgp / gnutls_openpgp.h
blob4949624fa6b37e0711e6407943371d1e4e8bb37a
1 /*
2 * Copyright (C) 2002-2012 Free Software Foundation, Inc.
4 * Author: Timo Schulz, Nikos Mavrogiannopoulos
6 * This file is part of GnuTLS.
8 * The GnuTLS is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public License
10 * as published by the Free Software Foundation; either version 3 of
11 * the License, or (at your option) any later version.
13 * This library is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
18 * You should have received a copy of the GNU Lesser General Public License
19 * along with this program. If not, see <http://www.gnu.org/licenses/>
23 #include <config.h>
25 #ifdef ENABLE_OPENPGP
27 #ifndef GNUTLS_OPENPGP_LOCAL_H
28 #define GNUTLS_OPENPGP_LOCAL_H
30 #include <auth/cert.h>
31 #include <opencdk.h>
32 #include <gnutls/abstract.h>
34 /* OpenCDK compatible */
35 typedef enum
37 KEY_ATTR_NONE = 0,
38 KEY_ATTR_SHORT_KEYID = 3,
39 KEY_ATTR_KEYID = 4,
40 KEY_ATTR_FPR = 5
41 } key_attr_t;
43 int gnutls_openpgp_count_key_names (const gnutls_datum_t * cert);
45 int gnutls_openpgp_get_key (gnutls_datum_t * key,
46 gnutls_openpgp_keyring_t keyring,
47 key_attr_t by, uint8_t * pattern);
49 /* internal */
50 int
51 _gnutls_openpgp_privkey_cpy (gnutls_openpgp_privkey_t dest, gnutls_openpgp_privkey_t src);
53 int
54 _gnutls_openpgp_request_key (gnutls_session_t,
55 gnutls_datum_t * ret,
56 const gnutls_certificate_credentials_t cred,
57 uint8_t * key_fpr, int key_fpr_size);
59 int _gnutls_openpgp_verify_key (const gnutls_certificate_credentials_t,
60 const char* hostname,
61 const gnutls_datum_t * cert_list,
62 int cert_list_length, unsigned int *status);
63 int _gnutls_openpgp_fingerprint (const gnutls_datum_t * cert,
64 unsigned char *fpr, size_t * fprlen);
65 time_t _gnutls_openpgp_get_raw_key_creation_time (const gnutls_datum_t *
66 cert);
67 time_t _gnutls_openpgp_get_raw_key_expiration_time (const gnutls_datum_t *
68 cert);
70 int
71 _gnutls_openpgp_privkey_sign_hash (gnutls_openpgp_privkey_t key,
72 const gnutls_datum_t * hash,
73 gnutls_datum_t * signature);
76 int
77 _gnutls_openpgp_privkey_decrypt_data (gnutls_openpgp_privkey_t key,
78 unsigned int flags,
79 const gnutls_datum_t * ciphertext,
80 gnutls_datum_t * plaintext);
82 #endif /*GNUTLS_OPENPGP_LOCAL_H */
84 #endif /*ENABLE_OPENPGP */