Chromium Code Reviews| 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 CHROMEOS_NETWORK_CLIENT_CERT_UTIL_H_ | 5 #ifndef CHROMEOS_NETWORK_CLIENT_CERT_UTIL_H_ |
| 6 #define CHROMEOS_NETWORK_CLIENT_CERT_UTIL_H_ | 6 #define CHROMEOS_NETWORK_CLIENT_CERT_UTIL_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 50 | 50 |
| 51 // Returns true only if any fields set in this pattern match exactly with | 51 // Returns true only if any fields set in this pattern match exactly with |
| 52 // similar fields in the principal. If organization_ or organizational_unit_ | 52 // similar fields in the principal. If organization_ or organizational_unit_ |
| 53 // are set, then at least one of the organizations or units in the principal | 53 // are set, then at least one of the organizations or units in the principal |
| 54 // must match. | 54 // must match. |
| 55 bool CertPrincipalMatches(const IssuerSubjectPattern& pattern, | 55 bool CertPrincipalMatches(const IssuerSubjectPattern& pattern, |
| 56 const net::CertPrincipal& principal); | 56 const net::CertPrincipal& principal); |
| 57 | 57 |
| 58 // Returns the PKCS11 id part of |cert_id|, which is expected to be the value of | 58 // Returns the PKCS11 id part of |cert_id|, which is expected to be the value of |
| 59 // the Shill property kEapCertIdProperty or kEapKeyIdProperty. | 59 // the Shill property kEapCertIdProperty or kEapKeyIdProperty. |
| 60 CHROMEOS_EXPORT std::string GetPkcs11IdFromEapCertId( | 60 CHROMEOS_EXPORT std::string GetPkcs11AndSlotIdFromEapCertId( |
| 61 const std::string& cert_id); | 61 const std::string& cert_id, |
| 62 int* slot_id); | |
| 63 | |
| 64 CHROMEOS_EXPORT void GetShillProperties(const base::DictionaryValue& properties, | |
| 65 ConfigType* cert_config_type, | |
| 66 int* tpm_slot, | |
| 67 std::string* pkcs11_id); | |
|
stevenjb
2014/08/14 23:58:39
At minimum this needs a comment. It also seems odd
pneubeck (no reviews)
2014/08/15 13:15:21
Done.
| |
| 62 | 68 |
| 63 // Sets the properties of a client cert and the TPM slot that it's contained in. | 69 // Sets the properties of a client cert and the TPM slot that it's contained in. |
| 64 // |cert_config_type| determines which dictionary entries to set. | 70 // |cert_config_type| determines which dictionary entries to set. |
| 65 CHROMEOS_EXPORT void SetShillProperties(const ConfigType cert_config_type, | 71 CHROMEOS_EXPORT void SetShillProperties(const ConfigType cert_config_type, |
| 66 const int tpm_slot, | 72 const int tpm_slot, |
| 67 const std::string& pkcs11_id, | 73 const std::string& pkcs11_id, |
| 68 base::DictionaryValue* properties); | 74 base::DictionaryValue* properties); |
| 69 | 75 |
| 70 // Like SetShillProperties but instead sets the properties to empty strings. | 76 // Like SetShillProperties but instead sets the properties to empty strings. |
| 71 // This should be used to clear previously set client certificate properties. | 77 // This should be used to clear previously set client certificate properties. |
| 72 CHROMEOS_EXPORT void SetEmptyShillProperties(const ConfigType cert_config_type, | 78 CHROMEOS_EXPORT void SetEmptyShillProperties(const ConfigType cert_config_type, |
| 73 base::DictionaryValue* properties); | 79 base::DictionaryValue* properties); |
| 74 | 80 |
| 75 // Returns true if all required configuration properties are set and not empty. | 81 // Returns true if all required configuration properties are set and not empty. |
| 76 bool IsCertificateConfigured(const client_cert::ConfigType cert_config_type, | 82 bool IsCertificateConfigured(const client_cert::ConfigType cert_config_type, |
| 77 const base::DictionaryValue& service_properties); | 83 const base::DictionaryValue& service_properties); |
| 78 | 84 |
| 79 // Determines the type of the CertificatePattern configuration, i.e. is it a | 85 // Determines the type of the CertificatePattern configuration, i.e. is it a |
| 80 // pattern within an EAP, IPsec or OpenVPN configuration. | 86 // pattern within an EAP, IPsec or OpenVPN configuration. |
| 81 CHROMEOS_EXPORT void OncToClientCertConfig( | 87 CHROMEOS_EXPORT void OncToClientCertConfig( |
| 82 const base::DictionaryValue& network_config, | 88 const base::DictionaryValue& network_config, |
| 83 ClientCertConfig* cert_config); | 89 ClientCertConfig* cert_config); |
| 84 | 90 |
| 85 } // namespace client_cert | 91 } // namespace client_cert |
| 86 | 92 |
| 87 } // namespace chromeos | 93 } // namespace chromeos |
| 88 | 94 |
| 89 #endif // CHROMEOS_NETWORK_CLIENT_CERT_UTIL_H_ | 95 #endif // CHROMEOS_NETWORK_CLIENT_CERT_UTIL_H_ |
| OLD | NEW |