|
Google Cloud IoT device SDK for embedded C
1.0.2
|
Go to the source code of this file.
Typedefs | |
| typedef enum iotc_bsp_crypto_state_e | iotc_bsp_crypto_state_t |
Functions | |
| iotc_bsp_crypto_state_t | iotc_bsp_base64_encode_urlsafe (unsigned char *dst_string, size_t dst_string_size, size_t *bytes_written, const uint8_t *src_buf, size_t src_buf_size) |
| iotc_bsp_crypto_state_t | iotc_bsp_sha256 (uint8_t *dst_buf_32_bytes, const uint8_t *src_buf, uint32_t src_buf_size) |
| iotc_bsp_crypto_state_t | iotc_bsp_ecc (const iotc_crypto_key_data_t *private_key, uint8_t *dst_buf, size_t dst_buf_size, size_t *bytes_written, const uint8_t *src_buf, size_t src_buf_size) |
Implements a cryptography library for creating JSON Web Tokens.
The cryptography library:
Definition in file iotc_bsp_crypto.h.
The crytography function states.
Definition at line 46 of file iotc_bsp_crypto.h.
| iotc_bsp_crypto_state_t iotc_bsp_base64_encode_urlsafe | ( | unsigned char * | dst_string, |
| size_t | dst_string_size, | ||
| size_t * | bytes_written, | ||
| const uint8_t * | src_buf, | ||
| size_t | src_buf_size | ||
| ) |
Encodes a string as a URL-safe, base64 string by replacing all URL-unsafe characters with a - (dash) or _ (underscore).
| [in,out] | dst_string | A pointer to a buffer that stores the URL-safe, base64 string. The SDK allocates the buffer before calling this function implementation. |
| [in] | dst_string_size | The length, in bytes, of the dst_string buffer. |
| [out] | bytes_written | The bytes written to dst_string. If the buffer is too small, bytes_written is the required buffer size. |
| [in] | src_buf | A pointer to a buffer with the string to encode. |
| [in] | src_buf_size | The size, in bytes, of buffer to which src_buf points. |
| iotc_bsp_crypto_state_t iotc_bsp_ecc | ( | const iotc_crypto_key_data_t * | private_key, |
| uint8_t * | dst_buf, | ||
| size_t | dst_buf_size, | ||
| size_t * | bytes_written, | ||
| const uint8_t * | src_buf, | ||
| size_t | src_buf_size | ||
| ) |
Generates an Elliptic Curve signature for a private key.
| [in] | private_key | The private key data or slot number. Implementations of this function must use the same private key data or slot number provided to iotc_create_iotcore_jwt(). |
| [in,out] | dst_buf | A pointer to a buffer into which the function stores the Elliptic Curve signature. The buffer is already allocated by the SDK. |
| [in] | dst_buf_size | The size, in bytes, of the buffer to which dst_buf points. |
| [out] | bytes_written | The number of bytes written to dst_buf. |
| [in] | src_buf | A pointer to a buffer of data to sign. |
| [in] | src_buf_size | The size, in bytes, of the buffer to which src_buf points. |
| iotc_bsp_crypto_state_t iotc_bsp_sha256 | ( | uint8_t * | dst_buf_32_bytes, |
| const uint8_t * | src_buf, | ||
| uint32_t | src_buf_size | ||
| ) |
Generates a SHA256 cryptographic hash.
| [in,out] | dst_buf_32_bytes | A pointer to 32-byte buffer into which this function stores the digest. The buffer is already allocated by the SDK. |
| [in] | src_buf | A pointer to buffer with the string to encode. |
| [in] | src_buf_size | The size, in bytes, of the buffer to which src_buf points. |