| 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_BASE_X509_CERTIFICATE_H_ | 5 #ifndef NET_BASE_X509_CERTIFICATE_H_ |
| 6 #define NET_BASE_X509_CERTIFICATE_H_ | 6 #define NET_BASE_X509_CERTIFICATE_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string.h> | 9 #include <string.h> |
| 10 | 10 |
| (...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 235 const base::Time& valid_expiry() const { return valid_expiry_; } | 235 const base::Time& valid_expiry() const { return valid_expiry_; } |
| 236 | 236 |
| 237 // The fingerprint of this certificate. | 237 // The fingerprint of this certificate. |
| 238 const SHA1Fingerprint& fingerprint() const { return fingerprint_; } | 238 const SHA1Fingerprint& fingerprint() const { return fingerprint_; } |
| 239 | 239 |
| 240 // The fingerprint of the intermediate CA certificates. | 240 // The fingerprint of the intermediate CA certificates. |
| 241 const SHA1Fingerprint& ca_fingerprint() const { | 241 const SHA1Fingerprint& ca_fingerprint() const { |
| 242 return ca_fingerprint_; | 242 return ca_fingerprint_; |
| 243 } | 243 } |
| 244 | 244 |
| 245 // Parses |cert|'s Subject Public Key Info structure, hashes it, and |
| 246 // returns the hash. |
| 247 const SHA1Fingerprint GetPublicKeyHash() const; |
| 248 |
| 245 // Gets the DNS names in the certificate. Pursuant to RFC 2818, Section 3.1 | 249 // Gets the DNS names in the certificate. Pursuant to RFC 2818, Section 3.1 |
| 246 // Server Identity, if the certificate has a subjectAltName extension of | 250 // Server Identity, if the certificate has a subjectAltName extension of |
| 247 // type dNSName, this method gets the DNS names in that extension. | 251 // type dNSName, this method gets the DNS names in that extension. |
| 248 // Otherwise, it gets the common name in the subject field. | 252 // Otherwise, it gets the common name in the subject field. |
| 249 void GetDNSNames(std::vector<std::string>* dns_names) const; | 253 void GetDNSNames(std::vector<std::string>* dns_names) const; |
| 250 | 254 |
| 251 // Gets the subjectAltName extension field from the certificate, if any. | 255 // Gets the subjectAltName extension field from the certificate, if any. |
| 252 // For future extension; currently this only returns those name types that | 256 // For future extension; currently this only returns those name types that |
| 253 // are required for HTTP certificate name verification - see VerifyHostname. | 257 // are required for HTTP certificate name verification - see VerifyHostname. |
| 254 // Unrequired parameters may be passed as NULL. | 258 // Unrequired parameters may be passed as NULL. |
| (...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 600 // (Marked mutable because it's used in a const method.) | 604 // (Marked mutable because it's used in a const method.) |
| 601 mutable base::Lock verification_lock_; | 605 mutable base::Lock verification_lock_; |
| 602 #endif | 606 #endif |
| 603 | 607 |
| 604 DISALLOW_COPY_AND_ASSIGN(X509Certificate); | 608 DISALLOW_COPY_AND_ASSIGN(X509Certificate); |
| 605 }; | 609 }; |
| 606 | 610 |
| 607 } // namespace net | 611 } // namespace net |
| 608 | 612 |
| 609 #endif // NET_BASE_X509_CERTIFICATE_H_ | 613 #endif // NET_BASE_X509_CERTIFICATE_H_ |
| OLD | NEW |