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 <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/time/time.h" | 11 #include "base/time/time.h" |
12 #include "net/base/hash_value.h" | 12 #include "net/base/hash_value.h" |
13 #include "net/base/net_export.h" | 13 #include "net/base/net_export.h" |
14 #include "net/cert/signed_certificate_timestamp.h" | 14 #include "net/cert/signed_certificate_timestamp.h" |
15 | 15 |
16 namespace net { | 16 namespace net { |
17 | 17 |
18 namespace ct { | 18 namespace ct { |
19 | 19 |
20 static const uint8 kSthRootHashLength = 32; | 20 static const uint8_t kSthRootHashLength = 32; |
21 | 21 |
22 // Signed Tree Head as defined in section 3.5. of RFC6962 | 22 // Signed Tree Head as defined in section 3.5. of RFC6962 |
23 struct NET_EXPORT SignedTreeHead { | 23 struct NET_EXPORT SignedTreeHead { |
24 // Version enum in RFC 6962, Section 3.2. Note that while in the current | 24 // Version enum in RFC 6962, Section 3.2. Note that while in the current |
25 // RFC the STH and SCT share the versioning scheme, there are plans in | 25 // RFC the STH and SCT share the versioning scheme, there are plans in |
26 // RFC6962-bis to use separate versions, so using a separate scheme here. | 26 // RFC6962-bis to use separate versions, so using a separate scheme here. |
27 enum Version { V1 = 0, }; | 27 enum Version { V1 = 0, }; |
28 | 28 |
29 Version version; | 29 Version version; |
30 base::Time timestamp; | 30 base::Time timestamp; |
31 uint64 tree_size; | 31 uint64_t tree_size; |
32 char sha256_root_hash[kSthRootHashLength]; | 32 char sha256_root_hash[kSthRootHashLength]; |
33 DigitallySigned signature; | 33 DigitallySigned signature; |
34 }; | 34 }; |
35 | 35 |
36 } // namespace ct | 36 } // namespace ct |
37 | 37 |
38 } // namespace net | 38 } // namespace net |
39 | 39 |
40 #endif | 40 #endif |
OLD | NEW |