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

Side by Side Diff: chromeos/attestation/attestation_flow.h

Issue 2261763002: Device enterprise registration with a certificate. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Initialize pointers to nullptr. Created 4 years, 3 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
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_ATTESTATION_ATTESTATION_FLOW_H_ 5 #ifndef CHROMEOS_ATTESTATION_ATTESTATION_FLOW_H_
6 #define CHROMEOS_ATTESTATION_ATTESTATION_FLOW_H_ 6 #define CHROMEOS_ATTESTATION_ATTESTATION_FLOW_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <string> 9 #include <string>
10 10
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 // DBusThreadManager::Get().GetCryptohomeClient(), 50 // DBusThreadManager::Get().GetCryptohomeClient(),
51 // std::move(my_server_proxy)); 51 // std::move(my_server_proxy));
52 // AttestationFlow::CertificateCallback callback = base::Bind(&MyCallback); 52 // AttestationFlow::CertificateCallback callback = base::Bind(&MyCallback);
53 // flow.GetCertificate(ENTERPRISE_USER_CERTIFICATE, false, callback); 53 // flow.GetCertificate(ENTERPRISE_USER_CERTIFICATE, false, callback);
54 class CHROMEOS_EXPORT AttestationFlow { 54 class CHROMEOS_EXPORT AttestationFlow {
55 public: 55 public:
56 typedef base::Callback<void(bool success, 56 typedef base::Callback<void(bool success,
57 const std::string& pem_certificate_chain)> 57 const std::string& pem_certificate_chain)>
58 CertificateCallback; 58 CertificateCallback;
59 59
60 // Returns the attestation key type for a given |certificate_profile|.
61 //
62 // Parameters
63 // certificate_profile - Specifies what kind of certificate the key is for.
64 static AttestationKeyType GetKeyTypeForProfile(
65 AttestationCertificateProfile certificate_profile);
66
67 // Returns the name of the key for a given certificate profile. The
68 // |request_origin| parameter is for PROFILE_CONTENT_PROTECTION_CERTIFICATE
69 // profiles and is ignored for other profiles.
70 //
71 // Parameters
72 // certificate_profile - Specifies what kind of certificate the key is for.
73 // request_origin - For content protection profiles, certificate requests
74 // are origin-specific. This string must uniquely identify
75 // the origin of the request.
76 static std::string GetKeyNameForProfile(
77 AttestationCertificateProfile certificate_profile,
78 const std::string& request_origin);
79
60 AttestationFlow(cryptohome::AsyncMethodCaller* async_caller, 80 AttestationFlow(cryptohome::AsyncMethodCaller* async_caller,
61 CryptohomeClient* cryptohome_client, 81 CryptohomeClient* cryptohome_client,
62 std::unique_ptr<ServerProxy> server_proxy); 82 std::unique_ptr<ServerProxy> server_proxy);
63 virtual ~AttestationFlow(); 83 virtual ~AttestationFlow();
64 84
65 // Gets an attestation certificate for a hardware-protected key. If a key for 85 // Gets an attestation certificate for a hardware-protected key. If a key for
66 // the given profile does not exist, it will be generated and a certificate 86 // the given profile does not exist, it will be generated and a certificate
67 // request will be made to the Chrome OS Privacy CA to issue a certificate for 87 // request will be made to the Chrome OS Privacy CA to issue a certificate for
68 // the key. If the key already exists and |force_new_key| is false, the 88 // the key. If the key already exists and |force_new_key| is false, the
69 // existing certificate is returned. 89 // existing certificate is returned.
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 229
210 base::WeakPtrFactory<AttestationFlow> weak_factory_; 230 base::WeakPtrFactory<AttestationFlow> weak_factory_;
211 231
212 DISALLOW_COPY_AND_ASSIGN(AttestationFlow); 232 DISALLOW_COPY_AND_ASSIGN(AttestationFlow);
213 }; 233 };
214 234
215 } // namespace attestation 235 } // namespace attestation
216 } // namespace chromeos 236 } // namespace chromeos
217 237
218 #endif // CHROMEOS_ATTESTATION_ATTESTATION_FLOW_H_ 238 #endif // CHROMEOS_ATTESTATION_ATTESTATION_FLOW_H_
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos.cc ('k') | chromeos/attestation/attestation_flow.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698