blob: 10cadfc7cfcefece09c4214b610f6dac7b0b6ce6 [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/*
Manuel Pégourié-Gonnard6fb81872015-07-27 11:11:48 +02007 * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved
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 * **********
48 *
Manuel Pégourié-Gonnardfe446432015-03-06 13:17:10 +000049 * This file is part of mbed TLS (https://tls.mbed.org)
Paul Bakker5121ce52009-01-03 21:22:43 +000050 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020051#ifndef MBEDTLS_CERTS_H
52#define MBEDTLS_CERTS_H
Paul Bakker5121ce52009-01-03 21:22:43 +000053
Ron Eldor0559c662018-02-14 16:02:41 +020054#if !defined(MBEDTLS_CONFIG_FILE)
55#include "config.h"
56#else
57#include MBEDTLS_CONFIG_FILE
58#endif
59
Manuel Pégourié-Gonnard75f90102015-03-27 09:56:18 +010060#include <stddef.h>
61
Paul Bakker5121ce52009-01-03 21:22:43 +000062#ifdef __cplusplus
63extern "C" {
64#endif
65
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020066#if defined(MBEDTLS_PEM_PARSE_C)
Manuel Pégourié-Gonnard2f165062015-03-27 10:20:26 +010067/* Concatenation of all CA certificates in PEM format if available */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020068extern const char mbedtls_test_cas_pem[];
69extern const size_t mbedtls_test_cas_pem_len;
Manuel Pégourié-Gonnarda958d692015-03-27 10:23:53 +010070#endif
Manuel Pégourié-Gonnard641de712013-09-25 13:23:33 +020071
Manuel Pégourié-Gonnard2f165062015-03-27 10:20:26 +010072/* List of all CA certificates, terminated by NULL */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020073extern const char * mbedtls_test_cas[];
74extern const size_t mbedtls_test_cas_len[];
Manuel Pégourié-Gonnard2f165062015-03-27 10:20:26 +010075
Manuel Pégourié-Gonnarda0fdf8b2013-09-25 14:05:49 +020076/*
77 * Convenience for users who just want a certificate:
Manuel Pégourié-Gonnardb63e3dd2015-03-06 09:42:40 +000078 * RSA by default, or ECDSA if RSA is not available
Manuel Pégourié-Gonnarda0fdf8b2013-09-25 14:05:49 +020079 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020080extern const char * mbedtls_test_ca_crt;
81extern const size_t mbedtls_test_ca_crt_len;
82extern const char * mbedtls_test_ca_key;
83extern const size_t mbedtls_test_ca_key_len;
84extern const char * mbedtls_test_ca_pwd;
85extern const size_t mbedtls_test_ca_pwd_len;
86extern const char * mbedtls_test_srv_crt;
87extern const size_t mbedtls_test_srv_crt_len;
88extern const char * mbedtls_test_srv_key;
89extern const size_t mbedtls_test_srv_key_len;
90extern const char * mbedtls_test_cli_crt;
91extern const size_t mbedtls_test_cli_crt_len;
92extern const char * mbedtls_test_cli_key;
93extern const size_t mbedtls_test_cli_key_len;
Manuel Pégourié-Gonnard482a2822013-09-24 19:33:17 +020094
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020095#if defined(MBEDTLS_ECDSA_C)
96extern const char mbedtls_test_ca_crt_ec[];
97extern const size_t mbedtls_test_ca_crt_ec_len;
98extern const char mbedtls_test_ca_key_ec[];
99extern const size_t mbedtls_test_ca_key_ec_len;
100extern const char mbedtls_test_ca_pwd_ec[];
101extern const size_t mbedtls_test_ca_pwd_ec_len;
102extern const char mbedtls_test_srv_crt_ec[];
103extern const size_t mbedtls_test_srv_crt_ec_len;
104extern const char mbedtls_test_srv_key_ec[];
105extern const size_t mbedtls_test_srv_key_ec_len;
106extern const char mbedtls_test_cli_crt_ec[];
107extern const size_t mbedtls_test_cli_crt_ec_len;
108extern const char mbedtls_test_cli_key_ec[];
109extern const size_t mbedtls_test_cli_key_ec_len;
Manuel Pégourié-Gonnard482a2822013-09-24 19:33:17 +0200110#endif
111
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200112#if defined(MBEDTLS_RSA_C)
113extern const char mbedtls_test_ca_crt_rsa[];
114extern const size_t mbedtls_test_ca_crt_rsa_len;
115extern const char mbedtls_test_ca_key_rsa[];
116extern const size_t mbedtls_test_ca_key_rsa_len;
117extern const char mbedtls_test_ca_pwd_rsa[];
118extern const size_t mbedtls_test_ca_pwd_rsa_len;
119extern const char mbedtls_test_srv_crt_rsa[];
120extern const size_t mbedtls_test_srv_crt_rsa_len;
121extern const char mbedtls_test_srv_key_rsa[];
122extern const size_t mbedtls_test_srv_key_rsa_len;
123extern const char mbedtls_test_cli_crt_rsa[];
124extern const size_t mbedtls_test_cli_crt_rsa_len;
125extern const char mbedtls_test_cli_key_rsa[];
126extern const size_t mbedtls_test_cli_key_rsa_len;
Manuel Pégourié-Gonnard482a2822013-09-24 19:33:17 +0200127#endif
128
Paul Bakker5121ce52009-01-03 21:22:43 +0000129#ifdef __cplusplus
130}
131#endif
132
133#endif /* certs.h */