Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef EXTENSIONS_COMMON_CAST_CAST_CERT_VALIDATOR_TEST_HELPERS_H_ | 5 #ifndef EXTENSIONS_COMMON_CAST_CAST_CERT_VALIDATOR_TEST_HELPERS_H_ |
|
eroman
2016/04/28 19:50:21
Update this.
ryanchung
2016/04/28 20:30:56
Done.
| |
| 6 #define EXTENSIONS_COMMON_CAST_CAST_CERT_VALIDATOR_TEST_HELPERS_H_ | 6 #define EXTENSIONS_COMMON_CAST_CAST_CERT_VALIDATOR_TEST_HELPERS_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/strings/string_piece.h" | 11 #include "base/strings/string_piece.h" |
| 12 | 12 |
| 13 namespace cast_test_helpers { | 13 namespace cast_test_helpers { |
|
eroman
2016/04/28 19:50:20
This should probably be inside the cast_certificat
ryanchung
2016/04/28 20:30:56
Done.
| |
| 14 | 14 |
| 15 // Reads a PEM file containing certificates to a vector of their DER data. | 15 // Reads a PEM file containing certificates to a vector of their DER data. |
| 16 // |file_name| should be relative to //src/extensions/test/data/ | 16 // |file_name| should be relative to //components/test/data/cast_certificate |
| 17 std::vector<std::string> ReadCertificateChainFromFile( | 17 std::vector<std::string> ReadCertificateChainFromFile( |
| 18 const base::StringPiece& file_name); | 18 const base::StringPiece& file_name); |
| 19 | 19 |
| 20 // Helper structure that describes a message and its various signatures. | 20 // Helper structure that describes a message and its various signatures. |
| 21 struct SignatureTestData { | 21 struct SignatureTestData { |
| 22 std::string message; | 22 std::string message; |
| 23 | 23 |
| 24 // RSASSA PKCS#1 v1.5 with SHA1. | 24 // RSASSA PKCS#1 v1.5 with SHA1. |
| 25 std::string signature_sha1; | 25 std::string signature_sha1; |
| 26 | 26 |
| 27 // RSASSA PKCS#1 v1.5 with SHA256. | 27 // RSASSA PKCS#1 v1.5 with SHA256. |
| 28 std::string signature_sha256; | 28 std::string signature_sha256; |
| 29 }; | 29 }; |
| 30 | 30 |
| 31 // Reads a PEM file that contains "MESSAGE", "SIGNATURE SHA1" and | 31 // Reads a PEM file that contains "MESSAGE", "SIGNATURE SHA1" and |
| 32 // "SIGNATURE SHA256" blocks. | 32 // "SIGNATURE SHA256" blocks. |
| 33 // |file_name| should be relative to //src/extensions/test/data/ | 33 // |file_name| should be relative to //components/test/data/cast_certificate |
| 34 SignatureTestData ReadSignatureTestData(const base::StringPiece& file_name); | 34 SignatureTestData ReadSignatureTestData(const base::StringPiece& file_name); |
| 35 | 35 |
| 36 } // namespace cast_test_helpers | 36 } // namespace cast_test_helpers |
| 37 | 37 |
| 38 #endif // EXTENSIONS_COMMON_CAST_CAST_CERT_VALIDATOR_TEST_HELPERS_H_ | 38 #endif // EXTENSIONS_COMMON_CAST_CAST_CERT_VALIDATOR_TEST_HELPERS_H_ |
| OLD | NEW |