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 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
288 // Returns a handle to a global, in-memory certificate store. We use it for | 288 // Returns a handle to a global, in-memory certificate store. We use it for |
289 // two purposes: | 289 // two purposes: |
290 // 1. Import server certificates into this store so that we can verify and | 290 // 1. Import server certificates into this store so that we can verify and |
291 // display the certificates using CryptoAPI. | 291 // display the certificates using CryptoAPI. |
292 // 2. Copy client certificates from the "MY" system certificate store into | 292 // 2. Copy client certificates from the "MY" system certificate store into |
293 // this store so that we can close the system store when we finish | 293 // this store so that we can close the system store when we finish |
294 // searching for client certificates. | 294 // searching for client certificates. |
295 static HCERTSTORE cert_store(); | 295 static HCERTSTORE cert_store(); |
296 #endif | 296 #endif |
297 | 297 |
| 298 #if defined(OS_ANDROID) |
| 299 // |chain_bytes| will contain the chain (including this certificate) encoded |
| 300 // using GetChainDEREncodedBytes below. |
| 301 void GetChainDEREncodedBytes(std::vector<std::string>* chain_bytes) const; |
| 302 #endif |
| 303 |
298 #if defined(USE_OPENSSL) | 304 #if defined(USE_OPENSSL) |
299 // Returns a handle to a global, in-memory certificate store. We | 305 // Returns a handle to a global, in-memory certificate store. We |
300 // use it for test code, e.g. importing the test server's certificate. | 306 // use it for test code, e.g. importing the test server's certificate. |
301 static X509_STORE* cert_store(); | 307 static X509_STORE* cert_store(); |
302 #endif | 308 #endif |
303 | 309 |
304 // Verifies the certificate against the given hostname. Returns OK if | 310 // Verifies the certificate against the given hostname. Returns OK if |
305 // successful or an error code upon failure. | 311 // successful or an error code upon failure. |
306 // | 312 // |
307 // The |*verify_result| structure, including the |verify_result->cert_status| | 313 // The |*verify_result| structure, including the |verify_result->cert_status| |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
469 // (Marked mutable because it's used in a const method.) | 475 // (Marked mutable because it's used in a const method.) |
470 mutable base::Lock verification_lock_; | 476 mutable base::Lock verification_lock_; |
471 #endif | 477 #endif |
472 | 478 |
473 DISALLOW_COPY_AND_ASSIGN(X509Certificate); | 479 DISALLOW_COPY_AND_ASSIGN(X509Certificate); |
474 }; | 480 }; |
475 | 481 |
476 } // namespace net | 482 } // namespace net |
477 | 483 |
478 #endif // NET_BASE_X509_CERTIFICATE_H_ | 484 #endif // NET_BASE_X509_CERTIFICATE_H_ |
OLD | NEW |