Index: chromeos/network/client_cert_util.h |
diff --git a/chromeos/network/client_cert_util.h b/chromeos/network/client_cert_util.h |
index 5b6839dacb9e691412e20528b004accc05fa498c..3a1a392be8ee06e8370750a7200f251990af747c 100644 |
--- a/chromeos/network/client_cert_util.h |
+++ b/chromeos/network/client_cert_util.h |
@@ -10,6 +10,7 @@ |
#include "base/memory/ref_counted.h" |
#include "chromeos/chromeos_export.h" |
+#include "chromeos/network/certificate_pattern.h" |
namespace base { |
class DictionaryValue; |
@@ -23,7 +24,6 @@ typedef std::vector<scoped_refptr<X509Certificate> > CertificateList; |
namespace chromeos { |
-class CertificatePattern; |
class IssuerSubjectPattern; |
namespace client_cert { |
@@ -35,6 +35,21 @@ enum ConfigType { |
CONFIG_TYPE_EAP |
}; |
+struct CHROMEOS_EXPORT ClientCertConfig { |
+ ClientCertConfig(); |
+ |
+ // Independent of whether the client cert (pattern or reference) is |
+ // configured, the location determines whether this network configuration |
+ // supports client certs and what kind of configuration it requires. |
+ ConfigType location; |
+ |
+ // One of the ClientCertTypes defined in ONC: kNone, kRef, or kPattern. |
+ std::string client_cert_type; |
+ |
+ // If |client_cert_type| equals kPattern, this contains the pattern. |
+ CertificatePattern pattern; |
+}; |
+ |
// Returns true only if any fields set in this pattern match exactly with |
// similar fields in the principal. If organization_ or organizational_unit_ |
// are set, then at least one of the organizations or units in the principal |
@@ -61,6 +76,12 @@ void SetShillProperties(const ConfigType cert_config_type, |
bool IsCertificateConfigured(const client_cert::ConfigType cert_config_type, |
const base::DictionaryValue& service_properties); |
+// Determines the type of the CertificatePattern configuration, i.e. is it a |
+// pattern within an EAP, IPsec or OpenVPN configuration. |
+CHROMEOS_EXPORT void OncToClientCertConfig( |
+ const base::DictionaryValue& network_config, |
+ ClientCertConfig* cert_config); |
+ |
} // namespace client_cert |
} // namespace chromeos |