x509_sign_verify.h File Reference

RSA/DSA/ECDSA/EdDSA signature verification. More...

#include "core/crypto.h"
#include "pkix/x509_common.h"

Go to the source code of this file.

Typedefs

typedef error_t(* X509SignVerifyCallback) (const X509OctetString *tbsData, const X509SignAlgoId *signAlgoId, const X509SubjectPublicKeyInfo *publicKeyInfo, const X509OctetString *signature)
 Signature verification callback function. More...
 

Functions

error_t x509RegisterSignVerifyCallback (X509SignVerifyCallback callback)
 Register signature verification callback function. More...
 
error_t x509VerifySignature (const X509OctetString *tbsData, const X509SignAlgoId *signAlgoId, const X509SubjectPublicKeyInfo *publicKeyInfo, const X509OctetString *signature)
 Certificate signature verification. More...
 
error_t x509VerifyRsaSignature (const X509OctetString *tbsData, const HashAlgo *hashAlgo, const X509SubjectPublicKeyInfo *publicKeyInfo, const X509OctetString *signature)
 RSA signature verification. More...
 
error_t x509VerifyRsaPssSignature (const X509OctetString *tbsData, const HashAlgo *hashAlgo, size_t saltLen, const X509SubjectPublicKeyInfo *publicKeyInfo, const X509OctetString *signature)
 RSA-PSS signature verification. More...
 
error_t x509VerifyDsaSignature (const X509OctetString *tbsData, const HashAlgo *hashAlgo, const X509SubjectPublicKeyInfo *publicKeyInfo, const X509OctetString *signature)
 DSA signature verification. More...
 
error_t x509VerifyEcdsaSignature (const X509OctetString *tbsData, const HashAlgo *hashAlgo, const X509SubjectPublicKeyInfo *publicKeyInfo, const X509OctetString *signature)
 ECDSA signature verification. More...
 
error_t x509VerifySm2Signature (const X509OctetString *tbsData, const HashAlgo *hashAlgo, const X509SubjectPublicKeyInfo *publicKeyInfo, const X509OctetString *signature)
 SM2 signature verification. More...
 
error_t x509VerifyEd25519Signature (const X509OctetString *tbsData, const X509SubjectPublicKeyInfo *publicKeyInfo, const X509OctetString *signature)
 Ed25519 signature verification. More...
 
error_t x509VerifyEd448Signature (const X509OctetString *tbsData, const X509SubjectPublicKeyInfo *publicKeyInfo, const X509OctetString *signature)
 Ed448 signature verification. More...
 

Detailed Description

RSA/DSA/ECDSA/EdDSA signature verification.

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.

Author
Oryx Embedded SARL (www.oryx-embedded.com)
Version
2.4.4

Definition in file x509_sign_verify.h.

Typedef Documentation

◆ X509SignVerifyCallback

typedef error_t(* X509SignVerifyCallback) (const X509OctetString *tbsData, const X509SignAlgoId *signAlgoId, const X509SubjectPublicKeyInfo *publicKeyInfo, const X509OctetString *signature)

Signature verification callback function.

Definition at line 48 of file x509_sign_verify.h.

Function Documentation

◆ x509RegisterSignVerifyCallback()

error_t x509RegisterSignVerifyCallback ( X509SignVerifyCallback  callback)

Register signature verification callback function.

Parameters
[in]callbackSignature verification callback function
Returns
Error code

Definition at line 55 of file x509_sign_verify.c.

◆ x509VerifyDsaSignature()

error_t x509VerifyDsaSignature ( const X509OctetString tbsData,
const HashAlgo hashAlgo,
const X509SubjectPublicKeyInfo publicKeyInfo,
const X509OctetString signature 
)

DSA signature verification.

Parameters
[in]tbsDataData whose signature is to be verified
[in]hashAlgoUnderlying hash function
[in]publicKeyInfoIssuer's public key
[in]signatureSignature to be verified
Returns
Error code

Definition at line 337 of file x509_sign_verify.c.

◆ x509VerifyEcdsaSignature()

error_t x509VerifyEcdsaSignature ( const X509OctetString tbsData,
const HashAlgo hashAlgo,
const X509SubjectPublicKeyInfo publicKeyInfo,
const X509OctetString signature 
)

ECDSA signature verification.

Parameters
[in]tbsDataData whose signature is to be verified
[in]hashAlgoUnderlying hash function
[in]publicKeyInfoIssuer's public key
[in]signatureSignature to be verified
Returns
Error code

Definition at line 415 of file x509_sign_verify.c.

◆ x509VerifyEd25519Signature()

error_t x509VerifyEd25519Signature ( const X509OctetString tbsData,
const X509SubjectPublicKeyInfo publicKeyInfo,
const X509OctetString signature 
)

Ed25519 signature verification.

Parameters
[in]tbsDataData whose signature is to be verified
[in]publicKeyInfoIssuer's public key
[in]signatureSignature to be verified
Returns
Error code

Definition at line 573 of file x509_sign_verify.c.

◆ x509VerifyEd448Signature()

error_t x509VerifyEd448Signature ( const X509OctetString tbsData,
const X509SubjectPublicKeyInfo publicKeyInfo,
const X509OctetString signature 
)

Ed448 signature verification.

Parameters
[in]tbsDataData whose signature is to be verified
[in]publicKeyInfoIssuer's public key
[in]signatureSignature to be verified
Returns
Error code

Definition at line 619 of file x509_sign_verify.c.

◆ x509VerifyRsaPssSignature()

error_t x509VerifyRsaPssSignature ( const X509OctetString tbsData,
const HashAlgo hashAlgo,
size_t  saltLen,
const X509SubjectPublicKeyInfo publicKeyInfo,
const X509OctetString signature 
)

RSA-PSS signature verification.

Parameters
[in]tbsDataData whose signature is to be verified
[in]hashAlgoUnderlying hash function
[in]saltLenLength of the salt, in bytes
[in]publicKeyInfoIssuer's public key
[in]signatureSignature to be verified
Returns
Error code

Definition at line 270 of file x509_sign_verify.c.

◆ x509VerifyRsaSignature()

error_t x509VerifyRsaSignature ( const X509OctetString tbsData,
const HashAlgo hashAlgo,
const X509SubjectPublicKeyInfo publicKeyInfo,
const X509OctetString signature 
)

RSA signature verification.

Parameters
[in]tbsDataData whose signature is to be verified
[in]hashAlgoUnderlying hash function
[in]publicKeyInfoIssuer's public key
[in]signatureSignature to be verified
Returns
Error code

Definition at line 203 of file x509_sign_verify.c.

◆ x509VerifySignature()

error_t x509VerifySignature ( const X509OctetString tbsData,
const X509SignAlgoId signAlgoId,
const X509SubjectPublicKeyInfo publicKeyInfo,
const X509OctetString signature 
)

Certificate signature verification.

Parameters
[in]tbsDataData whose signature is to be verified
[in]signAlgoIdSignature algorithm identifier
[in]publicKeyInfoIssuer's public key
[in]signatureSignature to be verified
Returns
Error code

Definition at line 78 of file x509_sign_verify.c.

◆ x509VerifySm2Signature()

error_t x509VerifySm2Signature ( const X509OctetString tbsData,
const HashAlgo hashAlgo,
const X509SubjectPublicKeyInfo publicKeyInfo,
const X509OctetString signature 
)

SM2 signature verification.

Parameters
[in]tbsDataData whose signature is to be verified
[in]hashAlgoUnderlying hash function
[in]publicKeyInfoIssuer's public key
[in]signatureSignature to be verified
Returns
Error code

Definition at line 505 of file x509_sign_verify.c.