| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 286 // by one of the given names will be included in the list. | 286 // by one of the given names will be included in the list. |
| 287 static bool GetSSLClientCertificates( | 287 static bool GetSSLClientCertificates( |
| 288 const std::string& server_domain, | 288 const std::string& server_domain, |
| 289 const std::vector<CertPrincipal>& valid_issuers, | 289 const std::vector<CertPrincipal>& valid_issuers, |
| 290 CertificateList* certs); | 290 CertificateList* certs); |
| 291 | 291 |
| 292 // Creates the chain of certs to use for this client identity cert. | 292 // Creates the chain of certs to use for this client identity cert. |
| 293 CFArrayRef CreateClientCertificateChain() const; | 293 CFArrayRef CreateClientCertificateChain() const; |
| 294 #endif | 294 #endif |
| 295 | 295 |
| 296 #if defined(OS_WIN) |
| 297 // Returns a handle to a global, in-memory certificate store. We use it for |
| 298 // two purposes: |
| 299 // 1. Import server certificates into this store so that we can verify and |
| 300 // display the certificates using CryptoAPI. |
| 301 // 2. Copy client certificates from the "MY" system certificate store into |
| 302 // this store so that we can close the system store when we finish |
| 303 // searching for client certificates. |
| 304 static HCERTSTORE cert_store(); |
| 305 #endif |
| 306 |
| 296 #if defined(USE_OPENSSL) | 307 #if defined(USE_OPENSSL) |
| 297 // Returns a handle to a global, in-memory certificate store. We | 308 // Returns a handle to a global, in-memory certificate store. We |
| 298 // use it for test code, e.g. importing the test server's certificate. | 309 // use it for test code, e.g. importing the test server's certificate. |
| 299 static X509_STORE* cert_store(); | 310 static X509_STORE* cert_store(); |
| 300 #endif | 311 #endif |
| 301 | 312 |
| 302 // Verifies the certificate against the given hostname. Returns OK if | 313 // Verifies the certificate against the given hostname. Returns OK if |
| 303 // successful or an error code upon failure. | 314 // successful or an error code upon failure. |
| 304 // | 315 // |
| 305 // The |*verify_result| structure, including the |verify_result->cert_status| | 316 // The |*verify_result| structure, including the |verify_result->cert_status| |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 467 // (Marked mutable because it's used in a const method.) | 478 // (Marked mutable because it's used in a const method.) |
| 468 mutable base::Lock verification_lock_; | 479 mutable base::Lock verification_lock_; |
| 469 #endif | 480 #endif |
| 470 | 481 |
| 471 DISALLOW_COPY_AND_ASSIGN(X509Certificate); | 482 DISALLOW_COPY_AND_ASSIGN(X509Certificate); |
| 472 }; | 483 }; |
| 473 | 484 |
| 474 } // namespace net | 485 } // namespace net |
| 475 | 486 |
| 476 #endif // NET_BASE_X509_CERTIFICATE_H_ | 487 #endif // NET_BASE_X509_CERTIFICATE_H_ |
| OLD | NEW |