OLD | NEW |
---|---|
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_PARSED_CERTIFICATE_H_ | 5 #ifndef NET_CERT_INTERNAL_PARSED_CERTIFICATE_H_ |
6 #define NET_CERT_INTERNAL_PARSED_CERTIFICATE_H_ | 6 #define NET_CERT_INTERNAL_PARSED_CERTIFICATE_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <memory> | 9 #include <memory> |
10 #include <vector> | 10 #include <vector> |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
145 // Returns true if the certificate has a NameConstraints extension. | 145 // Returns true if the certificate has a NameConstraints extension. |
146 bool has_name_constraints() const { return name_constraints_ != nullptr; } | 146 bool has_name_constraints() const { return name_constraints_ != nullptr; } |
147 | 147 |
148 // Returns the parsed NameConstraints extension. Must not be called if | 148 // Returns the parsed NameConstraints extension. Must not be called if |
149 // has_name_constraints() is false. | 149 // has_name_constraints() is false. |
150 const NameConstraints& name_constraints() const { | 150 const NameConstraints& name_constraints() const { |
151 DCHECK(name_constraints_); | 151 DCHECK(name_constraints_); |
152 return *name_constraints_; | 152 return *name_constraints_; |
153 } | 153 } |
154 | 154 |
155 // Returns true if the certificate has an AuthorityInfoAccess extension. | |
156 bool has_authority_info_access() const { return has_authority_info_access_; } | |
157 // Returns the ParsedExtension struct for the AuthorityInfoAccess extension. | |
158 const ParsedExtension& authority_info_access_extension() const { | |
159 return authority_info_access_extension_; | |
160 } | |
161 // Returns any caIssuers URIs from the AuthorityInfoAccess extension. | |
eroman
2016/06/04 01:08:48
nit: space after closing bracket (and elsewhere).
mattm
2016/06/04 03:24:09
Done.
| |
162 const std::vector<base::StringPiece>& ca_issuers_uris() const { | |
163 return ca_issuers_uris_; | |
164 } | |
165 // Returns any ocsp URIs from the AuthorityInfoAccess extension. | |
eroman
2016/06/04 01:08:48
nit: ocsp --> OCSP
mattm
2016/06/04 03:24:09
Done.
| |
166 const std::vector<base::StringPiece>& ocsp_uris() const { return ocsp_uris_; } | |
167 | |
155 // Returns a map of unhandled extensions (excludes the ones above). | 168 // Returns a map of unhandled extensions (excludes the ones above). |
156 const ExtensionsMap& unparsed_extensions() const { | 169 const ExtensionsMap& unparsed_extensions() const { |
157 return unparsed_extensions_; | 170 return unparsed_extensions_; |
158 } | 171 } |
159 | 172 |
160 private: | 173 private: |
161 friend class base::RefCountedThreadSafe<ParsedCertificate>; | 174 friend class base::RefCountedThreadSafe<ParsedCertificate>; |
162 ParsedCertificate(); | 175 ParsedCertificate(); |
163 ~ParsedCertificate(); | 176 ~ParsedCertificate(); |
164 | 177 |
(...skipping 30 matching lines...) Expand all Loading... | |
195 der::BitString key_usage_; | 208 der::BitString key_usage_; |
196 | 209 |
197 // Raw SubjectAltName extension. | 210 // Raw SubjectAltName extension. |
198 ParsedExtension subject_alt_names_extension_; | 211 ParsedExtension subject_alt_names_extension_; |
199 // Parsed SubjectAltName extension. | 212 // Parsed SubjectAltName extension. |
200 std::unique_ptr<GeneralNames> subject_alt_names_; | 213 std::unique_ptr<GeneralNames> subject_alt_names_; |
201 | 214 |
202 // NameConstraints extension. | 215 // NameConstraints extension. |
203 std::unique_ptr<NameConstraints> name_constraints_; | 216 std::unique_ptr<NameConstraints> name_constraints_; |
204 | 217 |
218 // AuthorityInfoAccess extension. | |
219 bool has_authority_info_access_; | |
220 ParsedExtension authority_info_access_extension_; | |
221 // CaIssuers and Ocsp URIs parsed from the AuthorityInfoAccess extension. Note | |
222 // that the AuthorityInfoAccess may have contained other AccessDescriptions | |
223 // which are not represented here. | |
224 std::vector<base::StringPiece> ca_issuers_uris_; | |
225 std::vector<base::StringPiece> ocsp_uris_; | |
226 | |
205 // The remaining extensions (excludes the standard ones above). | 227 // The remaining extensions (excludes the standard ones above). |
206 ExtensionsMap unparsed_extensions_; | 228 ExtensionsMap unparsed_extensions_; |
207 | 229 |
208 DISALLOW_COPY_AND_ASSIGN(ParsedCertificate); | 230 DISALLOW_COPY_AND_ASSIGN(ParsedCertificate); |
209 }; | 231 }; |
210 | 232 |
211 } // namespace net | 233 } // namespace net |
212 | 234 |
213 #endif // NET_CERT_INTERNAL_PARSED_CERTIFICATE_H_ | 235 #endif // NET_CERT_INTERNAL_PARSED_CERTIFICATE_H_ |
OLD | NEW |