[SHELL-EXPERIMENTS]
[reactos.git] / include / reactos / libs / gnutls / gnutls / tpm.h
1 /*
2 * Copyright (C) 2010-2012 Free Software Foundation, Inc.
3 *
4 * Author: Nikos Mavrogiannopoulos
5 *
6 * This file is part of GnuTLS.
7 *
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 2.1 of
11 * the License, or (at your option) any later version.
12 *
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.
17 *
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/>
20 *
21 */
22
23 #ifndef __GNUTLS_TPM_H
24 #define __GNUTLS_TPM_H
25
26 #include <gnutls/gnutls.h>
27 #include <gnutls/x509.h>
28
29 /* *INDENT-OFF* */
30 #ifdef __cplusplus
31 extern "C" {
32 #endif
33 /* *INDENT-ON* */
34
35 struct tpm_key_list_st;
36 typedef struct tpm_key_list_st *gnutls_tpm_key_list_t;
37
38 #define GNUTLS_TPM_KEY_SIGNING (1<<1)
39 #define GNUTLS_TPM_REGISTER_KEY (1<<2)
40 #define GNUTLS_TPM_KEY_USER (1<<3)
41
42 /**
43 * gnutls_tpmkey_fmt_t:
44 * @GNUTLS_TPMKEY_FMT_RAW: The portable data format.
45 * @GNUTLS_TPMKEY_FMT_DER: An alias for the raw format.
46 * @GNUTLS_TPMKEY_FMT_CTK_PEM: A custom data format used by some TPM tools.
47 *
48 * Enumeration of different certificate encoding formats.
49 */
50 typedef enum {
51 GNUTLS_TPMKEY_FMT_RAW = 0,
52 GNUTLS_TPMKEY_FMT_DER = GNUTLS_TPMKEY_FMT_RAW,
53 GNUTLS_TPMKEY_FMT_CTK_PEM = 1
54 } gnutls_tpmkey_fmt_t;
55
56 int
57 gnutls_tpm_privkey_generate(gnutls_pk_algorithm_t pk,
58 unsigned int bits,
59 const char *srk_password,
60 const char *key_password,
61 gnutls_tpmkey_fmt_t format,
62 gnutls_x509_crt_fmt_t pub_format,
63 gnutls_datum_t * privkey,
64 gnutls_datum_t * pubkey, unsigned int flags);
65
66 void gnutls_tpm_key_list_deinit(gnutls_tpm_key_list_t list);
67 int gnutls_tpm_key_list_get_url(gnutls_tpm_key_list_t list,
68 unsigned int idx, char **url,
69 unsigned int flags);
70 int gnutls_tpm_get_registered(gnutls_tpm_key_list_t * list);
71 int gnutls_tpm_privkey_delete(const char *url, const char *srk_password);
72
73
74 /* *INDENT-OFF* */
75 #ifdef __cplusplus
76 }
77 #endif
78 /* *INDENT-ON* */
79 #endif