Azure IoT middleware for FreeRTOS
|
APIs working with JWS signatures to authenticate an ADU manifest. More...
Go to the source code of this file.
Data Structures | |
struct | AzureIoTJWS_RootKey |
Holds the values of the root key used to verify the JWS signature. More... | |
Macros | |
#define | azureiotjwsRSA3072_SIZE 384 |
#define | azureiotjwsSHA256_SIZE 32 |
#define | azureiotjwsJWS_HEADER_SIZE 1400 |
#define | azureiotjwsJWS_PAYLOAD_SIZE 60 |
#define | azureiotjwsJWK_HEADER_SIZE 48 |
#define | azureiotjwsJWK_PAYLOAD_SIZE 700 |
#define | azureiotjwsSIGNATURE_SIZE 400 |
#define | azureiotjwsSIGNING_KEY_E_SIZE 10 |
#define | azureiotjwsSIGNING_KEY_N_SIZE azureiotjwsRSA3072_SIZE |
#define | azureiotjwsSHA_CALCULATION_SCRATCH_SIZE azureiotjwsRSA3072_SIZE + azureiotjwsSHA256_SIZE |
#define | azureiotjwsSCRATCH_BUFFER_SIZE |
The minimum amount of space needed to authenticate a JWS signature. More... | |
Typedefs | |
typedef struct AzureIoTJWS_RootKey | AzureIoTJWS_RootKey_t |
Holds the values of the root key used to verify the JWS signature. | |
Functions | |
AzureIoTResult_t | AzureIoTJWS_ManifestAuthenticate (const uint8_t *pucManifest, uint32_t ulManifestLength, uint8_t *pucJWS, uint32_t ulJWSLength, AzureIoTJWS_RootKey_t *xADURootKeys, uint32_t ulADURootKeysLength, uint8_t *pucScratchBuffer, uint32_t ulScratchBufferLength) |
Authenticate the manifest from ADU. More... | |
APIs working with JWS signatures to authenticate an ADU manifest.
#define azureiotjwsJWK_HEADER_SIZE 48 |
Size of the JWK header.
#define azureiotjwsJWK_PAYLOAD_SIZE 700 |
Size of the JWK payload.
#define azureiotjwsJWS_HEADER_SIZE 1400 |
Size of the JWS header.
#define azureiotjwsJWS_PAYLOAD_SIZE 60 |
Size of the JWS payload.
#define azureiotjwsRSA3072_SIZE 384 |
Size of the RSA 3072 key.
#define azureiotjwsSCRATCH_BUFFER_SIZE |
The minimum amount of space needed to authenticate a JWS signature.
#define azureiotjwsSHA256_SIZE 32 |
Size of the SHA256 hash.
#define azureiotjwsSHA_CALCULATION_SCRATCH_SIZE azureiotjwsRSA3072_SIZE + azureiotjwsSHA256_SIZE |
Size of the sha calculation scratch space.
#define azureiotjwsSIGNATURE_SIZE 400 |
Size of the JWS/JWK signature.
#define azureiotjwsSIGNING_KEY_E_SIZE 10 |
Size of the signed key exponent.
#define azureiotjwsSIGNING_KEY_N_SIZE azureiotjwsRSA3072_SIZE |
Size of the signing key modulus.
AzureIoTResult_t AzureIoTJWS_ManifestAuthenticate | ( | const uint8_t * | pucManifest, |
uint32_t | ulManifestLength, | ||
uint8_t * | pucJWS, | ||
uint32_t | ulJWSLength, | ||
AzureIoTJWS_RootKey_t * | xADURootKeys, | ||
uint32_t | ulADURootKeysLength, | ||
uint8_t * | pucScratchBuffer, | ||
uint32_t | ulScratchBufferLength | ||
) |
Authenticate the manifest from ADU.
[in] | pucManifest | The unescaped manifest from the ADU twin property (pucUpdateManifest from AzureIoTADUUpdateRequest_t). |
[in] | ulManifestLength | The length of pucManifest . (ulUpdateManifestLength from AzureIoTADUUpdateRequest_t). |
[in] | pucJWS | The JWS signature used to authenticate pucManifest . (pucUpdateManifestSignature from AzureIoTADUUpdateRequest_t). |
[in] | ulJWSLength | The length of pucJWS . (ulUpdateManifestSignatureLength from AzureIoTADUUpdateRequest_t). |
[in] | xADURootKeys | An array of root keys that may be used to verify the payload. |
[in] | ulADURootKeysLength | The length of the array of root keys. |
[out] | pucScratchBuffer | Scratch buffer space for calculations. It should be azureiotjwsSCRATCH_BUFFER_SIZE in length. |
[in] | ulScratchBufferLength | The length of pucScratchBuffer . |
eAzureIoTSuccess | if successful. |
Otherwise | if failed. |