provide accurate value to select
[gnutls.git] / lib / openpgp / gnutls_openpgp.h
blob8af869b9a708814eef909dcd78947fd64a0de7cb
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 gnutls_datum_t * cert_list,
61 int cert_list_length, unsigned int *status);
62 int _gnutls_openpgp_fingerprint (const gnutls_datum_t * cert,
63 unsigned char *fpr, size_t * fprlen);
64 time_t _gnutls_openpgp_get_raw_key_creation_time (const gnutls_datum_t *
65 cert);
66 time_t _gnutls_openpgp_get_raw_key_expiration_time (const gnutls_datum_t *
67 cert);
69 int
70 _gnutls_openpgp_privkey_sign_hash (gnutls_openpgp_privkey_t key,
71 const gnutls_datum_t * hash,
72 gnutls_datum_t * signature);
75 int
76 _gnutls_openpgp_privkey_decrypt_data (gnutls_openpgp_privkey_t key,
77 unsigned int flags,
78 const gnutls_datum_t * ciphertext,
79 gnutls_datum_t * plaintext);
81 #endif /*GNUTLS_OPENPGP_LOCAL_H */
83 #endif /*ENABLE_OPENPGP */