File containing the definition of generic HSM driver configuration utilities.
More...
#include <stdbool.h>
#include <inttypes.h>
#include <sys/types.h>
#include <sys/un.h>
Go to the source code of this file.
|
struct hsm_context * | init_hsm (void) |
| Initialises an HSM context. More...
|
|
int | close_hsm (struct hsm_context *context) |
| Closes the HSM context. More...
|
|
int | generate_hsm_key (struct hsm_context *context, uint8_t *key, size_t key_size) |
| Generate an HSM key. More...
|
|
int | encrypt_hsm_blob (struct hsm_context *context, uint8_t *in, size_t in_size, uint8_t **out, size_t *out_size) |
| Encrypt a byte array wiht the HSM. More...
|
|
int | decrypt_hsm_blob (struct hsm_context *context, uint8_t *in, size_t in_size, uint8_t **out, size_t *out_size) |
| Decrypt a byte array wiht the HSM. More...
|
|
File containing the definition of generic HSM driver configuration utilities.
- Author
- Alexandru Mereacre
- Date
- 2021
- Copyright
- SPDX-FileCopyrightText: © 2021 NQMCyber Ltd and edgesec contributors SPDX-License-Identifier: LGPL-3.0-or-later
◆ close_hsm()
Closes the HSM context.
- Parameters
-
- Returns
- int 0 on success, -1 on failure
◆ decrypt_hsm_blob()
int decrypt_hsm_blob |
( |
struct hsm_context * |
context, |
|
|
uint8_t * |
in, |
|
|
size_t |
in_size, |
|
|
uint8_t ** |
out, |
|
|
size_t * |
out_size |
|
) |
| |
Decrypt a byte array wiht the HSM.
- Parameters
-
context | The HSM context |
in | The input array |
in_size | The input array size |
out | The output decrypted array |
out_size | The output array size |
- Returns
- int 0 on success, -1 on failure
◆ encrypt_hsm_blob()
int encrypt_hsm_blob |
( |
struct hsm_context * |
context, |
|
|
uint8_t * |
in, |
|
|
size_t |
in_size, |
|
|
uint8_t ** |
out, |
|
|
size_t * |
out_size |
|
) |
| |
Encrypt a byte array wiht the HSM.
- Parameters
-
context | The HSM context |
in | The input array |
in_size | The input array size |
out | The output encrypted array |
out_size | The output array size |
- Returns
- int 0 on success, -1 on failure
◆ generate_hsm_key()
int generate_hsm_key |
( |
struct hsm_context * |
context, |
|
|
uint8_t * |
key, |
|
|
size_t |
key_size |
|
) |
| |
Generate an HSM key.
- Parameters
-
context | The HSM context |
key | The returned key |
key_size | The key size |
- Returns
- int 0 on success, -1 on failure
◆ init_hsm()
Initialises an HSM context.
- Returns
- struct hsm_context* The returned context, NULL on error