File containing the definition of zymkey4 driver configuration utilities.
More...
#include <sys/types.h>
#include <zymkey/zk_app_utils.h>
Go to the source code of this file.
|
| zkCTX * | init_zymkey4 (void) |
| | Initialises an HSM context. More...
|
| |
| int | close_zymkey4 (zkCTX *ctx) |
| | Closes the zymkey4 context. More...
|
| |
| int | generate_zymkey4_key (zkCTX *ctx, uint8_t *key, size_t key_size) |
| | Generate a random Zymkey4 key. More...
|
| |
| int | encrypt_zymkey4_blob (zkCTX *ctx, uint8_t *in, size_t in_size, uint8_t **out, size_t *out_size) |
| | Encrypt a byte array wiht the Zymkey4 HSM. More...
|
| |
| int | decrypt_zymkey4_blob (zkCTX *ctx, uint8_t *in, size_t in_size, uint8_t **out, size_t *out_size) |
| | Decrypt a byte array wiht the Zymkey4 HSM. More...
|
| |
File containing the definition of zymkey4 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_zymkey4()
| int close_zymkey4 |
( |
zkCTX * |
ctx | ) |
|
Closes the zymkey4 context.
- Parameters
-
- Returns
- int 0 on success, -1 on failure
◆ decrypt_zymkey4_blob()
| int decrypt_zymkey4_blob |
( |
zkCTX * |
ctx, |
|
|
uint8_t * |
in, |
|
|
size_t |
in_size, |
|
|
uint8_t ** |
out, |
|
|
size_t * |
out_size |
|
) |
| |
Decrypt a byte array wiht the Zymkey4 HSM.
- Parameters
-
| ctx | The Zymkey4 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_zymkey4_blob()
| int encrypt_zymkey4_blob |
( |
zkCTX * |
ctx, |
|
|
uint8_t * |
in, |
|
|
size_t |
in_size, |
|
|
uint8_t ** |
out, |
|
|
size_t * |
out_size |
|
) |
| |
Encrypt a byte array wiht the Zymkey4 HSM.
- Parameters
-
| ctx | The Zymkey4 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_zymkey4_key()
| int generate_zymkey4_key |
( |
zkCTX * |
ctx, |
|
|
uint8_t * |
key, |
|
|
size_t |
key_size |
|
) |
| |
Generate a random Zymkey4 key.
- Parameters
-
| ctx | The Zymkey4 context |
| key | The returned key |
| key_size | The key size |
- Returns
- int 0 on success, -1 on failure
◆ init_zymkey4()
| zkCTX* init_zymkey4 |
( |
void |
| ) |
|
Initialises an HSM context.
- Returns
- zkCTX* The returned Zymkey4 context, NULL on error