OLD | NEW |
---|---|
1 // Copyright (c) 2010 The Chromium OS Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium OS 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_PLATFORM_UPDATE_ENGINE_PAYLOAD_SIGNER_H__ | 5 #ifndef CHROMEOS_PLATFORM_UPDATE_ENGINE_PAYLOAD_SIGNER_H__ |
6 #define CHROMEOS_PLATFORM_UPDATE_ENGINE_PAYLOAD_SIGNER_H__ | 6 #define CHROMEOS_PLATFORM_UPDATE_ENGINE_PAYLOAD_SIGNER_H__ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
60 static bool VerifySignature(const std::vector<char>& signature_blob, | 60 static bool VerifySignature(const std::vector<char>& signature_blob, |
61 const std::string& public_key_path, | 61 const std::string& public_key_path, |
62 std::vector<char>* out_hash_data); | 62 std::vector<char>* out_hash_data); |
63 | 63 |
64 // Returns true if the payload in |payload_path| is signed and its hash can be | 64 // Returns true if the payload in |payload_path| is signed and its hash can be |
65 // verified using the public key in |public_key_path|. Returns false | 65 // verified using the public key in |public_key_path|. Returns false |
66 // otherwise. | 66 // otherwise. |
67 static bool VerifySignedPayload(const std::string& payload_path, | 67 static bool VerifySignedPayload(const std::string& payload_path, |
68 const std::string& public_key_path); | 68 const std::string& public_key_path); |
69 | 69 |
70 // Pads a SHA256 hash so that it may be encrypted/signed with RSA2048. | |
gauravsh
2011/03/29 23:04:05
just a add a comment that this pads using the PKCS
adlr
2011/03/30 19:40:14
Done.
| |
71 // Returns true on success, false otherwise. | |
72 static bool PadRSA2048SHA256Hash(std::vector<char>* hash); | |
gauravsh
2011/03/29 23:04:05
comment on what |hash| is? Also that in-place modi
adlr
2011/03/30 19:40:14
Done.
| |
70 private: | 73 private: |
71 // This should never be constructed | 74 // This should never be constructed |
72 DISALLOW_IMPLICIT_CONSTRUCTORS(PayloadSigner); | 75 DISALLOW_IMPLICIT_CONSTRUCTORS(PayloadSigner); |
73 }; | 76 }; |
74 | 77 |
75 } // namespace chromeos_update_engine | 78 } // namespace chromeos_update_engine |
76 | 79 |
77 #endif // CHROMEOS_PLATFORM_UPDATE_ENGINE_PAYLOAD_SIGNER_H__ | 80 #endif // CHROMEOS_PLATFORM_UPDATE_ENGINE_PAYLOAD_SIGNER_H__ |
OLD | NEW |