summaryrefslogtreecommitdiff
path: root/src/reclaim/oidc_helper.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/reclaim/oidc_helper.h')
-rw-r--r--src/reclaim/oidc_helper.h31
1 files changed, 21 insertions, 10 deletions
diff --git a/src/reclaim/oidc_helper.h b/src/reclaim/oidc_helper.h
index 0a2f832ad..12c99a7bc 100644
--- a/src/reclaim/oidc_helper.h
+++ b/src/reclaim/oidc_helper.h
@@ -30,7 +30,7 @@
#define JWT_ALG "alg"
/* Use 512bit HMAC */
-#define JWT_ALG_VALUE "HS512"
+#define JWT_ALG_VALUE_HMAC "HS512"
#define JWT_TYP "typ"
@@ -51,6 +51,17 @@ enum OIDC_VerificationOptions
OIDC_VERIFICATION_NO_CODE_VERIFIER = 1
};
+/**
+ * Create a JWT using RSA256 from attributes
+ *
+ * @param aud_key the public of the audience
+ * @param sub_key the public key of the subject
+ * @param attrs the attribute list
+ * @param presentations credential presentation list (may be empty)
+ * @param expiration_time the validity of the token
+ * @param secret_key the key used to sign the JWT
+ * @return a new base64-encoded JWT string.
+ */
char *
OIDC_generate_id_token_rsa (const struct GNUNET_IDENTITY_PublicKey *aud_key,
const struct GNUNET_IDENTITY_PublicKey *sub_key,
@@ -62,7 +73,7 @@ OIDC_generate_id_token_rsa (const struct GNUNET_IDENTITY_PublicKey *aud_key,
const json_t *secret_rsa_key);
/**
- * Create a JWT from attributes
+ * Create a JWT using HMAC (HS256) from attributes
*
* @param aud_key the public of the audience
* @param sub_key the public key of the subject
@@ -73,14 +84,14 @@ OIDC_generate_id_token_rsa (const struct GNUNET_IDENTITY_PublicKey *aud_key,
* @return a new base64-encoded JWT string.
*/
char*
-OIDC_generate_id_token (const struct GNUNET_IDENTITY_PublicKey *aud_key,
- const struct GNUNET_IDENTITY_PublicKey *sub_key,
- const struct GNUNET_RECLAIM_AttributeList *attrs,
- const struct
- GNUNET_RECLAIM_PresentationList *presentations,
- const struct GNUNET_TIME_Relative *expiration_time,
- const char *nonce,
- const char *secret_key);
+OIDC_generate_id_token_hmac (const struct GNUNET_IDENTITY_PublicKey *aud_key,
+ const struct GNUNET_IDENTITY_PublicKey *sub_key,
+ const struct GNUNET_RECLAIM_AttributeList *attrs,
+ const struct
+ GNUNET_RECLAIM_PresentationList *presentations,
+ const struct GNUNET_TIME_Relative *expiration_time,
+ const char *nonce,
+ const char *secret_key);
/**
* Builds an OIDC authorization code including