File containing the definition of the crypt commands.
More...
#include <stdbool.h>
#include <inttypes.h>
Go to the source code of this file.
|
| int | put_crypt_cmd (struct supervisor_context *context, char *key, char *value) |
| | PUT_CRYPT command. More...
|
| |
| int | get_crypt_cmd (struct supervisor_context *context, char *key, char **value) |
| | GET_CRYPT command. More...
|
| |
| int | gen_randkey_cmd (struct supervisor_context *context, char *keyid, uint8_t size) |
| | GEN_RANDKEY command. More...
|
| |
| int | gen_privkey_cmd (struct supervisor_context *context, char *keyid, uint8_t size) |
| | GEN_PRIVKEY command. More...
|
| |
| int | gen_pubkey_cmd (struct supervisor_context *context, char *pubid, char *keyid) |
| | GEN_PUBKEY command. More...
|
| |
| int | gen_cert_cmd (struct supervisor_context *context, char *certid, char *keyid, struct certificate_meta *meta) |
| | GEN_CERT command. More...
|
| |
| char * | encrypt_blob_cmd (struct supervisor_context *context, char *keyid, char *ivid, char *blob) |
| | ENCRYPT_BLOB command. More...
|
| |
| char * | decrypt_blob_cmd (struct supervisor_context *context, char *keyid, char *ivid, char *blob) |
| | DECRYPT_BLOB command. More...
|
| |
| char * | sign_blob_cmd (struct supervisor_context *context, const char *keyid, const char *blob) |
| | SIGN_BLOB command. More...
|
| |
File containing the definition of the crypt commands.
- Author
- Alexandru Mereacre
- Date
- 2021
- Copyright
- SPDX-FileCopyrightText: © 2021 NQMCyber Ltd and edgesec contributors SPDX-License-Identifier: LGPL-3.0-or-later
◆ decrypt_blob_cmd()
| char* decrypt_blob_cmd |
( |
struct supervisor_context * |
context, |
|
|
char * |
keyid, |
|
|
char * |
ivid, |
|
|
char * |
blob |
|
) |
| |
DECRYPT_BLOB command.
- Parameters
-
| context | The supervisor structure instance |
| keyid | The private key id |
| ivid | The iv id |
| blob | The blob base64 string to decrypt |
- Returns
- char* the decrypted blob in base64, NULL on failure
◆ encrypt_blob_cmd()
| char* encrypt_blob_cmd |
( |
struct supervisor_context * |
context, |
|
|
char * |
keyid, |
|
|
char * |
ivid, |
|
|
char * |
blob |
|
) |
| |
ENCRYPT_BLOB command.
- Parameters
-
| context | The supervisor structure instance |
| keyid | The private key id |
| ivid | The iv id |
| blob | The blob base64 string to encrypt |
- Returns
- char* the encrypted blob in base64, NULL on failure
◆ gen_cert_cmd()
GEN_CERT command.
- Parameters
-
| context | The supervisor structure instance |
| certid | The certificate id |
| keyid | The private key id |
| meta | The certificate metadata |
- Returns
- 0 on success, -1 on failure
◆ gen_privkey_cmd()
GEN_PRIVKEY command.
- Parameters
-
| context | The supervisor structure instance |
| keyid | The key id |
| size | The key size in bytes |
- Returns
- 0 on success, -1 on failure
◆ gen_pubkey_cmd()
GEN_PUBKEY command.
- Parameters
-
| context | The supervisor structure instance |
| pubid | The public id |
| keyid | The private key id |
- Returns
- 0 on success, -1 on failure
◆ gen_randkey_cmd()
GEN_RANDKEY command.
- Parameters
-
| context | The supervisor structure instance |
| keyid | The key id |
| size | The key size in bytes |
- Returns
- 0 on success, -1 on failure
◆ get_crypt_cmd()
GET_CRYPT command.
Sets value to point new string containing the crypt output value. Please remember to os_free() the value when you're finished with using it.
- Parameters
-
| [in] | context | The supervisor structure instance |
| [in] | key | The crypt key |
| [out] | value | Pointer to crypt output value |
- Returns
- 0 on success, -1 on failure
◆ put_crypt_cmd()
PUT_CRYPT command.
- Parameters
-
| context | The supervisor structure instance |
| key | The crypt key |
| value | The crypt value |
- Returns
- 0 on success, -1 on failure
◆ sign_blob_cmd()
| char* sign_blob_cmd |
( |
struct supervisor_context * |
context, |
|
|
const char * |
keyid, |
|
|
const char * |
blob |
|
) |
| |
SIGN_BLOB command.
- Parameters
-
| context | The supervisor structure instance |
| keyid | The private key id |
| blob | The blob base64 string to sign |
- Returns
- char* the signed blob in base64, NULL on failure