RSA/DSA/ECDSA/EdDSA signature generation. More...
Go to the source code of this file.
Typedefs | |
typedef error_t(* | X509SignGenCallback) (const PrngAlgo *prngAlgo, void *prngContext, const X509OctetString *tbsData, const X509SignAlgoId *signAlgoId, const X509SubjectPublicKeyInfo *publicKeyInfo, const void *privateKey, uint8_t *output, size_t *written) |
Signature generation callback function. More... | |
Functions | |
error_t | x509RegisterSignGenCallback (X509SignGenCallback callback) |
Register signature generation callback function. More... | |
error_t | x509GenerateSignature (const PrngAlgo *prngAlgo, void *prngContext, const X509OctetString *tbsData, const X509SignAlgoId *signAlgoId, const X509SubjectPublicKeyInfo *publicKeyInfo, const void *privateKey, uint8_t *output, size_t *written) |
Certificate signature generation. More... | |
error_t | x509GenerateRsaSignature (const X509OctetString *tbsData, const HashAlgo *hashAlgo, const RsaPrivateKey *privateKey, uint8_t *output, size_t *written) |
RSA signature generation. More... | |
error_t | x509GenerateRsaPssSignature (const PrngAlgo *prngAlgo, void *prngContext, const X509OctetString *tbsData, const HashAlgo *hashAlgo, size_t saltLen, const RsaPrivateKey *privateKey, uint8_t *output, size_t *written) |
RSA-PSS signature generation. More... | |
error_t | x509GenerateDsaSignature (const PrngAlgo *prngAlgo, void *prngContext, const X509OctetString *tbsData, const HashAlgo *hashAlgo, const DsaPrivateKey *privateKey, uint8_t *output, size_t *written) |
DSA signature generation. More... | |
error_t | x509GenerateEcdsaSignature (const PrngAlgo *prngAlgo, void *prngContext, const X509OctetString *tbsData, const HashAlgo *hashAlgo, const X509SubjectPublicKeyInfo *publicKeyInfo, const EcPrivateKey *privateKey, uint8_t *output, size_t *written) |
ECDSA signature generation. More... | |
error_t | x509GenerateSm2Signature (const PrngAlgo *prngAlgo, void *prngContext, const X509OctetString *tbsData, const HashAlgo *hashAlgo, const EcPrivateKey *privateKey, uint8_t *output, size_t *written) |
SM2 signature generation. More... | |
error_t | x509GenerateEd25519Signature (const X509OctetString *tbsData, const EddsaPrivateKey *privateKey, uint8_t *output, size_t *written) |
Ed25519 signature generation. More... | |
error_t | x509GenerateEd448Signature (const X509OctetString *tbsData, const EddsaPrivateKey *privateKey, uint8_t *output, size_t *written) |
Ed448 signature generation. More... | |
Detailed Description
RSA/DSA/ECDSA/EdDSA signature generation.
License
SPDX-License-Identifier: GPL-2.0-or-later
Copyright (C) 2010-2024 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.4.4
Definition in file x509_sign_generate.h.
Typedef Documentation
◆ X509SignGenCallback
typedef error_t(* X509SignGenCallback) (const PrngAlgo *prngAlgo, void *prngContext, const X509OctetString *tbsData, const X509SignAlgoId *signAlgoId, const X509SubjectPublicKeyInfo *publicKeyInfo, const void *privateKey, uint8_t *output, size_t *written) |
Signature generation callback function.
Definition at line 48 of file x509_sign_generate.h.
Function Documentation
◆ x509GenerateDsaSignature()
error_t x509GenerateDsaSignature | ( | const PrngAlgo * | prngAlgo, |
void * | prngContext, | ||
const X509OctetString * | tbsData, | ||
const HashAlgo * | hashAlgo, | ||
const DsaPrivateKey * | privateKey, | ||
uint8_t * | output, | ||
size_t * | written | ||
) |
DSA signature generation.
- Parameters
-
[in] prngAlgo PRNG algorithm [in] prngContext Pointer to the PRNG context [in] tbsData Pointer to the data to be signed [in] hashAlgo Underlying hash function [in] privateKey Signer's private key [out] output Resulting signature [out] written Length of the resulting signature
- Returns
- Error code
Definition at line 291 of file x509_sign_generate.c.
◆ x509GenerateEcdsaSignature()
error_t x509GenerateEcdsaSignature | ( | const PrngAlgo * | prngAlgo, |
void * | prngContext, | ||
const X509OctetString * | tbsData, | ||
const HashAlgo * | hashAlgo, | ||
const X509SubjectPublicKeyInfo * | publicKeyInfo, | ||
const EcPrivateKey * | privateKey, | ||
uint8_t * | output, | ||
size_t * | written | ||
) |
ECDSA signature generation.
- Parameters
-
[in] prngAlgo PRNG algorithm [in] prngContext Pointer to the PRNG context [in] tbsData Pointer to the data to be signed [in] hashAlgo Underlying hash function [in] publicKeyInfo Signer's public key information [in] privateKey Signer's private key [out] output Resulting signature [out] written Length of the resulting signature
- Returns
- Error code
Definition at line 346 of file x509_sign_generate.c.
◆ x509GenerateEd25519Signature()
error_t x509GenerateEd25519Signature | ( | const X509OctetString * | tbsData, |
const EddsaPrivateKey * | privateKey, | ||
uint8_t * | output, | ||
size_t * | written | ||
) |
Ed25519 signature generation.
- Parameters
-
[in] tbsData Pointer to the data to be signed [in] privateKey Signer's private key [out] output Resulting signature [out] written Length of the resulting signature
- Returns
- Error code
Definition at line 481 of file x509_sign_generate.c.
◆ x509GenerateEd448Signature()
error_t x509GenerateEd448Signature | ( | const X509OctetString * | tbsData, |
const EddsaPrivateKey * | privateKey, | ||
uint8_t * | output, | ||
size_t * | written | ||
) |
Ed448 signature generation.
- Parameters
-
[in] tbsData Pointer to the data to be signed [in] privateKey Signer's private key [out] output Resulting signature [out] written Length of the resulting signature
- Returns
- Error code
Definition at line 531 of file x509_sign_generate.c.
◆ x509GenerateRsaPssSignature()
error_t x509GenerateRsaPssSignature | ( | const PrngAlgo * | prngAlgo, |
void * | prngContext, | ||
const X509OctetString * | tbsData, | ||
const HashAlgo * | hashAlgo, | ||
size_t | saltLen, | ||
const RsaPrivateKey * | privateKey, | ||
uint8_t * | output, | ||
size_t * | written | ||
) |
RSA-PSS signature generation.
- Parameters
-
[in] prngAlgo PRNG algorithm [in] prngContext Pointer to the PRNG context [in] tbsData Pointer to the data to be signed [in] hashAlgo Underlying hash function [in] saltLen Length of the salt, in bytes [in] privateKey Signer's private key [out] output Resulting signature [out] written Length of the resulting signature
- Returns
- Error code
Definition at line 251 of file x509_sign_generate.c.
◆ x509GenerateRsaSignature()
error_t x509GenerateRsaSignature | ( | const X509OctetString * | tbsData, |
const HashAlgo * | hashAlgo, | ||
const RsaPrivateKey * | privateKey, | ||
uint8_t * | output, | ||
size_t * | written | ||
) |
RSA signature generation.
- Parameters
-
[in] tbsData Pointer to the data to be signed [in] hashAlgo Underlying hash function [in] privateKey Signer's private key [out] output Resulting signature [out] written Length of the resulting signature
- Returns
- Error code
Definition at line 210 of file x509_sign_generate.c.
◆ x509GenerateSignature()
error_t x509GenerateSignature | ( | const PrngAlgo * | prngAlgo, |
void * | prngContext, | ||
const X509OctetString * | tbsData, | ||
const X509SignAlgoId * | signAlgoId, | ||
const X509SubjectPublicKeyInfo * | publicKeyInfo, | ||
const void * | privateKey, | ||
uint8_t * | output, | ||
size_t * | written | ||
) |
Certificate signature generation.
- Parameters
-
[in] prngAlgo PRNG algorithm [in] prngContext Pointer to the PRNG context [in] tbsData Pointer to the data to be signed [in] signAlgoId Signature algorithm identifier [in] publicKeyInfo Signer's public key information [in] privateKey Signer's private key [out] output Resulting signature [out] written Length of the resulting signature
- Returns
- Error code
Definition at line 81 of file x509_sign_generate.c.
◆ x509GenerateSm2Signature()
error_t x509GenerateSm2Signature | ( | const PrngAlgo * | prngAlgo, |
void * | prngContext, | ||
const X509OctetString * | tbsData, | ||
const HashAlgo * | hashAlgo, | ||
const EcPrivateKey * | privateKey, | ||
uint8_t * | output, | ||
size_t * | written | ||
) |
SM2 signature generation.
- Parameters
-
[in] prngAlgo PRNG algorithm [in] prngContext Pointer to the PRNG context [in] tbsData Pointer to the data to be signed [in] hashAlgo Underlying hash function [in] privateKey Signer's private key [out] output Resulting signature [out] written Length of the resulting signature
- Returns
- Error code
Definition at line 426 of file x509_sign_generate.c.
◆ x509RegisterSignGenCallback()
error_t x509RegisterSignGenCallback | ( | X509SignGenCallback | callback | ) |
Register signature generation callback function.
- Parameters
-
[in] callback Signature generation callback function
- Returns
- Error code
Definition at line 54 of file x509_sign_generate.c.