host_keyblock2.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536
  1. /* Copyright (c) 2014 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 key structures
  6. */
  7. #ifndef VBOOT_REFERENCE_HOST_KEYBLOCK2_H_
  8. #define VBOOT_REFERENCE_HOST_KEYBLOCK2_H_
  9. struct vb2_private_key;
  10. struct vb2_public_key;
  11. struct vb21_keyblock;
  12. /**
  13. * Create and sign a keyblock.
  14. *
  15. * @param kb_ptr On success, points to a newly allocated keyblock buffer.
  16. * Caller is responsible for calling free() on this.
  17. * @param data_key Data key to contain inside keyblock.
  18. * @param signing_keys List of keys to sign the keyblock with.
  19. * @param signing_key_count Number of keys in signing_keys.
  20. * @param flags Flags for keyblock.
  21. * @param desc Description for keyblock. If NULL, description will be
  22. * taken from the data key.
  23. * @return VB2_SUCCESS, or non-zero error code if failure.
  24. */
  25. int vb21_keyblock_create(struct vb21_keyblock **kb_ptr,
  26. const struct vb2_public_key *data_key,
  27. const struct vb2_private_key **signing_keys,
  28. uint32_t signing_key_count,
  29. uint32_t flags,
  30. const char *desc);
  31. #endif /* VBOOT_REFERENCE_HOST_KEYBLOCK2_H_ */