OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_H_ | 5 #ifndef EXTENSIONS_COMMON_CAST_CAST_CERT_VALIDATOR_H_ |
6 #define EXTENSIONS_COMMON_CAST_CAST_CERT_VALIDATOR_H_ | 6 #define EXTENSIONS_COMMON_CAST_CAST_CERT_VALIDATOR_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 CastDeviceCertPolicy* policy) WARN_UNUSED_RESULT; | 79 CastDeviceCertPolicy* policy) WARN_UNUSED_RESULT; |
80 | 80 |
81 // Exposed only for unit-tests, not for use in production code. | 81 // Exposed only for unit-tests, not for use in production code. |
82 // Production code would get a context from VerifyDeviceCert(). | 82 // Production code would get a context from VerifyDeviceCert(). |
83 // | 83 // |
84 // Constructs a VerificationContext that uses the provided public key. | 84 // Constructs a VerificationContext that uses the provided public key. |
85 // The common name will be hardcoded to some test value. | 85 // The common name will be hardcoded to some test value. |
86 std::unique_ptr<CertVerificationContext> CertVerificationContextImplForTest( | 86 std::unique_ptr<CertVerificationContext> CertVerificationContextImplForTest( |
87 const base::StringPiece& spki); | 87 const base::StringPiece& spki); |
88 | 88 |
| 89 // Exposed only for testing, not for use in production code. |
| 90 // |
| 91 // Injects trusted root certificates into the CastTrustStore. |
| 92 // |data| must remain valid and not be mutated throughout the lifetime of |
| 93 // the program. |
| 94 // Warning: Using this function concurrently with VerifyDeviceCert() |
| 95 // is not thread safe. |
| 96 bool AddTrustAnchorForTest(const uint8_t* data, |
| 97 size_t length) WARN_UNUSED_RESULT; |
| 98 |
89 } // namespace cast_crypto | 99 } // namespace cast_crypto |
90 } // namespace api | 100 } // namespace api |
91 } // namespace extensions | 101 } // namespace extensions |
92 | 102 |
93 #endif // EXTENSIONS_COMMON_CAST_CAST_CERT_VALIDATOR_H_ | 103 #endif // EXTENSIONS_COMMON_CAST_CAST_CERT_VALIDATOR_H_ |
OLD | NEW |