1 // 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 8 #include "absl/base/attributes.h" 9 #include "absl/strings/string_view.h" 10 11 namespace quic { 12 namespace test { 13 14 // A test certificate generated by //net/tools/quic/certs/generate-certs.sh. 15 ABSL_CONST_INIT extern const absl::string_view kTestCertificate; 16 17 // PEM-encoded version of |kTestCertificate|. 18 ABSL_CONST_INIT extern const char kTestCertificatePem[]; 19 20 // |kTestCertificatePem| with a PEM-encoded root appended to the end. 21 ABSL_CONST_INIT extern const char kTestCertificateChainPem[]; 22 23 // PEM-encoded certificate that contains a subjectAltName with an 24 // unknown/unsupported type. 25 ABSL_CONST_INIT extern const char kTestCertWithUnknownSanTypePem[]; 26 27 // DER-encoded private key for |kTestCertificate|. 28 ABSL_CONST_INIT extern const absl::string_view kTestCertificatePrivateKey; 29 30 // PEM-encoded version of |kTestCertificatePrivateKey|. 31 ABSL_CONST_INIT extern const char kTestCertificatePrivateKeyPem[]; 32 33 // The legacy PEM-encoded version of |kTestCertificatePrivateKey| manually 34 // generated from the one above using der2ascii. 35 ABSL_CONST_INIT extern const char kTestCertificatePrivateKeyLegacyPem[]; 36 37 // Another DER-encoded test certificate, valid for foo.test, www.foo.test and 38 // *.wildcard.test. 39 ABSL_CONST_INIT extern const absl::string_view kWildcardCertificate; 40 41 // DER-encoded private key for |kWildcardCertificate|. 42 ABSL_CONST_INIT extern const absl::string_view kWildcardCertificatePrivateKey; 43 44 // PEM-encoded P-256 private key using legacy OpenSSL encoding. 45 ABSL_CONST_INIT extern const char kTestEcPrivateKeyLegacyPem[]; 46 47 } // namespace test 48 } // namespace quic 49 50 #endif // QUICHE_QUIC_TEST_TOOLS_TEST_CERTIFICATES_H_ 51