tlsv1_cred.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  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. #ifndef TLSV1_CRED_H
  9. #define TLSV1_CRED_H
  10. struct tlsv1_credentials {
  11. struct x509_certificate *trusted_certs;
  12. struct x509_certificate *cert;
  13. struct crypto_private_key *key;
  14. /* Diffie-Hellman parameters */
  15. u8 *dh_p; /* prime */
  16. size_t dh_p_len;
  17. u8 *dh_g; /* generator */
  18. size_t dh_g_len;
  19. };
  20. struct tlsv1_credentials * tlsv1_cred_alloc(void);
  21. void tlsv1_cred_free(struct tlsv1_credentials *cred);
  22. int tlsv1_set_ca_cert(struct tlsv1_credentials *cred, const char *cert,
  23. const u8 *cert_blob, size_t cert_blob_len,
  24. const char *path);
  25. int tlsv1_set_cert(struct tlsv1_credentials *cred, const char *cert,
  26. const u8 *cert_blob, size_t cert_blob_len);
  27. int tlsv1_set_private_key(struct tlsv1_credentials *cred,
  28. const char *private_key,
  29. const char *private_key_passwd,
  30. const u8 *private_key_blob,
  31. size_t private_key_blob_len);
  32. int tlsv1_set_dhparams(struct tlsv1_credentials *cred, const char *dh_file,
  33. const u8 *dh_blob, size_t dh_blob_len);
  34. #endif /* TLSV1_CRED_H */