Azure IoT middleware for FreeRTOS
Functions
azure_iot_crypto.h File Reference

The port file for crypto APIs. More...

#include <stdint.h>
#include "azure_iot_result.h"

Go to the source code of this file.

Functions

AzureIoTResult_t AzureIoTCrypto_SHA256Calculate (const char *pucInputPtr, uint64_t ulInputSize, const char *pucOutputPtr, uint64_t ulOutputSize)
 Calculate a SHA256 hash. More...
 
AzureIoTResult_t AzureIoTCrypto_RS256Verify (const char *pucInputPtr, uint64_t ulInputSize, const char *pucSignaturePtr, uint64_t ulSignatureSize, const char *pucN, uint64_t ullNSize, const char *pucE, uint64_t ullESize, const char *pucBufferPtr, uint32_t ulBufferSize)
 Verify an RS256 signed payload. More...
 

Detailed Description

The port file for crypto APIs.

Used for verifying the ADU image payload.

Function Documentation

◆ AzureIoTCrypto_RS256Verify()

AzureIoTResult_t AzureIoTCrypto_RS256Verify ( const char *  pucInputPtr,
uint64_t  ulInputSize,
const char *  pucSignaturePtr,
uint64_t  ulSignatureSize,
const char *  pucN,
uint64_t  ullNSize,
const char *  pucE,
uint64_t  ullESize,
const char *  pucBufferPtr,
uint32_t  ulBufferSize 
)

Verify an RS256 signed payload.

Parameters
[in]pucInputPtrThe input to verify.
[in]ulInputSizeThe length of pucInputPtr.
[in]pucSignaturePtrThe signature of the pucInputPtr payload.
[in]ulSignatureSizeThe length of pucSignaturePtr.
[in]pucNThe pointer to the key modulus.
[in]ullNSizeThe length of pucN.
[in]pucEThe pointer to the key exponent.
[in]ullESizeThe length of pucE.
[out]pucBufferPtrThe buffer which will be used to make the calculation.
[in]ulBufferSizeThe size of pucBufferPtr.
Returns
AzureIoTResult_t

◆ AzureIoTCrypto_SHA256Calculate()

AzureIoTResult_t AzureIoTCrypto_SHA256Calculate ( const char *  pucInputPtr,
uint64_t  ulInputSize,
const char *  pucOutputPtr,
uint64_t  ulOutputSize 
)

Calculate a SHA256 hash.

Parameters
[in]pucInputPtrThe input to calculate the SHA over.
[in]ulInputSizeThe size of pucInputPtr.
[out]pucOutputPtrThe buffer into which the calculation will be placed.
[in]ulOutputSizeThe length of pucOutputPtr.
Returns
AzureIoTResult_t