tlsv1_cred.h revision c5ec7f57ead87efa365800228aa0b09a12d9e6c4
1/*
2 * TLSv1 credentials
3 * Copyright (c) 2006-2007, Jouni Malinen <j@w1.fi>
4 *
5 * This software may be distributed under the terms of the BSD license.
6 * See README for more details.
7 */
8
9#ifndef TLSV1_CRED_H
10#define TLSV1_CRED_H
11
12struct tlsv1_credentials {
13	struct x509_certificate *trusted_certs;
14	struct x509_certificate *cert;
15	struct crypto_private_key *key;
16
17	/* Diffie-Hellman parameters */
18	u8 *dh_p; /* prime */
19	size_t dh_p_len;
20	u8 *dh_g; /* generator */
21	size_t dh_g_len;
22};
23
24
25struct tlsv1_credentials * tlsv1_cred_alloc(void);
26void tlsv1_cred_free(struct tlsv1_credentials *cred);
27int tlsv1_set_ca_cert(struct tlsv1_credentials *cred, const char *cert,
28		      const u8 *cert_blob, size_t cert_blob_len,
29		      const char *path);
30int tlsv1_set_cert(struct tlsv1_credentials *cred, const char *cert,
31		   const u8 *cert_blob, size_t cert_blob_len);
32int tlsv1_set_private_key(struct tlsv1_credentials *cred,
33			  const char *private_key,
34			  const char *private_key_passwd,
35			  const u8 *private_key_blob,
36			  size_t private_key_blob_len);
37int tlsv1_set_dhparams(struct tlsv1_credentials *cred, const char *dh_file,
38		       const u8 *dh_blob, size_t dh_blob_len);
39
40#endif /* TLSV1_CRED_H */
41