Simplified certificate verification by adding gnutls_certificate_verify_peers3().
[gnutls.git] / lib / openpgp / openpgp_int.h
bloba144793cf8e6e537d572ca020fcda671a2f61e88
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 #ifndef OPENPGP_LOCAL_H
24 #define OPENPGP_LOCAL_H
26 #ifdef HAVE_CONFIG_H
27 #include <config.h>
28 #endif
30 #ifdef ENABLE_OPENPGP
32 #include <opencdk/opencdk.h>
33 #include <gnutls/openpgp.h>
35 #define KEYID_IMPORT(dst, src) { \
36 dst[0] = _gnutls_read_uint32( src); \
37 dst[1] = _gnutls_read_uint32( src+4); }
39 /* Internal context to store the OpenPGP key. */
40 typedef struct gnutls_openpgp_crt_int
42 cdk_kbnode_t knode;
43 uint8_t preferred_keyid[GNUTLS_OPENPGP_KEYID_SIZE];
44 int preferred_set;
45 } gnutls_openpgp_crt_int;
47 /* Internal context to store the private OpenPGP key. */
48 typedef struct gnutls_openpgp_privkey_int
50 cdk_kbnode_t knode;
51 uint8_t preferred_keyid[GNUTLS_OPENPGP_KEYID_SIZE];
52 int preferred_set;
53 } gnutls_openpgp_privkey_int;
56 typedef struct gnutls_openpgp_keyring_int
58 cdk_keydb_hd_t db;
59 } gnutls_openpgp_keyring_int;
61 int _gnutls_map_cdk_rc (int rc);
63 int _gnutls_openpgp_export (cdk_kbnode_t node,
64 gnutls_openpgp_crt_fmt_t format,
65 void *output_data, size_t * output_data_size,
66 int priv);
68 int _gnutls_openpgp_export2 (cdk_kbnode_t node,
69 gnutls_openpgp_crt_fmt_t format,
70 gnutls_datum_t* out, int priv);
72 cdk_packet_t _gnutls_get_valid_subkey (cdk_kbnode_t knode, int key_type);
74 unsigned int _gnutls_get_pgp_key_usage (unsigned int pgp_usage);
76 int
77 _gnutls_openpgp_crt_get_mpis (gnutls_openpgp_crt_t cert, uint32_t keyid[2],
78 gnutls_pk_params_st * params);
80 int
81 _gnutls_openpgp_privkey_get_mpis (gnutls_openpgp_privkey_t pkey,
82 uint32_t keyid[2], gnutls_pk_params_st* params);
84 cdk_packet_t _gnutls_openpgp_find_key (cdk_kbnode_t knode, uint32_t keyid[2],
85 unsigned int priv);
87 int _gnutls_read_pgp_mpi (cdk_packet_t pkt, unsigned int priv, size_t idx,
88 bigint_t * m);
90 int _gnutls_openpgp_find_subkey_idx (cdk_kbnode_t knode, uint32_t keyid[2],
91 unsigned int priv);
93 int _gnutls_openpgp_get_algo (int cdk_algo);
95 #endif /* ENABLE_OPENPGP */
97 #endif /* OPENPGP_LOCAL_H */