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_SIGNED_CERTIFICATE_TIMESTAMP_H_ | 5 #ifndef NET_CERT_SIGNED_CERTIFICATE_TIMESTAMP_H_ |
6 #define NET_CERT_SIGNED_CERTIFICATE_TIMESTAMP_H_ | 6 #define NET_CERT_SIGNED_CERTIFICATE_TIMESTAMP_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
12 #include "base/time/time.h" | 12 #include "base/time/time.h" |
13 #include "net/base/hash_value.h" | 13 #include "net/base/hash_value.h" |
14 #include "net/base/net_export.h" | 14 #include "net/base/net_export.h" |
15 | 15 |
| 16 namespace base { |
16 class Pickle; | 17 class Pickle; |
17 class PickleIterator; | 18 class PickleIterator; |
| 19 } |
18 | 20 |
19 namespace net { | 21 namespace net { |
20 | 22 |
21 // Structures related to Certificate Transparency (RFC6962). | 23 // Structures related to Certificate Transparency (RFC6962). |
22 namespace ct { | 24 namespace ct { |
23 | 25 |
24 // LogEntry struct in RFC 6962, Section 3.1 | 26 // LogEntry struct in RFC 6962, Section 3.1 |
25 struct NET_EXPORT LogEntry { | 27 struct NET_EXPORT LogEntry { |
26 // LogEntryType enum in RFC 6962, Section 3.1 | 28 // LogEntryType enum in RFC 6962, Section 3.1 |
27 enum Type { | 29 enum Type { |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 // or be re-assigned. | 100 // or be re-assigned. |
99 enum Origin { | 101 enum Origin { |
100 SCT_EMBEDDED = 0, | 102 SCT_EMBEDDED = 0, |
101 SCT_FROM_TLS_EXTENSION = 1, | 103 SCT_FROM_TLS_EXTENSION = 1, |
102 SCT_FROM_OCSP_RESPONSE = 2, | 104 SCT_FROM_OCSP_RESPONSE = 2, |
103 SCT_ORIGIN_MAX, | 105 SCT_ORIGIN_MAX, |
104 }; | 106 }; |
105 | 107 |
106 SignedCertificateTimestamp(); | 108 SignedCertificateTimestamp(); |
107 | 109 |
108 void Persist(Pickle* pickle); | 110 void Persist(base::Pickle* pickle); |
109 static scoped_refptr<SignedCertificateTimestamp> CreateFromPickle( | 111 static scoped_refptr<SignedCertificateTimestamp> CreateFromPickle( |
110 PickleIterator* iter); | 112 base::PickleIterator* iter); |
111 | 113 |
112 Version version; | 114 Version version; |
113 std::string log_id; | 115 std::string log_id; |
114 base::Time timestamp; | 116 base::Time timestamp; |
115 std::string extensions; | 117 std::string extensions; |
116 DigitallySigned signature; | 118 DigitallySigned signature; |
117 Origin origin; | 119 Origin origin; |
118 // The log description is not one of the SCT fields, but a user-readable | 120 // The log description is not one of the SCT fields, but a user-readable |
119 // name defined alongside the log key. It should not participate | 121 // name defined alongside the log key. It should not participate |
120 // in equality checks as the log's description could change while | 122 // in equality checks as the log's description could change while |
121 // the SCT would be the same. | 123 // the SCT would be the same. |
122 std::string log_description; | 124 std::string log_description; |
123 | 125 |
124 private: | 126 private: |
125 friend class base::RefCountedThreadSafe<SignedCertificateTimestamp>; | 127 friend class base::RefCountedThreadSafe<SignedCertificateTimestamp>; |
126 | 128 |
127 ~SignedCertificateTimestamp(); | 129 ~SignedCertificateTimestamp(); |
128 | 130 |
129 DISALLOW_COPY_AND_ASSIGN(SignedCertificateTimestamp); | 131 DISALLOW_COPY_AND_ASSIGN(SignedCertificateTimestamp); |
130 }; | 132 }; |
131 | 133 |
132 } // namespace ct | 134 } // namespace ct |
133 | 135 |
134 } // namespace net | 136 } // namespace net |
135 | 137 |
136 #endif // NET_CERT_SIGNED_CERTIFICATE_TIMESTAMP_H_ | 138 #endif // NET_CERT_SIGNED_CERTIFICATE_TIMESTAMP_H_ |
OLD | NEW |