OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_X509_CERTIFICATE_H_ | 5 #ifndef NET_CERT_X509_CERTIFICATE_H_ |
6 #define NET_CERT_X509_CERTIFICATE_H_ | 6 #define NET_CERT_X509_CERTIFICATE_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <string.h> | 9 #include <string.h> |
10 | 10 |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 | 190 |
191 // Gets the DNS names in the certificate. Pursuant to RFC 2818, Section 3.1 | 191 // Gets the DNS names in the certificate. Pursuant to RFC 2818, Section 3.1 |
192 // Server Identity, if the certificate has a subjectAltName extension of | 192 // Server Identity, if the certificate has a subjectAltName extension of |
193 // type dNSName, this method gets the DNS names in that extension. | 193 // type dNSName, this method gets the DNS names in that extension. |
194 // Otherwise, it gets the common name in the subject field. | 194 // Otherwise, it gets the common name in the subject field. |
195 void GetDNSNames(std::vector<std::string>* dns_names) const; | 195 void GetDNSNames(std::vector<std::string>* dns_names) const; |
196 | 196 |
197 // Gets the subjectAltName extension field from the certificate, if any. | 197 // Gets the subjectAltName extension field from the certificate, if any. |
198 // For future extension; currently this only returns those name types that | 198 // For future extension; currently this only returns those name types that |
199 // are required for HTTP certificate name verification - see VerifyHostname. | 199 // are required for HTTP certificate name verification - see VerifyHostname. |
200 // Unrequired parameters may be passed as NULL. | 200 // Returns true if any dNSName or iPAddress SAN was present. If |dns_names| |
201 void GetSubjectAltName(std::vector<std::string>* dns_names, | 201 // is non-null, it will be set to all dNSNames present. If |ip_addrs| is |
| 202 // non-null, it will be set to all iPAddresses present. |
| 203 bool GetSubjectAltName(std::vector<std::string>* dns_names, |
202 std::vector<std::string>* ip_addrs) const; | 204 std::vector<std::string>* ip_addrs) const; |
203 | 205 |
204 // Convenience method that returns whether this certificate has expired as of | 206 // Convenience method that returns whether this certificate has expired as of |
205 // now. | 207 // now. |
206 bool HasExpired() const; | 208 bool HasExpired() const; |
207 | 209 |
208 // Returns true if this object and |other| represent the same certificate. | 210 // Returns true if this object and |other| represent the same certificate. |
209 bool Equals(const X509Certificate* other) const; | 211 bool Equals(const X509Certificate* other) const; |
210 | 212 |
211 // Returns intermediate certificates added via AddIntermediateCertificate(). | 213 // Returns intermediate certificates added via AddIntermediateCertificate(). |
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
448 // Untrusted intermediate certificates associated with this certificate | 450 // Untrusted intermediate certificates associated with this certificate |
449 // that may be needed for chain building. | 451 // that may be needed for chain building. |
450 OSCertHandles intermediate_ca_certs_; | 452 OSCertHandles intermediate_ca_certs_; |
451 | 453 |
452 DISALLOW_COPY_AND_ASSIGN(X509Certificate); | 454 DISALLOW_COPY_AND_ASSIGN(X509Certificate); |
453 }; | 455 }; |
454 | 456 |
455 } // namespace net | 457 } // namespace net |
456 | 458 |
457 #endif // NET_CERT_X509_CERTIFICATE_H_ | 459 #endif // NET_CERT_X509_CERTIFICATE_H_ |
OLD | NEW |