============================================================================
This file contains the APIs to initialize and access plaintext CryptoKeys. Plaintext CryptoKeys point to keying material stored in flash or RAM and are not subject to enforced usage restrictions. That only means that calling a function that requires an assymmetric public key with a symmetric key will not return an error. It will likely not yield the desired results.
Plaintext keys are the simplest of the CryptoKeys. All they do is store the length of and a pointer to the keying material. Their use is hence simple as well. After calling the initialization function, the CryptoKey may be used in any of the crypto operation APIs that take a CryptoKey as an input.
#include <stddef.h>
#include <stdint.h>
#include <stdbool.h>
#include <ti/drivers/cryptoutils/cryptokey/CryptoKey.h>
Go to the source code of this file.
Functions | |
int_fast16_t | CryptoKeyPlaintext_initKey (CryptoKey *keyHandle, uint8_t *key, size_t keyLength) |
Initializes a CryptoKey type. More... | |
int_fast16_t | CryptoKeyPlaintext_initBlankKey (CryptoKey *keyHandle, uint8_t *keyLocation, size_t keyLength) |
Initializes an empty plaintext CryptoKey type. More... | |
int_fast16_t | CryptoKeyPlaintext_getKeyLength (CryptoKey *keyHandle, size_t *length) |
Gets the length of a plaintext key. More... | |
int_fast16_t | CryptoKeyPlaintext_setKeyLocation (CryptoKey *keyHandle, uint8_t *location) |
Sets the CryptoKey keyMaterial pointer. More... | |
int_fast16_t CryptoKeyPlaintext_initKey | ( | CryptoKey * | keyHandle, |
uint8_t * | key, | ||
size_t | keyLength | ||
) |
Initializes a CryptoKey type.
[in] | keyHandle | Pointer to a CryptoKey which will be initialized to type CryptoKey_PLAINTEXT and ready for use |
[in] | key | Pointer to keying material |
[in] | keyLength | Length of keying material in bytes |
int_fast16_t CryptoKeyPlaintext_initBlankKey | ( | CryptoKey * | keyHandle, |
uint8_t * | keyLocation, | ||
size_t | keyLength | ||
) |
Initializes an empty plaintext CryptoKey type.
[in] | keyHandle | Pointer to a CryptoKey which will be initialized to type CryptoKey_BLANK_PLAINTEXT |
[in] | keyLocation | Pointer to location where plaintext keying material can be stored |
[in] | keyLength | Length of keying material, in bytes |
int_fast16_t CryptoKeyPlaintext_getKeyLength | ( | CryptoKey * | keyHandle, |
size_t * | length | ||
) |
Gets the length of a plaintext key.
[in] | keyHandle | Pointer to a plaintext CryptoKey |
[out] | length | Length of the keying material, in bytes |
[in] | keyHandle | Pointer to a CryptoKey |
[out] | length | Length value will be updated to CryptoKey length, in bytes |
int_fast16_t CryptoKeyPlaintext_setKeyLocation | ( | CryptoKey * | keyHandle, |
uint8_t * | location | ||
) |
Sets the CryptoKey keyMaterial pointer.
Updates the key location for a plaintext CryptoKey. Does not modify data at the pointer location.
[in] | keyHandle | Pointer to a plaintext CryptoKey who's key data pointer will be modified |
[in] | location | Pointer to key data location |