File indexing completed on 2025-01-18 10:00:17
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023 #ifndef GNUTLS_TPM_H
0024 #define GNUTLS_TPM_H
0025
0026 #include <gnutls/gnutls.h>
0027 #include <gnutls/x509.h>
0028
0029 #ifdef __cplusplus
0030 extern "C" {
0031 #endif
0032
0033 struct tpm_key_list_st;
0034 typedef struct tpm_key_list_st *gnutls_tpm_key_list_t;
0035
0036 #define GNUTLS_TPM_KEY_SIGNING (1 << 1)
0037 #define GNUTLS_TPM_REGISTER_KEY (1 << 2)
0038 #define GNUTLS_TPM_KEY_USER (1 << 3)
0039
0040
0041
0042
0043
0044
0045
0046
0047
0048 typedef enum {
0049 GNUTLS_TPMKEY_FMT_RAW = 0,
0050 GNUTLS_TPMKEY_FMT_DER = GNUTLS_TPMKEY_FMT_RAW,
0051 GNUTLS_TPMKEY_FMT_CTK_PEM = 1
0052 } gnutls_tpmkey_fmt_t;
0053
0054 int gnutls_tpm_privkey_generate(gnutls_pk_algorithm_t pk, unsigned int bits,
0055 const char *srk_password,
0056 const char *key_password,
0057 gnutls_tpmkey_fmt_t format,
0058 gnutls_x509_crt_fmt_t pub_format,
0059 gnutls_datum_t *privkey, gnutls_datum_t *pubkey,
0060 unsigned int flags);
0061
0062 void gnutls_tpm_key_list_deinit(gnutls_tpm_key_list_t list);
0063 int gnutls_tpm_key_list_get_url(gnutls_tpm_key_list_t list, unsigned int idx,
0064 char **url, unsigned int flags);
0065 int gnutls_tpm_get_registered(gnutls_tpm_key_list_t *list);
0066 int gnutls_tpm_privkey_delete(const char *url, const char *srk_password);
0067
0068 #ifdef __cplusplus
0069 }
0070 #endif
0071
0072 #endif