OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 NET_CERT_CT_TEST_UTIL_H_ | 5 #ifndef NET_CERT_CT_TEST_UTIL_H_ |
6 #define NET_CERT_CT_TEST_UTIL_H_ | 6 #define NET_CERT_CT_TEST_UTIL_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
| 9 #include "base/memory/ref_counted.h" |
9 | 10 |
10 namespace net { | 11 namespace net { |
11 | 12 |
12 class X509Certificate; | |
13 | |
14 namespace ct { | 13 namespace ct { |
15 | 14 |
16 struct LogEntry; | 15 struct LogEntry; |
17 struct SignedCertificateTimestamp; | 16 struct SignedCertificateTimestamp; |
18 | 17 |
19 // Note: unless specified otherwise, all test data is taken from Certificate | 18 // Note: unless specified otherwise, all test data is taken from Certificate |
20 // Transparency test data repository. | 19 // Transparency test data repository. |
21 | 20 |
22 // Fills |entry| with test data for an X.509 entry. | 21 // Fills |entry| with test data for an X.509 entry. |
23 void GetX509CertLogEntry(LogEntry* entry); | 22 void GetX509CertLogEntry(LogEntry* entry); |
24 | 23 |
25 // Fills |entry| with test data for a Precertificate entry. | 24 // Fills |entry| with test data for a Precertificate entry. |
26 void GetPrecertLogEntry(LogEntry* entry); | 25 void GetPrecertLogEntry(LogEntry* entry); |
27 | 26 |
28 // Returns the binary representation of a test DigitallySigned | 27 // Returns the binary representation of a test DigitallySigned |
29 std::string GetTestDigitallySigned(); | 28 std::string GetTestDigitallySigned(); |
30 | 29 |
31 // Returns the binary representation of a test serialized SCT. | 30 // Returns the binary representation of a test serialized SCT. |
32 std::string GetTestSignedCertificateTimestamp(); | 31 std::string GetTestSignedCertificateTimestamp(); |
33 | 32 |
34 // Test log key | 33 // Test log key |
35 std::string GetTestPublicKey(); | 34 std::string GetTestPublicKey(); |
36 | 35 |
37 // ID of test log key | 36 // ID of test log key |
38 std::string GetTestPublicKeyId(); | 37 std::string GetTestPublicKeyId(); |
39 | 38 |
40 // SCT for the X509Certificate provided above. | 39 // SCT for the X509Certificate provided above. |
41 void GetX509CertSCT(SignedCertificateTimestamp* sct); | 40 void GetX509CertSCT(scoped_refptr<SignedCertificateTimestamp>* sct); |
42 | 41 |
43 // SCT for the Precertificate log entry provided above. | 42 // SCT for the Precertificate log entry provided above. |
44 void GetPrecertSCT(SignedCertificateTimestamp* sct); | 43 void GetPrecertSCT(scoped_refptr<SignedCertificateTimestamp>* sct); |
45 | 44 |
46 } // namespace ct | 45 } // namespace ct |
47 | 46 |
48 } // namespace net | 47 } // namespace net |
49 | 48 |
50 #endif // NET_CERT_CT_TEST_UTIL_H_ | 49 #endif // NET_CERT_CT_TEST_UTIL_H_ |
OLD | NEW |