Skip to content

Commit 5158938

Browse files
committed
wip - nrfcloud integration
1 parent 298ace9 commit 5158938

File tree

4 files changed

+44
-342
lines changed

4 files changed

+44
-342
lines changed

include/app_jwt.h

+3-13
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ extern "C" {
2323
#include <stdint.h>
2424
#include <stdbool.h>
2525
#include <strings.h>
26+
#include <modem/modem_jwt.h>
2627

2728
/** @brief Maximum size of a JWT string, could be used to allocate JWT
2829
* output buffer.
@@ -44,25 +45,14 @@ extern "C" {
4445
/** @brief Size in bytes of each JWT String field */
4546
#define APP_JWT_CLAIM_MAX_SIZE 64
4647

47-
/** @brief The type of key to be used for signing the JWT. */
48-
enum app_jwt_key_type {
49-
JWT_KEY_TYPE_CLIENT_PRIV = 2,
50-
JWT_KEY_TYPE_ENDORSEMENT = 8,
51-
};
52-
53-
/** @brief JWT signing algorithm */
54-
enum app_jwt_alg_type {
55-
JWT_ALG_TYPE_ES256 = 0,
56-
};
57-
5848
/** @brief JWT parameters required for JWT generation and pointer to generated JWT */
5949
struct app_jwt_data {
6050
/** Sec tag to use for JWT signing */
6151
unsigned int sec_tag;
6252
/** Key type in the specified sec tag */
63-
enum app_jwt_key_type key_type;
53+
enum jwt_key_type key_type;
6454
/** JWT signing algorithm */
65-
enum app_jwt_alg_type alg;
55+
enum jwt_alg_type alg;
6656

6757
/**
6858
* Indicates if a 'kid' claim is requiered or not, if set to 1, 'kid' claim

lib/app_jwt/Kconfig

-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
menuconfig APP_JWT
88
bool "Application JWT Library"
9-
depends on SSF_CLIENT && SSF_PSA_CRYPTO_SERVICE_ENABLED && SSF_DEVICE_INFO_SERVICE_ENABLED
109
select BASE64
1110
# Needed for time and date
1211
select DATE_TIME

subsys/net/lib/nrf_cloud/Kconfig

+1-8
Original file line numberDiff line numberDiff line change
@@ -103,14 +103,7 @@ config NRF_CLOUD_JWT_SOURCE_CUSTOM
103103
select EXPERIMENTAL
104104
select TLS_CREDENTIALS
105105
select BASE64
106-
select TINYCRYPT
107-
select TINYCRYPT_SHA256
108-
select TINYCRYPT_ECC_DSA
109-
select TINYCRYPT_CTR_PRNG
110-
select TINYCRYPT_AES
111-
select CJSON_LIB
112-
depends on NEWLIB_LIBC_FLOAT_PRINTF || PICOLIBC_IO_FLOAT
113-
depends on DATE_TIME
106+
select APP_JWT
114107
help
115108
JWTs are created and signed by the nRF Cloud library, not the modem.
116109
The signing key is obtained from the TLS credentials module.

0 commit comments

Comments
 (0)