OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_INTERNAL_PARSE_CERTIFICATE_H_ | 5 #ifndef NET_CERT_INTERNAL_PARSE_CERTIFICATE_H_ |
6 #define NET_CERT_INTERNAL_PARSE_CERTIFICATE_H_ | 6 #define NET_CERT_INTERNAL_PARSE_CERTIFICATE_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <map> | 10 #include <map> |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 }; | 107 }; |
108 | 108 |
109 // ParsedCertificate contains pointers to the main fields of a DER-encoded RFC | 109 // ParsedCertificate contains pointers to the main fields of a DER-encoded RFC |
110 // 5280 "Certificate". | 110 // 5280 "Certificate". |
111 // | 111 // |
112 // ParsedCertificate is expected to be filled by ParseCertificate(), so | 112 // ParsedCertificate is expected to be filled by ParseCertificate(), so |
113 // subsequent field descriptions are in terms of what ParseCertificate() sets. | 113 // subsequent field descriptions are in terms of what ParseCertificate() sets. |
114 struct NET_EXPORT ParsedCertificate { | 114 struct NET_EXPORT ParsedCertificate { |
115 ParsedCertificate(); | 115 ParsedCertificate(); |
116 ~ParsedCertificate(); | 116 ~ParsedCertificate(); |
| 117 // XXX document |
| 118 ParsedCertificate(const ParsedCertificate& other, |
| 119 const der::Input& old_data, |
| 120 const der::Input& new_data); |
117 | 121 |
118 // Corresponds with "tbsCertificate" from RFC 5280: | 122 // Corresponds with "tbsCertificate" from RFC 5280: |
119 // tbsCertificate TBSCertificate, | 123 // tbsCertificate TBSCertificate, |
120 // | 124 // |
121 // This contains the full (unverified) Tag-Length-Value for a SEQUENCE. No | 125 // This contains the full (unverified) Tag-Length-Value for a SEQUENCE. No |
122 // guarantees are made regarding the value of this SEQUENCE. | 126 // guarantees are made regarding the value of this SEQUENCE. |
123 // | 127 // |
124 // This can be further parsed using ParseTbsCertificate(). | 128 // This can be further parsed using ParseTbsCertificate(). |
125 der::Input tbs_certificate_tlv; | 129 der::Input tbs_certificate_tlv; |
126 | 130 |
(...skipping 15 matching lines...) Expand all Loading... |
142 | 146 |
143 // ParsedTbsCertificate contains pointers to the main fields of a DER-encoded | 147 // ParsedTbsCertificate contains pointers to the main fields of a DER-encoded |
144 // RFC 5280 "TBSCertificate". | 148 // RFC 5280 "TBSCertificate". |
145 // | 149 // |
146 // ParsedTbsCertificate is expected to be filled by ParseTbsCertificate(), so | 150 // ParsedTbsCertificate is expected to be filled by ParseTbsCertificate(), so |
147 // subsequent field descriptions are in terms of what ParseTbsCertificate() | 151 // subsequent field descriptions are in terms of what ParseTbsCertificate() |
148 // sets. | 152 // sets. |
149 struct NET_EXPORT ParsedTbsCertificate { | 153 struct NET_EXPORT ParsedTbsCertificate { |
150 ParsedTbsCertificate(); | 154 ParsedTbsCertificate(); |
151 ~ParsedTbsCertificate(); | 155 ~ParsedTbsCertificate(); |
| 156 // XXX document |
| 157 ParsedTbsCertificate(const ParsedTbsCertificate& other, |
| 158 const der::Input& old_data, |
| 159 const der::Input& new_data); |
152 | 160 |
153 // Corresponds with "version" from RFC 5280: | 161 // Corresponds with "version" from RFC 5280: |
154 // version [0] EXPLICIT Version DEFAULT v1, | 162 // version [0] EXPLICIT Version DEFAULT v1, |
155 // | 163 // |
156 // Parsing guarantees that the version is one of v1, v2, or v3. | 164 // Parsing guarantees that the version is one of v1, v2, or v3. |
157 CertificateVersion version = CertificateVersion::V1; | 165 CertificateVersion version = CertificateVersion::V1; |
158 | 166 |
159 // Corresponds with "serialNumber" from RFC 5280: | 167 // Corresponds with "serialNumber" from RFC 5280: |
160 // serialNumber CertificateSerialNumber, | 168 // serialNumber CertificateSerialNumber, |
161 // | 169 // |
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
394 // be set. | 402 // be set. |
395 // | 403 // |
396 // To test if a particular key usage is set, call, e.g.: | 404 // To test if a particular key usage is set, call, e.g.: |
397 // key_usage->AssertsBit(KEY_USAGE_BIT_DIGITAL_SIGNATURE); | 405 // key_usage->AssertsBit(KEY_USAGE_BIT_DIGITAL_SIGNATURE); |
398 NET_EXPORT bool ParseKeyUsage(const der::Input& key_usage_tlv, | 406 NET_EXPORT bool ParseKeyUsage(const der::Input& key_usage_tlv, |
399 der::BitString* key_usage) WARN_UNUSED_RESULT; | 407 der::BitString* key_usage) WARN_UNUSED_RESULT; |
400 | 408 |
401 } // namespace net | 409 } // namespace net |
402 | 410 |
403 #endif // NET_CERT_INTERNAL_PARSE_CERTIFICATE_H_ | 411 #endif // NET_CERT_INTERNAL_PARSE_CERTIFICATE_H_ |
OLD | NEW |