blob: 6a7eba768f17f5666ce50583a2bfc89b7de3cdf1 [file] [log] [blame]
vasilvvb67d2982020-04-24 01:20:09 -07001// Copyright 2020 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef QUICHE_QUIC_TEST_TOOLS_TEST_CERTIFICATES_H_
6#define QUICHE_QUIC_TEST_TOOLS_TEST_CERTIFICATES_H_
7
vasilvv8f9591b2020-10-26 17:01:14 -07008#include "absl/base/attributes.h"
vasilvv5f225b02020-10-08 11:49:09 -04009#include "absl/strings/string_view.h"
vasilvvb67d2982020-04-24 01:20:09 -070010
11namespace quic {
12namespace test {
13
14// A test certificate generated by //net/tools/quic/certs/generate-certs.sh.
vasilvv8f9591b2020-10-26 17:01:14 -070015ABSL_CONST_INIT extern const absl::string_view kTestCertificate;
vasilvvb67d2982020-04-24 01:20:09 -070016
17// PEM-encoded version of |kTestCertificate|.
vasilvv8f9591b2020-10-26 17:01:14 -070018ABSL_CONST_INIT extern const char kTestCertificatePem[];
vasilvvb67d2982020-04-24 01:20:09 -070019
20// |kTestCertificatePem| with a PEM-encoded root appended to the end.
vasilvv8f9591b2020-10-26 17:01:14 -070021ABSL_CONST_INIT extern const char kTestCertificateChainPem[];
vasilvvb67d2982020-04-24 01:20:09 -070022
nharperf424d1a2020-05-27 16:13:58 -040023// PEM-encoded certificate that contains a subjectAltName with an
24// unknown/unsupported type.
vasilvv8f9591b2020-10-26 17:01:14 -070025ABSL_CONST_INIT extern const char kTestCertWithUnknownSanTypePem[];
nharperf424d1a2020-05-27 16:13:58 -040026
vasilvvb67d2982020-04-24 01:20:09 -070027// DER-encoded private key for |kTestCertificate|.
vasilvv8f9591b2020-10-26 17:01:14 -070028ABSL_CONST_INIT extern const absl::string_view kTestCertificatePrivateKey;
vasilvvb67d2982020-04-24 01:20:09 -070029
30// PEM-encoded version of |kTestCertificatePrivateKey|.
vasilvv8f9591b2020-10-26 17:01:14 -070031ABSL_CONST_INIT extern const char kTestCertificatePrivateKeyPem[];
vasilvvb67d2982020-04-24 01:20:09 -070032
33// The legacy PEM-encoded version of |kTestCertificatePrivateKey| manually
34// generated from the one above using der2ascii.
vasilvv8f9591b2020-10-26 17:01:14 -070035ABSL_CONST_INIT extern const char kTestCertificatePrivateKeyLegacyPem[];
vasilvvb67d2982020-04-24 01:20:09 -070036
37// Another DER-encoded test certificate, valid for foo.test, www.foo.test and
38// *.wildcard.test.
vasilvv8f9591b2020-10-26 17:01:14 -070039ABSL_CONST_INIT extern const absl::string_view kWildcardCertificate;
vasilvvb67d2982020-04-24 01:20:09 -070040
41// DER-encoded private key for |kWildcardCertificate|.
vasilvv8f9591b2020-10-26 17:01:14 -070042ABSL_CONST_INIT extern const absl::string_view kWildcardCertificatePrivateKey;
vasilvvb67d2982020-04-24 01:20:09 -070043
vasilvvac5f49d2020-07-29 14:00:39 -070044// PEM-encoded P-256 private key using legacy OpenSSL encoding.
vasilvv8f9591b2020-10-26 17:01:14 -070045ABSL_CONST_INIT extern const char kTestEcPrivateKeyLegacyPem[];
vasilvvac5f49d2020-07-29 14:00:39 -070046
vasilvvb67d2982020-04-24 01:20:09 -070047} // namespace test
48} // namespace quic
49
50#endif // QUICHE_QUIC_TEST_TOOLS_TEST_CERTIFICATES_H_