BSL v1.1.1 - 50.g42e5d9b
AMMOS Bundle Protocol Security Library (BSL)
Loading...
Searching...
No Matches

Implementation of the key loader logic for JWK Set and COSE Key Set. More...

#include "KeyLoader.h"
#include <bsl/front/TextUtil.h>
#include <bsl/dynamic/CBOR.h>
#include <bsl/dynamic/Variant.h>
#include <bsl/cose_sc/CoseMsg.h>
#include <jansson.h>
#include <m-string.h>
#include <fcntl.h>
#include <sys/mman.h>
#include <sys/stat.h>
#include <unistd.h>
+ Include dependency graph for KeyLoader.c:

Functions

int BSL_Crypto_KeyLoader_LoadFile (const char *file_path)
 Load keys from file.
 
int BSL_Crypto_KeyLoader_LoadJwkSet (int fd)
 
static int BSL_Crypto_KeyLoader_LoadCoseKeySet_decode (QCBORDecodeContext *dec, const void *obj)
 Decode a COSE_KeySet array.
 
int BSL_Crypto_KeyLoader_LoadCoseKeySet (int infd)
 

Variables

BSL_KeyStore_Descriptors_t BSL_KeyStore_State
 Initialized to library default.
 

Detailed Description

Implementation of the key loader logic for JWK Set and COSE Key Set.

Function Documentation

◆ BSL_Crypto_KeyLoader_LoadCoseKeySet()

int BSL_Crypto_KeyLoader_LoadCoseKeySet ( int  infd)
Warning
Exposed only for testing.
Parameters
infdThe file descriptor to read from.

References BSL_CBOR_Decode(), BSL_Crypto_KeyLoader_LoadCoseKeySet_decode(), BSL_Data_InitView(), BSL_ERR_DECODING, and BSL_LOG_ERR.

Referenced by BSL_Crypto_KeyLoader_LoadFile(), and LLVMFuzzerTestOneInput().

◆ BSL_Crypto_KeyLoader_LoadCoseKeySet_decode()

◆ BSL_Crypto_KeyLoader_LoadFile()

int BSL_Crypto_KeyLoader_LoadFile ( const char *  file_path)

Load keys from file.

Parameters
[in]file_pathpath to JSON file with JWK Set or CBOR file with COSE_KeySet
Returns
0 if successful.

References BSL_Crypto_KeyLoader_LoadCoseKeySet(), BSL_Crypto_KeyLoader_LoadJwkSet(), BSL_ERR_ARG_INVALID, BSL_ERR_DECODING, BSL_LOG_ERR, BSL_LOG_INFO, and BSL_SUCCESS.

Referenced by main().

◆ BSL_Crypto_KeyLoader_LoadJwkSet()

Variable Documentation

◆ BSL_KeyStore_State