Blame lib/cert-cred.h

Packit aea12f
/*
Packit aea12f
 * Copyright (C) 2018 Free Software Foundation, Inc.
Packit aea12f
 *
Packit aea12f
 * Author: Nikos Mavrogiannopoulos
Packit aea12f
 *
Packit aea12f
 * This file is part of GnuTLS.
Packit aea12f
 *
Packit aea12f
 * The GnuTLS is free software; you can redistribute it and/or
Packit aea12f
 * modify it under the terms of the GNU Lesser General Public License
Packit aea12f
 * as published by the Free Software Foundation; either version 2.1 of
Packit aea12f
 * the License, or (at your option) any later version.
Packit aea12f
 *
Packit aea12f
 * This library is distributed in the hope that it will be useful, but
Packit aea12f
 * WITHOUT ANY WARRANTY; without even the implied warranty of
Packit aea12f
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit aea12f
 * Lesser General Public License for more details.
Packit aea12f
 *
Packit aea12f
 * You should have received a copy of the GNU Lesser General Public License
Packit aea12f
 * along with this program.  If not, see <https://www.gnu.org/licenses/>
Packit aea12f
 *
Packit aea12f
 */
Packit aea12f
Packit aea12f
#ifndef GNUTLS_LIB_CERT_CRED_H
Packit aea12f
#define GNUTLS_LIB_CERT_CRED_H
Packit aea12f
Packit aea12f
#include <gnutls/abstract.h>
Packit aea12f
#include "str_array.h"
Packit aea12f
Packit aea12f
Packit aea12f
int
Packit aea12f
_gnutls_certificate_credential_append_keypair(gnutls_certificate_credentials_t res,
Packit aea12f
				       gnutls_privkey_t key,
Packit aea12f
				       gnutls_str_array_t names,
Packit aea12f
				       gnutls_pcert_st * crt, int nr);
Packit aea12f
Packit aea12f
int
Packit aea12f
_gnutls_read_key_mem(gnutls_certificate_credentials_t res,
Packit aea12f
	     const void *key, int key_size, gnutls_x509_crt_fmt_t type,
Packit aea12f
	     const char *pass, unsigned int flags,
Packit aea12f
	     gnutls_privkey_t *rkey);
Packit aea12f
Packit aea12f
int
Packit aea12f
_gnutls_read_key_file(gnutls_certificate_credentials_t res,
Packit aea12f
	      const char *keyfile, gnutls_x509_crt_fmt_t type,
Packit aea12f
	      const char *pass, unsigned int flags,
Packit aea12f
	      gnutls_privkey_t *rkey);
Packit aea12f
Packit aea12f
int
Packit aea12f
_gnutls_get_x509_name(gnutls_x509_crt_t crt, gnutls_str_array_t * names);
Packit aea12f
Packit aea12f
#define CRED_RET_SUCCESS(cred) \
Packit aea12f
	if (cred->flags & GNUTLS_CERTIFICATE_API_V2) { \
Packit aea12f
		return cred->ncerts-1; \
Packit aea12f
	} else { \
Packit aea12f
		return 0; \
Packit aea12f
	}
Packit aea12f
Packit aea12f
#endif /* GNUTLS_LIB_CERT_CRED_H */