tlsv1_cred.h 1.4 KB

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