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