| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 CHROME_BROWSER_CHROMEOS_ATTESTATION_ATTESTATION_POLICY_OBSERVER_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_ATTESTATION_ATTESTATION_POLICY_OBSERVER_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_ATTESTATION_ATTESTATION_POLICY_OBSERVER_H_ | 6 #define CHROME_BROWSER_CHROMEOS_ATTESTATION_ATTESTATION_POLICY_OBSERVER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 | 56 |
| 57 // Checks attestation policy and starts any necessary work. | 57 // Checks attestation policy and starts any necessary work. |
| 58 void Start(); | 58 void Start(); |
| 59 | 59 |
| 60 // Gets a new certificate for the Enterprise Machine Key (EMK). | 60 // Gets a new certificate for the Enterprise Machine Key (EMK). |
| 61 void GetNewCertificate(); | 61 void GetNewCertificate(); |
| 62 | 62 |
| 63 // Gets the existing EMK certificate and sends it to CheckCertificateExpiry. | 63 // Gets the existing EMK certificate and sends it to CheckCertificateExpiry. |
| 64 void GetExistingCertificate(); | 64 void GetExistingCertificate(); |
| 65 | 65 |
| 66 // Checks if the given certificate is expired and, if so, get a new one. | 66 // Checks if any certificate in the given pem_certificate_chain is expired |
| 67 void CheckCertificateExpiry(const std::string& certificate); | 67 // and, if so, gets a new one. If not renewing, calls CheckIfUploaded. |
| 68 void CheckCertificateExpiry(const std::string& pem_certificate_chain); |
| 68 | 69 |
| 69 // Uploads a certificate to the policy server. | 70 // Uploads a certificate to the policy server. |
| 70 void UploadCertificate(const std::string& certificate); | 71 void UploadCertificate(const std::string& pem_certificate_chain); |
| 71 | 72 |
| 72 // Checks if a certificate has already been uploaded and, if not, upload. | 73 // Checks if a certificate has already been uploaded and, if not, upload. |
| 73 void CheckIfUploaded(const std::string& certificate, | 74 void CheckIfUploaded(const std::string& pem_certificate_chain, |
| 74 const std::string& key_payload); | 75 const std::string& key_payload); |
| 75 | 76 |
| 76 // Gets the payload associated with the EMK and sends it to |callback|. | 77 // Gets the payload associated with the EMK and sends it to |callback|. |
| 77 void GetKeyPayload(base::Callback<void(const std::string&)> callback); | 78 void GetKeyPayload(base::Callback<void(const std::string&)> callback); |
| 78 | 79 |
| 79 // Called when a certificate upload operation completes. On success, |status| | 80 // Called when a certificate upload operation completes. On success, |status| |
| 80 // will be true. | 81 // will be true. |
| 81 void OnUploadComplete(bool status); | 82 void OnUploadComplete(bool status); |
| 82 | 83 |
| 83 // Marks a key as uploaded in the payload proto. | 84 // Marks a key as uploaded in the payload proto. |
| (...skipping 18 matching lines...) Expand all Loading... |
| 102 // invalidate the weak pointers before any other members are destroyed. | 103 // invalidate the weak pointers before any other members are destroyed. |
| 103 base::WeakPtrFactory<AttestationPolicyObserver> weak_factory_; | 104 base::WeakPtrFactory<AttestationPolicyObserver> weak_factory_; |
| 104 | 105 |
| 105 DISALLOW_COPY_AND_ASSIGN(AttestationPolicyObserver); | 106 DISALLOW_COPY_AND_ASSIGN(AttestationPolicyObserver); |
| 106 }; | 107 }; |
| 107 | 108 |
| 108 } // namespace attestation | 109 } // namespace attestation |
| 109 } // namespace chromeos | 110 } // namespace chromeos |
| 110 | 111 |
| 111 #endif // CHROME_BROWSER_CHROMEOS_ATTESTATION_ATTESTATION_POLICY_OBSERVER_H_ | 112 #endif // CHROME_BROWSER_CHROMEOS_ATTESTATION_ATTESTATION_POLICY_OBSERVER_H_ |
| OLD | NEW |