JOSE (JSON Object Signing and Encryption) More...
#include "acme/acme_client.h"
#include "acme/acme_client_jose.h"
#include "encoding/base64url.h"
#include "jansson.h"
#include "jansson_private.h"
#include "debug.h"
Go to the source code of this file.
Macros | |
#define | TRACE_LEVEL ACME_TRACE_LEVEL |
Functions | |
error_t | jwkExportRsaPublicKey (const RsaPublicKey *publicKey, char_t *buffer, size_t *written, bool_t sort) |
Export an RSA public key to JWK format. More... | |
error_t | jwkExportEcPublicKey (const EcDomainParameters *params, const EcPublicKey *publicKey, char_t *buffer, size_t *written, bool_t sort) |
Export an EC public key to JWK format. More... | |
error_t | jwkExportEddsaPublicKey (const char_t *crv, const EddsaPublicKey *publicKey, char_t *buffer, size_t *written, bool_t sort) |
Export an EdDSA public key to JWK format. More... | |
error_t | jwsCreate (const PrngAlgo *prngAlgo, void *prngContext, const char_t *protected, const char_t *payload, const char_t *alg, const char_t *crv, const void *privateKey, char_t *buffer, size_t *written) |
Create a JSON Web Signature. More... | |
error_t | jwsGenerateSignature (const PrngAlgo *prngAlgo, void *prngContext, const char_t *alg, const char_t *crv, const void *privateKey, const char_t *input, size_t inputLen, uint8_t *output, size_t *outputLen) |
Compute JWS signature using the specified algorithm. More... | |
Detailed Description
JOSE (JSON Object Signing and Encryption)
License
SPDX-License-Identifier: GPL-2.0-or-later
Copyright (C) 2019-2024 Oryx Embedded SARL. All rights reserved.
This file is part of CycloneACME Open.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- Version
- 2.4.4
Definition in file acme_client_jose.c.
Macro Definition Documentation
◆ TRACE_LEVEL
#define TRACE_LEVEL ACME_TRACE_LEVEL |
Definition at line 32 of file acme_client_jose.c.
Function Documentation
◆ jwkExportEcPublicKey()
error_t jwkExportEcPublicKey | ( | const EcDomainParameters * | params, |
const EcPublicKey * | publicKey, | ||
char_t * | buffer, | ||
size_t * | written, | ||
bool_t | sort | ||
) |
Export an EC public key to JWK format.
- Parameters
-
[in] params EC domain parameters [in] publicKey EC public key [out] buffer Output buffer where to store the JSON representation [out] written Length of the resulting JSON representation [in] sort Sort members of the JWK representation in lexicographic order
- Returns
- Error code
Definition at line 171 of file acme_client_jose.c.
◆ jwkExportEddsaPublicKey()
error_t jwkExportEddsaPublicKey | ( | const char_t * | crv, |
const EddsaPublicKey * | publicKey, | ||
char_t * | buffer, | ||
size_t * | written, | ||
bool_t | sort | ||
) |
Export an EdDSA public key to JWK format.
- Parameters
-
[in] crv Subtype of the key [in] publicKey EdDSA public key [out] buffer Output buffer where to store the JSON representation [out] written Length of the resulting JSON representation [in] sort Sort members of the JWK representation in lexicographic order
- Returns
- Error code
Definition at line 321 of file acme_client_jose.c.
◆ jwkExportRsaPublicKey()
error_t jwkExportRsaPublicKey | ( | const RsaPublicKey * | publicKey, |
char_t * | buffer, | ||
size_t * | written, | ||
bool_t | sort | ||
) |
Export an RSA public key to JWK format.
- Parameters
-
[in] publicKey RSA public key [out] buffer Output buffer where to store the JSON representation [out] written Length of the resulting JSON representation [in] sort Sort members of the JWK representation in lexicographic order
- Returns
- Error code
Definition at line 55 of file acme_client_jose.c.
◆ jwsCreate()
error_t jwsCreate | ( | const PrngAlgo * | prngAlgo, |
void * | prngContext, | ||
const char_t * | protected, | ||
const char_t * | payload, | ||
const char_t * | alg, | ||
const char_t * | crv, | ||
const void * | privateKey, | ||
char_t * | buffer, | ||
size_t * | written | ||
) |
Create a JSON Web Signature.
- Parameters
-
[in] prngAlgo PRNG algorithm [in] prngContext Pointer to the PRNG context [in] protected Pointer to the JWS protected header [in] payload Pointer to the JWS payload [in] alg Cryptographic algorithm used to secure the JWS [in] crv Subtype of the key [in] privateKey Pointer to the signer's private key [out] buffer JSON structure representing the digitally signed or MACed message [out] written Length of the resulting JSON structure
- Returns
- Error code
Definition at line 442 of file acme_client_jose.c.
◆ jwsGenerateSignature()
error_t jwsGenerateSignature | ( | const PrngAlgo * | prngAlgo, |
void * | prngContext, | ||
const char_t * | alg, | ||
const char_t * | crv, | ||
const void * | privateKey, | ||
const char_t * | input, | ||
size_t | inputLen, | ||
uint8_t * | output, | ||
size_t * | outputLen | ||
) |
Compute JWS signature using the specified algorithm.
- Parameters
-
[in] prngAlgo PRNG algorithm [in] prngContext Pointer to the PRNG context [in] alg Cryptographic algorithm used to secure the JWS [in] crv Subtype of the key [in] privateKey Pointer to the signer's private key [in] input Pointer to the JWS signing input [in] inputLen Length of the JWS signing input [out] output Buffer where to store the JWS signature [out] outputLen Length of the JWS signature
- Returns
- Error code
Definition at line 575 of file acme_client_jose.c.