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 * Host-side functions for verified boot. | 5 * Host-side functions for verified boot. |
6 */ | 6 */ |
7 | 7 |
8 #ifndef VBOOT_REFERENCE_HOST_KEYBLOCK_H_ | 8 #ifndef VBOOT_REFERENCE_HOST_KEYBLOCK_H_ |
9 #define VBOOT_REFERENCE_HOST_KEYBLOCK_H_ | 9 #define VBOOT_REFERENCE_HOST_KEYBLOCK_H_ |
10 | 10 |
11 #include <stdint.h> | |
12 | |
13 #include "host_key.h" | 11 #include "host_key.h" |
14 #include "vboot_struct.h" | 12 #include "vboot_struct.h" |
15 | 13 |
16 | 14 |
17 /* Create a key block header containing [data_key] and [flags], signed | 15 /* Create a key block header containing [data_key] and [flags], signed |
18 * by [signing_key]. Caller owns the returned pointer, and must free | 16 * by [signing_key]. Caller owns the returned pointer, and must free |
19 * it with Free(). */ | 17 * it with Free(). */ |
20 VbKeyBlockHeader* KeyBlockCreate(const VbPublicKey* data_key, | 18 VbKeyBlockHeader* KeyBlockCreate(const VbPublicKey* data_key, |
21 const VbPrivateKey* signing_key, | 19 const VbPrivateKey* signing_key, |
22 uint64_t flags); | 20 uint64_t flags); |
23 | 21 |
24 | 22 |
25 /* Read a key block from a .keyblock file. Caller owns the returned | 23 /* Read a key block from a .keyblock file. Caller owns the returned |
26 * pointer, and must free it with Free(). | 24 * pointer, and must free it with Free(). |
27 * | 25 * |
28 * Returns NULL if error. */ | 26 * Returns NULL if error. */ |
29 VbKeyBlockHeader* KeyBlockRead(const char* filename); | 27 VbKeyBlockHeader* KeyBlockRead(const char* filename); |
30 | 28 |
31 | 29 |
32 /* Write a key block to a file in .keyblock format. */ | 30 /* Write a key block to a file in .keyblock format. */ |
33 int KeyBlockWrite(const char* filename, const VbKeyBlockHeader* key_block); | 31 int KeyBlockWrite(const char* filename, const VbKeyBlockHeader* key_block); |
34 | 32 |
35 #endif /* VBOOT_REFERENCE_HOST_KEYBLOCK_H_ */ | 33 #endif /* VBOOT_REFERENCE_HOST_KEYBLOCK_H_ */ |
OLD | NEW |