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 scoped_refptr<SignedCertificateTimestamp> | |
101 CreateFromPickle(PickleIterator* iter); | |
wtc
2013/11/28 01:28:02
Nit: if this works, this line folding might look n
alcutter
2013/11/28 12:08:19
Done.
| |
102 | |
96 Version version; | 103 Version version; |
97 std::string log_id; | 104 std::string log_id; |
98 base::Time timestamp; | 105 base::Time timestamp; |
99 std::string extensions; | 106 std::string extensions; |
100 DigitallySigned signature; | 107 DigitallySigned signature; |
101 // The origin should not participate in equality checks | 108 // The origin should not participate in equality checks |
102 // as the same SCT can be provided from multiple sources. | 109 // as the same SCT can be provided from multiple sources. |
103 Origin origin; | 110 Origin origin; |
104 | 111 |
105 private: | 112 private: |
106 friend class base::RefCountedThreadSafe<SignedCertificateTimestamp>; | 113 friend class base::RefCountedThreadSafe<SignedCertificateTimestamp>; |
107 | 114 |
108 ~SignedCertificateTimestamp(); | 115 ~SignedCertificateTimestamp(); |
109 | 116 |
110 DISALLOW_COPY_AND_ASSIGN(SignedCertificateTimestamp); | 117 DISALLOW_COPY_AND_ASSIGN(SignedCertificateTimestamp); |
111 }; | 118 }; |
112 | 119 |
113 } // namespace ct | 120 } // namespace ct |
114 | 121 |
115 } // namespace net | 122 } // namespace net |
116 | 123 |
117 #endif // NET_CERT_SIGNED_CERTIFICATE_TIMESTAMP_H_ | 124 #endif // NET_CERT_SIGNED_CERTIFICATE_TIMESTAMP_H_ |
OLD | NEW |