// SPDX-License-Identifier: BSD-2-Clause
/*
 * SPDX-FileCopyrightText: Copyright (c) 2025, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
 */

#ifndef __JETSON_EKB_USER_KEY_MANAGEMENT_H__
#define __JETSON_EKB_USER_KEY_MANAGEMENT_H__

typedef struct user_key {
	TAILQ_ENTRY(user_key) link;
	uint32_t type;
	uint32_t len;
	uint8_t *data;
} user_key_t;

/*
 * Get keys from ekb without check.
 *
 * NOTE:
 * Since this function can get any key from ekb without checking,
 * the caller should take the responsibility of checking the key type.
 */
TEE_Result jetson_pta_get_key_by_type(struct user_key **ekb_key, uint32_t key_type);

/* Parse keys from decrypted ekb content. */
TEE_Result jetson_ekb_extraction_parse_key(void *decrypted_ekb_content);

#endif /* __JETSON_EKB_USER_KEY_MANAGEMENT_H__ */
