CryptoAuthLib
Microchip CryptoAuthentication Library
atca_mbedtls_wrap.c File Reference

Wrapper functions to replace cryptoauthlib software crypto functions with the mbedTLS equivalent. More...

#include "mbedtls/config.h"
#include <stdlib.h>
#include "mbedtls/pk.h"
#include "mbedtls/ecp.h"
#include "mbedtls/x509_crt.h"
#include "cryptoauthlib.h"
#include "atcacert/atcacert_client.h"
#include "atcacert/atcacert_def.h"

Macros

#define mbedtls_calloc   calloc
 
#define mbedtls_free   free
 

Functions

int atca_mbedtls_pk_init (mbedtls_pk_context *pkey, const uint16_t slotid)
 Initializes an mbedtls pk context for use with EC operations. More...
 
int atca_mbedtls_cert_add (mbedtls_x509_crt *cert, const atcacert_def_t *cert_def)
 Rebuild a certificate from an atcacert_def_t structure, and then add it to an mbedtls cert chain. More...
 

Detailed Description

Wrapper functions to replace cryptoauthlib software crypto functions with the mbedTLS equivalent.

Macro Definition Documentation

◆ mbedtls_calloc

#define mbedtls_calloc   calloc

◆ mbedtls_free

#define mbedtls_free   free

Function Documentation

◆ atca_mbedtls_cert_add()

int atca_mbedtls_cert_add ( mbedtls_x509_crt *  cert,
const atcacert_def_t cert_def 
)

Rebuild a certificate from an atcacert_def_t structure, and then add it to an mbedtls cert chain.

Parameters
[in,out]certmbedtls cert chain. Must have already been initialized
[in]cert_defCertificate definition that will be rebuilt and added
Returns
0 on success, otherwise an error code.