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