1189251Ssam/* 2189251Ssam * TLSv1 credentials 3189251Ssam * Copyright (c) 2006-2007, Jouni Malinen <j@w1.fi> 4189251Ssam * 5252726Srpaulo * This software may be distributed under the terms of the BSD license. 6252726Srpaulo * See README for more details. 7189251Ssam */ 8189251Ssam 9189251Ssam#ifndef TLSV1_CRED_H 10189251Ssam#define TLSV1_CRED_H 11189251Ssam 12189251Ssamstruct tlsv1_credentials { 13189251Ssam struct x509_certificate *trusted_certs; 14189251Ssam struct x509_certificate *cert; 15189251Ssam struct crypto_private_key *key; 16189251Ssam 17189251Ssam /* Diffie-Hellman parameters */ 18189251Ssam u8 *dh_p; /* prime */ 19189251Ssam size_t dh_p_len; 20189251Ssam u8 *dh_g; /* generator */ 21189251Ssam size_t dh_g_len; 22189251Ssam}; 23189251Ssam 24189251Ssam 25189251Ssamstruct tlsv1_credentials * tlsv1_cred_alloc(void); 26189251Ssamvoid tlsv1_cred_free(struct tlsv1_credentials *cred); 27189251Ssamint tlsv1_set_ca_cert(struct tlsv1_credentials *cred, const char *cert, 28189251Ssam const u8 *cert_blob, size_t cert_blob_len, 29189251Ssam const char *path); 30189251Ssamint tlsv1_set_cert(struct tlsv1_credentials *cred, const char *cert, 31189251Ssam const u8 *cert_blob, size_t cert_blob_len); 32189251Ssamint tlsv1_set_private_key(struct tlsv1_credentials *cred, 33189251Ssam const char *private_key, 34189251Ssam const char *private_key_passwd, 35189251Ssam const u8 *private_key_blob, 36189251Ssam size_t private_key_blob_len); 37189251Ssamint tlsv1_set_dhparams(struct tlsv1_credentials *cred, const char *dh_file, 38189251Ssam const u8 *dh_blob, size_t dh_blob_len); 39189251Ssam 40189251Ssam#endif /* TLSV1_CRED_H */ 41