blob: 867228840d735ac489c9352e5672f2bf637ada10 [file] [log] [blame]
Paul Bakker5121ce52009-01-03 21:22:43 +00001/**
2 * \file certs.h
Paul Bakkere0ccd0a2009-01-04 16:27:10 +00003 *
Paul Bakkerf3b86c12011-01-27 15:24:17 +00004 * \brief Sample certificates and DHM parameters for testing
Darryl Greena40a1012018-01-05 15:33:17 +00005 */
6/*
Bence Szépkúti44bfbe32020-08-19 16:54:51 +02007 * Copyright The Mbed TLS Contributors
Bence Szépkúti4e9f7122020-06-05 13:02:18 +02008 * SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
9 *
10 * This file is provided under the Apache License 2.0, or the
11 * GNU General Public License v2.0 or later.
12 *
13 * **********
14 * Apache License 2.0:
Manuel Pégourié-Gonnard37ff1402015-09-04 14:21:07 +020015 *
16 * Licensed under the Apache License, Version 2.0 (the "License"); you may
17 * not use this file except in compliance with the License.
18 * You may obtain a copy of the License at
19 *
20 * http://www.apache.org/licenses/LICENSE-2.0
21 *
22 * Unless required by applicable law or agreed to in writing, software
23 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
24 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
25 * See the License for the specific language governing permissions and
26 * limitations under the License.
Paul Bakkerb96f1542010-07-18 20:36:00 +000027 *
Bence Szépkúti4e9f7122020-06-05 13:02:18 +020028 * **********
29 *
30 * **********
31 * GNU General Public License v2.0 or later:
32 *
33 * This program is free software; you can redistribute it and/or modify
34 * it under the terms of the GNU General Public License as published by
35 * the Free Software Foundation; either version 2 of the License, or
36 * (at your option) any later version.
37 *
38 * This program is distributed in the hope that it will be useful,
39 * but WITHOUT ANY WARRANTY; without even the implied warranty of
40 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
41 * GNU General Public License for more details.
42 *
43 * You should have received a copy of the GNU General Public License along
44 * with this program; if not, write to the Free Software Foundation, Inc.,
45 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
46 *
47 * **********
Paul Bakker5121ce52009-01-03 21:22:43 +000048 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020049#ifndef MBEDTLS_CERTS_H
50#define MBEDTLS_CERTS_H
Paul Bakker5121ce52009-01-03 21:22:43 +000051
Ron Eldor0559c662018-02-14 16:02:41 +020052#if !defined(MBEDTLS_CONFIG_FILE)
53#include "config.h"
54#else
55#include MBEDTLS_CONFIG_FILE
56#endif
57
Manuel Pégourié-Gonnard75f90102015-03-27 09:56:18 +010058#include <stddef.h>
59
Paul Bakker5121ce52009-01-03 21:22:43 +000060#ifdef __cplusplus
61extern "C" {
62#endif
63
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020064#if defined(MBEDTLS_PEM_PARSE_C)
Manuel Pégourié-Gonnard2f165062015-03-27 10:20:26 +010065/* Concatenation of all CA certificates in PEM format if available */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020066extern const char mbedtls_test_cas_pem[];
67extern const size_t mbedtls_test_cas_pem_len;
Manuel Pégourié-Gonnarda958d692015-03-27 10:23:53 +010068#endif
Manuel Pégourié-Gonnard641de712013-09-25 13:23:33 +020069
Manuel Pégourié-Gonnard2f165062015-03-27 10:20:26 +010070/* List of all CA certificates, terminated by NULL */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020071extern const char * mbedtls_test_cas[];
72extern const size_t mbedtls_test_cas_len[];
Manuel Pégourié-Gonnard2f165062015-03-27 10:20:26 +010073
Manuel Pégourié-Gonnarda0fdf8b2013-09-25 14:05:49 +020074/*
75 * Convenience for users who just want a certificate:
Manuel Pégourié-Gonnardb63e3dd2015-03-06 09:42:40 +000076 * RSA by default, or ECDSA if RSA is not available
Manuel Pégourié-Gonnarda0fdf8b2013-09-25 14:05:49 +020077 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020078extern const char * mbedtls_test_ca_crt;
79extern const size_t mbedtls_test_ca_crt_len;
80extern const char * mbedtls_test_ca_key;
81extern const size_t mbedtls_test_ca_key_len;
82extern const char * mbedtls_test_ca_pwd;
83extern const size_t mbedtls_test_ca_pwd_len;
84extern const char * mbedtls_test_srv_crt;
85extern const size_t mbedtls_test_srv_crt_len;
86extern const char * mbedtls_test_srv_key;
87extern const size_t mbedtls_test_srv_key_len;
88extern const char * mbedtls_test_cli_crt;
89extern const size_t mbedtls_test_cli_crt_len;
90extern const char * mbedtls_test_cli_key;
91extern const size_t mbedtls_test_cli_key_len;
Manuel Pégourié-Gonnard482a2822013-09-24 19:33:17 +020092
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020093#if defined(MBEDTLS_ECDSA_C)
94extern const char mbedtls_test_ca_crt_ec[];
95extern const size_t mbedtls_test_ca_crt_ec_len;
96extern const char mbedtls_test_ca_key_ec[];
97extern const size_t mbedtls_test_ca_key_ec_len;
98extern const char mbedtls_test_ca_pwd_ec[];
99extern const size_t mbedtls_test_ca_pwd_ec_len;
100extern const char mbedtls_test_srv_crt_ec[];
101extern const size_t mbedtls_test_srv_crt_ec_len;
102extern const char mbedtls_test_srv_key_ec[];
103extern const size_t mbedtls_test_srv_key_ec_len;
104extern const char mbedtls_test_cli_crt_ec[];
105extern const size_t mbedtls_test_cli_crt_ec_len;
106extern const char mbedtls_test_cli_key_ec[];
107extern const size_t mbedtls_test_cli_key_ec_len;
Manuel Pégourié-Gonnard482a2822013-09-24 19:33:17 +0200108#endif
109
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200110#if defined(MBEDTLS_RSA_C)
111extern const char mbedtls_test_ca_crt_rsa[];
112extern const size_t mbedtls_test_ca_crt_rsa_len;
113extern const char mbedtls_test_ca_key_rsa[];
114extern const size_t mbedtls_test_ca_key_rsa_len;
115extern const char mbedtls_test_ca_pwd_rsa[];
116extern const size_t mbedtls_test_ca_pwd_rsa_len;
117extern const char mbedtls_test_srv_crt_rsa[];
118extern const size_t mbedtls_test_srv_crt_rsa_len;
119extern const char mbedtls_test_srv_key_rsa[];
120extern const size_t mbedtls_test_srv_key_rsa_len;
121extern const char mbedtls_test_cli_crt_rsa[];
122extern const size_t mbedtls_test_cli_crt_rsa_len;
123extern const char mbedtls_test_cli_key_rsa[];
124extern const size_t mbedtls_test_cli_key_rsa_len;
Manuel Pégourié-Gonnard482a2822013-09-24 19:33:17 +0200125#endif
126
Paul Bakker5121ce52009-01-03 21:22:43 +0000127#ifdef __cplusplus
128}
129#endif
130
131#endif /* certs.h */