OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROMEOS_NETWORK_CERTIFICATE_HANDLER_H_ |
| 6 #define CHROMEOS_NETWORK_CERTIFICATE_HANDLER_H_ |
| 7 |
| 8 #include "chromeos/chromeos_export.h" |
| 9 #include "chromeos/network/onc/onc_constants.h" |
| 10 #include "net/cert/x509_certificate.h" |
| 11 |
| 12 namespace base { |
| 13 class ListValue; |
| 14 } |
| 15 |
| 16 namespace chromeos { |
| 17 |
| 18 class CHROMEOS_EXPORT CertificateHandler { |
| 19 public: |
| 20 CertificateHandler(); |
| 21 virtual ~CertificateHandler(); |
| 22 |
| 23 // Initializes the singleton. |
| 24 static void Initialize(); |
| 25 |
| 26 // Returns if the singleton is initialized. |
| 27 static bool IsInitialized(); |
| 28 |
| 29 // Destroys the singleton. |
| 30 static void Shutdown(); |
| 31 |
| 32 // Initialize() must be called before this. |
| 33 static CertificateHandler* Get(); |
| 34 |
| 35 // Import the |certificates|, which must be a list of ONC Certificate objects. |
| 36 // If |onc_trusted_certificates| is not NULL, it will be filled with the list |
| 37 // of certificates that requested the TrustBit "Web". Returns true if all |
| 38 // certificates were imported successfully. |
| 39 virtual bool ImportCertificates( |
| 40 const base::ListValue& certificates, |
| 41 onc::ONCSource source, |
| 42 net::CertificateList* onc_trusted_certificates); |
| 43 |
| 44 private: |
| 45 DISALLOW_COPY_AND_ASSIGN(CertificateHandler); |
| 46 }; |
| 47 |
| 48 } // namespace chromeos |
| 49 |
| 50 #endif // CHROMEOS_NETWORK_CERTIFICATE_HANDLER_H_ |
OLD | NEW |