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_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 Loading... | |
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. | |
pastarmovj
2016/08/23 08:46:02
nit: s/certificate_profile/profile/...or rename th
The one and only Dr. Crash
2016/08/23 15:05:10
Done.
| |
64 static AttestationKeyType GetKeyTypeForProfile( | |
65 AttestationCertificateProfile profile); | |
66 // Returns the name of the key for a given certificate profile. The | |
pastarmovj
2016/08/23 08:46:02
Add a new line before this one.
The one and only Dr. Crash
2016/08/23 15:05:10
Done.
| |
67 // |request_origin| parameter is for PROFILE_CONTENT_PROTECTION_CERTIFICATE | |
68 // profiles and is ignored for other profiles. | |
69 // | |
70 // Parameters | |
71 // certificate_profile - Specifies what kind of certificate the key is for. | |
72 // request_origin - For content protection profiles, certificate requests | |
73 // are origin-specific. This string must uniquely identify | |
74 // the origin of the request. | |
75 static std::string GetKeyNameForProfile( | |
76 AttestationCertificateProfile certificate_profile, | |
77 const std::string& request_origin); | |
78 | |
60 AttestationFlow(cryptohome::AsyncMethodCaller* async_caller, | 79 AttestationFlow(cryptohome::AsyncMethodCaller* async_caller, |
61 CryptohomeClient* cryptohome_client, | 80 CryptohomeClient* cryptohome_client, |
62 std::unique_ptr<ServerProxy> server_proxy); | 81 std::unique_ptr<ServerProxy> server_proxy); |
63 virtual ~AttestationFlow(); | 82 virtual ~AttestationFlow(); |
64 | 83 |
65 // Gets an attestation certificate for a hardware-protected key. If a key for | 84 // 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 | 85 // 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 | 86 // 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 | 87 // the key. If the key already exists and |force_new_key| is false, the |
69 // existing certificate is returned. | 88 // existing certificate is returned. |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
209 | 228 |
210 base::WeakPtrFactory<AttestationFlow> weak_factory_; | 229 base::WeakPtrFactory<AttestationFlow> weak_factory_; |
211 | 230 |
212 DISALLOW_COPY_AND_ASSIGN(AttestationFlow); | 231 DISALLOW_COPY_AND_ASSIGN(AttestationFlow); |
213 }; | 232 }; |
214 | 233 |
215 } // namespace attestation | 234 } // namespace attestation |
216 } // namespace chromeos | 235 } // namespace chromeos |
217 | 236 |
218 #endif // CHROMEOS_ATTESTATION_ATTESTATION_FLOW_H_ | 237 #endif // CHROMEOS_ATTESTATION_ATTESTATION_FLOW_H_ |
OLD | NEW |