VariableKeyLib.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /** @file
  2. Public definitions for Variable Key Library.
  3. Copyright (c) 2020, Intel Corporation. All rights reserved.<BR>
  4. SPDX-License-Identifier: BSD-2-Clause-Patent
  5. **/
  6. #ifndef _VARIABLE_KEY_LIB_H_
  7. #define _VARIABLE_KEY_LIB_H_
  8. #include <Uefi/UefiBaseType.h>
  9. /**
  10. Retrieves the key for integrity and/or confidentiality of variables.
  11. @param[out] VariableKey A pointer to pointer for the variable key buffer.
  12. @param[in,out] VariableKeySize The size in bytes of the variable key.
  13. @retval EFI_SUCCESS The variable key was returned.
  14. @retval EFI_DEVICE_ERROR An error occurred while attempting to get the variable key.
  15. @retval EFI_ACCESS_DENIED The function was invoked after locking the key interface.
  16. @retval EFI_UNSUPPORTED The variable key is not supported in the current boot configuration.
  17. **/
  18. EFI_STATUS
  19. EFIAPI
  20. GetVariableKey (
  21. OUT VOID **VariableKey,
  22. IN OUT UINTN *VariableKeySize
  23. );
  24. /**
  25. Regenerates the variable key.
  26. @retval EFI_SUCCESS The variable key was regenerated successfully.
  27. @retval EFI_DEVICE_ERROR An error occurred while attempting to regenerate the key.
  28. @retval EFI_ACCESS_DENIED The function was invoked after locking the key interface.
  29. @retval EFI_UNSUPPORTED Key regeneration is not supported in the current boot configuration.
  30. **/
  31. EFI_STATUS
  32. EFIAPI
  33. RegenerateVariableKey (
  34. VOID
  35. );
  36. /**
  37. Locks the regenerate key interface.
  38. @retval EFI_SUCCESS The key interface was locked successfully.
  39. @retval EFI_UNSUPPORTED Locking the key interface is not supported in the current boot configuration.
  40. @retval Others An error occurred while attempting to lock the key interface.
  41. **/
  42. EFI_STATUS
  43. EFIAPI
  44. LockVariableKeyInterface (
  45. VOID
  46. );
  47. #endif