x509_sign_verify.h
Go to the documentation of this file.
1 /**
2  * @file x509_sign_verify.h
3  * @brief RSA/DSA/ECDSA/EdDSA signature verification
4  *
5  * @section License
6  *
7  * SPDX-License-Identifier: GPL-2.0-or-later
8  *
9  * Copyright (C) 2010-2024 Oryx Embedded SARL. All rights reserved.
10  *
11  * This file is part of CycloneCRYPTO Open.
12  *
13  * This program is free software; you can redistribute it and/or
14  * modify it under the terms of the GNU General Public License
15  * as published by the Free Software Foundation; either version 2
16  * of the License, or (at your option) any later version.
17  *
18  * This program is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21  * GNU General Public License for more details.
22  *
23  * You should have received a copy of the GNU General Public License
24  * along with this program; if not, write to the Free Software Foundation,
25  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
26  *
27  * @author Oryx Embedded SARL (www.oryx-embedded.com)
28  * @version 2.4.4
29  **/
30 
31 #ifndef _X509_SIGN_VERIFY_H
32 #define _X509_SIGN_VERIFY_H
33 
34 //Dependencies
35 #include "core/crypto.h"
36 #include "pkix/x509_common.h"
37 
38 //C++ guard
39 #ifdef __cplusplus
40 extern "C" {
41 #endif
42 
43 
44 /**
45  * @brief Signature verification callback function
46  **/
47 
49  const X509SignAlgoId *signAlgoId,
50  const X509SubjectPublicKeyInfo *publicKeyInfo,
51  const X509OctetString *signature);
52 
53 
54 //X.509 related functions
56 
58  const X509SignAlgoId *signAlgoId,
59  const X509SubjectPublicKeyInfo *publicKeyInfo,
60  const X509OctetString *signature);
61 
63  const HashAlgo *hashAlgo, const X509SubjectPublicKeyInfo *publicKeyInfo,
64  const X509OctetString *signature);
65 
67  const HashAlgo *hashAlgo, size_t saltLen,
68  const X509SubjectPublicKeyInfo *publicKeyInfo,
69  const X509OctetString *signature);
70 
72  const HashAlgo *hashAlgo, const X509SubjectPublicKeyInfo *publicKeyInfo,
73  const X509OctetString *signature);
74 
76  const HashAlgo *hashAlgo, const X509SubjectPublicKeyInfo *publicKeyInfo,
77  const X509OctetString *signature);
78 
80  const HashAlgo *hashAlgo, const X509SubjectPublicKeyInfo *publicKeyInfo,
81  const X509OctetString *signature);
82 
84  const X509SubjectPublicKeyInfo *publicKeyInfo,
85  const X509OctetString *signature);
86 
88  const X509SubjectPublicKeyInfo *publicKeyInfo,
89  const X509OctetString *signature);
90 
91 //C++ guard
92 #ifdef __cplusplus
93 }
94 #endif
95 
96 #endif
X.509 common definitions.
error_t x509VerifyEd25519Signature(const X509OctetString *tbsData, const X509SubjectPublicKeyInfo *publicKeyInfo, const X509OctetString *signature)
Ed25519 signature verification.
error_t x509VerifyDsaSignature(const X509OctetString *tbsData, const HashAlgo *hashAlgo, const X509SubjectPublicKeyInfo *publicKeyInfo, const X509OctetString *signature)
DSA signature verification.
error_t
Error codes.
Definition: error.h:43
error_t x509VerifySignature(const X509OctetString *tbsData, const X509SignAlgoId *signAlgoId, const X509SubjectPublicKeyInfo *publicKeyInfo, const X509OctetString *signature)
Certificate signature verification.
error_t x509VerifyRsaSignature(const X509OctetString *tbsData, const HashAlgo *hashAlgo, const X509SubjectPublicKeyInfo *publicKeyInfo, const X509OctetString *signature)
RSA signature verification.
General definitions for cryptographic algorithms.
error_t x509VerifyEcdsaSignature(const X509OctetString *tbsData, const HashAlgo *hashAlgo, const X509SubjectPublicKeyInfo *publicKeyInfo, const X509OctetString *signature)
ECDSA signature verification.
error_t(* X509SignVerifyCallback)(const X509OctetString *tbsData, const X509SignAlgoId *signAlgoId, const X509SubjectPublicKeyInfo *publicKeyInfo, const X509OctetString *signature)
Signature verification callback function.
error_t x509VerifySm2Signature(const X509OctetString *tbsData, const HashAlgo *hashAlgo, const X509SubjectPublicKeyInfo *publicKeyInfo, const X509OctetString *signature)
SM2 signature verification.
error_t x509RegisterSignVerifyCallback(X509SignVerifyCallback callback)
Register signature verification callback function.
Subject Public Key Information extension.
Definition: x509_common.h:790
error_t x509VerifyEd448Signature(const X509OctetString *tbsData, const X509SubjectPublicKeyInfo *publicKeyInfo, const X509OctetString *signature)
Ed448 signature verification.
Common interface for hash algorithms.
Definition: crypto.h:1046
error_t x509VerifyRsaPssSignature(const X509OctetString *tbsData, const HashAlgo *hashAlgo, size_t saltLen, const X509SubjectPublicKeyInfo *publicKeyInfo, const X509OctetString *signature)
RSA-PSS signature verification.
Octet string.
Definition: x509_common.h:653
Signature algorithm identifier.
Definition: x509_common.h:1040