Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 CHROME_BROWSER_CHROMEOS_PLATFORM_KEYS_PLATFORM_KEYS_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_PLATFORM_KEYS_PLATFORM_KEYS_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_PLATFORM_KEYS_PLATFORM_KEYS_H_ | 6 #define CHROME_BROWSER_CHROMEOS_PLATFORM_KEYS_PLATFORM_KEYS_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 106 SelectCertificatesCallback; | 106 SelectCertificatesCallback; |
| 107 | 107 |
| 108 // Returns the list of all certificates that match |request|. |callback| will be | 108 // Returns the list of all certificates that match |request|. |callback| will be |
| 109 // invoked with these matches or an error message. | 109 // invoked with these matches or an error message. |
| 110 void SelectClientCertificates(const ClientCertificateRequest& request, | 110 void SelectClientCertificates(const ClientCertificateRequest& request, |
| 111 const SelectCertificatesCallback& callback, | 111 const SelectCertificatesCallback& callback, |
| 112 content::BrowserContext* browser_context); | 112 content::BrowserContext* browser_context); |
| 113 | 113 |
| 114 } // namespace subtle | 114 } // namespace subtle |
| 115 | 115 |
| 116 // Returns the DER encoding of the X.509 Subject Public Key Info of the public | |
|
Andrew T Wilson (Slow)
2015/02/18 19:53:34
nit: "a DER encoding" since there isn't a single c
pneubeck (no reviews)
2015/02/19 11:08:39
Done.
| |
| 117 // key in |certificate|. | |
| 118 std::string GetSubjectPublicKeyInfo( | |
| 119 const scoped_refptr<net::X509Certificate>& certificate); | |
| 120 | |
| 116 // Obtains information about the public key in |certificate|. | 121 // Obtains information about the public key in |certificate|. |
| 117 // If |certificate| contains an RSA key, sets |key_size_bits| to the modulus | 122 // If |certificate| contains an RSA key, sets |key_size_bits| to the modulus |
| 118 // length, |public_key_spki_der| to the DER encoding of the X.509 Subject Public | 123 // length, and |key_type| to type RSA and returns true. |
| 119 // Key Info, and |key_type| to type RSA and returns true. | |
| 120 // If |certificate| contains any other key type, or if the public exponent of | 124 // If |certificate| contains any other key type, or if the public exponent of |
| 121 // the RSA key in |certificate| is not F4, returns false and does not update any | 125 // the RSA key in |certificate| is not F4, returns false and does not update any |
| 122 // of the output parameters. | 126 // of the output parameters. |
| 123 // All pointer arguments must not be null. | 127 // All pointer arguments must not be null. |
| 124 bool GetPublicKey(const scoped_refptr<net::X509Certificate>& certificate, | 128 bool GetPublicKey(const scoped_refptr<net::X509Certificate>& certificate, |
| 125 std::string* public_key_spki_der, | |
| 126 net::X509Certificate::PublicKeyType* key_type, | 129 net::X509Certificate::PublicKeyType* key_type, |
| 127 size_t* key_size_bits); | 130 size_t* key_size_bits); |
| 128 | 131 |
| 129 // If the list of certificates could be successfully retrieved, |certs| will | 132 // If the list of certificates could be successfully retrieved, |certs| will |
| 130 // contain the list of available certificates (maybe empty) and |error_message| | 133 // contain the list of available certificates (maybe empty) and |error_message| |
| 131 // will be empty. If an error occurred, |certs| will be empty and | 134 // will be empty. If an error occurred, |certs| will be empty and |
| 132 // |error_message| contain an error message. | 135 // |error_message| contain an error message. |
| 133 typedef base::Callback<void(scoped_ptr<net::CertificateList> certs, | 136 typedef base::Callback<void(scoped_ptr<net::CertificateList> certs, |
| 134 const std::string& error_message)> | 137 const std::string& error_message)> |
| 135 GetCertificatesCallback; | 138 GetCertificatesCallback; |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 182 // of available tokens is determined, possibly with an error message. | 185 // of available tokens is determined, possibly with an error message. |
| 183 // Must be called and calls |callback| on the UI thread. | 186 // Must be called and calls |callback| on the UI thread. |
| 184 void GetTokens(const GetTokensCallback& callback, | 187 void GetTokens(const GetTokensCallback& callback, |
| 185 content::BrowserContext* browser_context); | 188 content::BrowserContext* browser_context); |
| 186 | 189 |
| 187 } // namespace platform_keys | 190 } // namespace platform_keys |
| 188 | 191 |
| 189 } // namespace chromeos | 192 } // namespace chromeos |
| 190 | 193 |
| 191 #endif // CHROME_BROWSER_CHROMEOS_PLATFORM_KEYS_PLATFORM_KEYS_H_ | 194 #endif // CHROME_BROWSER_CHROMEOS_PLATFORM_KEYS_PLATFORM_KEYS_H_ |
| OLD | NEW |