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 NET_CERT_SIGNED_TREE_HEAD_H_ | 5 #ifndef NET_CERT_SIGNED_TREE_HEAD_H_ |
6 #define NET_CERT_SIGNED_TREE_HEAD_H_ | 6 #define NET_CERT_SIGNED_TREE_HEAD_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <iosfwd> | 10 #include <iosfwd> |
(...skipping 18 matching lines...) Expand all Loading... |
29 // RFC6962-bis to use separate versions, so using a separate scheme here. | 29 // RFC6962-bis to use separate versions, so using a separate scheme here. |
30 enum Version { V1 = 0, }; | 30 enum Version { V1 = 0, }; |
31 | 31 |
32 SignedTreeHead(); | 32 SignedTreeHead(); |
33 SignedTreeHead(Version version, | 33 SignedTreeHead(Version version, |
34 const base::Time& timestamp, | 34 const base::Time& timestamp, |
35 uint64_t tree_size, | 35 uint64_t tree_size, |
36 const char sha256_root_hash[kSthRootHashLength], | 36 const char sha256_root_hash[kSthRootHashLength], |
37 const DigitallySigned& signature, | 37 const DigitallySigned& signature, |
38 const std::string& log_id); | 38 const std::string& log_id); |
| 39 SignedTreeHead(const SignedTreeHead& other); |
39 ~SignedTreeHead(); | 40 ~SignedTreeHead(); |
40 | 41 |
41 Version version; | 42 Version version; |
42 base::Time timestamp; | 43 base::Time timestamp; |
43 uint64_t tree_size; | 44 uint64_t tree_size; |
44 char sha256_root_hash[kSthRootHashLength]; | 45 char sha256_root_hash[kSthRootHashLength]; |
45 DigitallySigned signature; | 46 DigitallySigned signature; |
46 | 47 |
47 // Added in RFC6962-bis, Appendix A. Needed to identify which log | 48 // Added in RFC6962-bis, Appendix A. Needed to identify which log |
48 // this STH belongs to. | 49 // this STH belongs to. |
49 std::string log_id; | 50 std::string log_id; |
50 }; | 51 }; |
51 | 52 |
52 NET_EXPORT void PrintTo(const SignedTreeHead& sth, std::ostream* os); | 53 NET_EXPORT void PrintTo(const SignedTreeHead& sth, std::ostream* os); |
53 | 54 |
54 } // namespace ct | 55 } // namespace ct |
55 | 56 |
56 } // namespace net | 57 } // namespace net |
57 | 58 |
58 #endif | 59 #endif |
OLD | NEW |