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 class Pickle; |
| 17 class PickleIterator; |
| 18 |
16 namespace net { | 19 namespace net { |
17 | 20 |
18 // Structures related to Certificate Transparency (RFC6962). | 21 // Structures related to Certificate Transparency (RFC6962). |
19 namespace ct { | 22 namespace ct { |
20 | 23 |
21 // LogEntry struct in RFC 6962, Section 3.1 | 24 // LogEntry struct in RFC 6962, Section 3.1 |
22 struct NET_EXPORT LogEntry { | 25 struct NET_EXPORT LogEntry { |
23 // LogEntryType enum in RFC 6962, Section 3.1 | 26 // LogEntryType enum in RFC 6962, Section 3.1 |
24 enum Type { | 27 enum Type { |
25 LOG_ENTRY_TYPE_X509 = 0, | 28 LOG_ENTRY_TYPE_X509 = 0, |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 | 89 |
87 // Source of the SCT - supplementary, not defined in CT RFC. | 90 // Source of the SCT - supplementary, not defined in CT RFC. |
88 enum Origin { | 91 enum Origin { |
89 SCT_EMBEDDED = 0, | 92 SCT_EMBEDDED = 0, |
90 SCT_FROM_TLS_EXTENSION = 1, | 93 SCT_FROM_TLS_EXTENSION = 1, |
91 SCT_FROM_OCSP_RESPONSE = 2, | 94 SCT_FROM_OCSP_RESPONSE = 2, |
92 }; | 95 }; |
93 | 96 |
94 SignedCertificateTimestamp(); | 97 SignedCertificateTimestamp(); |
95 | 98 |
| 99 void Persist(Pickle* pickle); |
| 100 static SignedCertificateTimestamp* CreateFromPickle(PickleIterator* iter); |
| 101 |
96 Version version; | 102 Version version; |
97 std::string log_id; | 103 std::string log_id; |
98 base::Time timestamp; | 104 base::Time timestamp; |
99 std::string extensions; | 105 std::string extensions; |
100 DigitallySigned signature; | 106 DigitallySigned signature; |
101 // The origin should not participate in equality checks | 107 // The origin should not participate in equality checks |
102 // as the same SCT can be provided from multiple sources. | 108 // as the same SCT can be provided from multiple sources. |
103 Origin origin; | 109 Origin origin; |
104 | 110 |
105 private: | 111 private: |
106 friend class base::RefCountedThreadSafe<SignedCertificateTimestamp>; | 112 friend class base::RefCountedThreadSafe<SignedCertificateTimestamp>; |
107 | 113 |
108 ~SignedCertificateTimestamp(); | 114 ~SignedCertificateTimestamp(); |
109 | 115 |
110 DISALLOW_COPY_AND_ASSIGN(SignedCertificateTimestamp); | 116 DISALLOW_COPY_AND_ASSIGN(SignedCertificateTimestamp); |
111 }; | 117 }; |
112 | 118 |
113 } // namespace ct | 119 } // namespace ct |
114 | 120 |
115 } // namespace net | 121 } // namespace net |
116 | 122 |
117 #endif // NET_CERT_SIGNED_CERTIFICATE_TIMESTAMP_H_ | 123 #endif // NET_CERT_SIGNED_CERTIFICATE_TIMESTAMP_H_ |
OLD | NEW |