Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(228)

Side by Side Diff: chromeos/network/client_cert_util.h

Issue 22588002: Refactor the client certificate code in chromeos/network/. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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_CERTIFICATE_PATTERN_MATCHER_H_ 5 #ifndef CHROMEOS_NETWORK_CLIENT_CERT_UTIL_H_
6 #define CHROMEOS_NETWORK_CERTIFICATE_PATTERN_MATCHER_H_ 6 #define CHROMEOS_NETWORK_CLIENT_CERT_UTIL_H_
7
8 #include <string>
7 9
8 #include "base/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
9 #include "chromeos/chromeos_export.h" 11 #include "chromeos/chromeos_export.h"
10 12
13 namespace base {
14 class DictionaryValue;
15 }
16
11 namespace net { 17 namespace net {
18 struct CertPrincipal;
12 class X509Certificate; 19 class X509Certificate;
13 } 20 }
14 21
15 namespace chromeos { 22 namespace chromeos {
16 23
17 class CertificatePattern; 24 class CertificatePattern;
25 class IssuerSubjectPattern;
18 26
19 namespace certificate_pattern { 27 namespace client_cert {
20 28
21 // Fetches the matching certificate that has the latest valid start date. 29 enum ConfigType {
30 CONFIG_TYPE_OPENVPN,
31 CONFIG_TYPE_IPSEC,
32 CONFIG_TYPE_EAP
33 };
34
35 // Returns true only if any fields set in this pattern match exactly with
36 // similar fields in the principal. If organization_ or organizational_unit_
37 // are set, then at least one of the organizations or units in the principal
38 // must match.
39 bool CertPrincipalMatches(const IssuerSubjectPattern& pattern,
40 const net::CertPrincipal& principal);
41
42 // Fetches the matching certificate that has the latest valid start date.
stevenjb 2013/08/07 19:24:47 indent
pneubeck (no reviews) 2013/08/08 11:28:29 Done.
22 // Returns a NULL refptr if there is no such match. 43 // Returns a NULL refptr if there is no such match.
23 CHROMEOS_EXPORT scoped_refptr<net::X509Certificate> GetCertificateMatch( 44 CHROMEOS_EXPORT scoped_refptr<net::X509Certificate> GetCertificateMatch(
24 const CertificatePattern& pattern); 45 const CertificatePattern& pattern);
25 46
26 } // namespace certificate_pattern 47 void SetShillProperties(const ConfigType cert_config_type,
48 const std::string& tpm_slot,
49 const std::string& tpm_pin,
50 const std::string& pkcs11_id,
51 base::DictionaryValue* properties);
52
53 } // namespace client_cert
27 54
28 } // namespace chromeos 55 } // namespace chromeos
29 56
30 #endif // CHROMEOS_NETWORK_CERTIFICATE_PATTERN_MATCHER_H_ 57 #endif // CHROMEOS_NETWORK_CLIENT_CERT_UTIL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698