PKCS #7 signature generation. More...
#include "core/crypto.h"
#include "pkcs7/pkcs7_format.h"
#include "pkcs7/pkcs7_sign_generate.h"
#include "encoding/oid.h"
#include "debug.h"
Go to the source code of this file.
Macros | |
#define | TRACE_LEVEL CRYPTO_TRACE_LEVEL |
Functions | |
error_t | pkcs7GenerateSignedData (const PrngAlgo *prngAlgo, void *prngContext, const uint8_t *content, size_t contentLen, const X509CertInfo *signerCertInfo, const Pkcs7AuthenticatedAttributes *authenticatedAttributes, const Pkcs7UnauthenticatedAttributes *unauthenticatedAttributes, const X509SignAlgoId *signatureAlgo, const void *signerPrivateKey, uint8_t *output, size_t *written) |
Generate signed-data content. More... | |
error_t | pkcs7GenerateSignature (const PrngAlgo *prngAlgo, void *prngContext, const uint8_t *digest, const Pkcs7SignerInfo *signerInfo, const void *privateKey, uint8_t *output, size_t *written) |
Signature generation. More... | |
error_t | pkcs7GenerateRsaSignature (const uint8_t *digest, const Pkcs7SignerInfo *signerInfo, const RsaPrivateKey *privateKey, uint8_t *output, size_t *written) |
RSA signature generation. More... | |
Detailed Description
PKCS #7 signature generation.
License
SPDX-License-Identifier: GPL-2.0-or-later
Copyright (C) 2010-2025 Oryx Embedded SARL. All rights reserved.
This file is part of CycloneCRYPTO 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.5.2
Definition in file pkcs7_sign_generate.c.
Macro Definition Documentation
◆ TRACE_LEVEL
#define TRACE_LEVEL CRYPTO_TRACE_LEVEL |
Definition at line 32 of file pkcs7_sign_generate.c.
Function Documentation
◆ pkcs7GenerateRsaSignature()
error_t pkcs7GenerateRsaSignature | ( | const uint8_t * | digest, |
const Pkcs7SignerInfo * | signerInfo, | ||
const RsaPrivateKey * | privateKey, | ||
uint8_t * | output, | ||
size_t * | written | ||
) |
RSA signature generation.
- Parameters
-
[in] digest Message digest [in] signerInfo Pointer to the signer information [in] privateKey Signer's private key [out] output Resulting signature [out] written Length of the resulting signature
- Returns
- Error code
Definition at line 215 of file pkcs7_sign_generate.c.
◆ pkcs7GenerateSignature()
error_t pkcs7GenerateSignature | ( | const PrngAlgo * | prngAlgo, |
void * | prngContext, | ||
const uint8_t * | digest, | ||
const Pkcs7SignerInfo * | signerInfo, | ||
const void * | privateKey, | ||
uint8_t * | output, | ||
size_t * | written | ||
) |
Signature generation.
- Parameters
-
[in] prngAlgo PRNG algorithm [in] prngContext Pointer to the PRNG context [in] digest Message digest [in] signerInfo Pointer to the signer information [in] privateKey Signer's private key [out] output Resulting signature [out] written Length of the resulting signature
- Returns
- Error code
Definition at line 167 of file pkcs7_sign_generate.c.
◆ pkcs7GenerateSignedData()
error_t pkcs7GenerateSignedData | ( | const PrngAlgo * | prngAlgo, |
void * | prngContext, | ||
const uint8_t * | content, | ||
size_t | contentLen, | ||
const X509CertInfo * | signerCertInfo, | ||
const Pkcs7AuthenticatedAttributes * | authenticatedAttributes, | ||
const Pkcs7UnauthenticatedAttributes * | unauthenticatedAttributes, | ||
const X509SignAlgoId * | signatureAlgo, | ||
const void * | signerPrivateKey, | ||
uint8_t * | output, | ||
size_t * | written | ||
) |
Generate signed-data content.
- Parameters
-
[in] prngAlgo PRNG algorithm [in] prngContext Pointer to the PRNG context [in] content Pointer to the message to be signed [in] contentLen Length of the message, in bytes [in] signerCertInfo Signer's certificate [in] authenticatedAttributes Collection of attributes that are signed [in] unauthenticatedAttributes Collection of attributes that are not signed [in] signatureAlgo Signature algorithm [in] signerPrivateKey Pointer to the signer's private key [out] output Buffer where to format the ASN.1 structure [out] written Length of the resulting ASN.1 structure
- Returns
- Error code
Definition at line 61 of file pkcs7_sign_generate.c.