pkcs7_sign_verify.c File Reference

PKCS #7 signature verification. More...

#include "core/crypto.h"
#include "pkcs7/pkcs7_parse.h"
#include "pkcs7/pkcs7_sign_verify.h"
#include "hash/hash_algorithms.h"
#include "pkix/x509_key_parse.h"
#include "encoding/asn1.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 pkcs7VerifySignedData (const Pkcs7SignedData *signedData, const Pkcs7SignerInfo *signerInfo, const X509CertInfo *signerCertInfo)
 Verify signature over signed-data content. More...
 
error_t pkcs7VerifySignature (const uint8_t *digest, const Pkcs7SignerInfo *signerInfo, const X509SubjectPublicKeyInfo *publicKeyInfo, const X509OctetString *signature)
 Signature verification. More...
 
error_t pkcs7VerifyRsaSignature (const uint8_t *digest, const Pkcs7SignerInfo *signerInfo, const X509SubjectPublicKeyInfo *publicKeyInfo, const X509OctetString *signature)
 RSA signature verification. More...
 
error_t pkcs7FindSigner (const Pkcs7SignerInfos *signerInfos, const X509CertInfo *signerCertInfo, Pkcs7SignerInfo *signerInfo)
 Search a list of per-signer informations for a given signer. More...
 

Detailed Description

PKCS #7 signature verification.

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.

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

Definition in file pkcs7_sign_verify.c.

Macro Definition Documentation

◆ TRACE_LEVEL

#define TRACE_LEVEL   CRYPTO_TRACE_LEVEL

Definition at line 32 of file pkcs7_sign_verify.c.

Function Documentation

◆ pkcs7FindSigner()

error_t pkcs7FindSigner ( const Pkcs7SignerInfos signerInfos,
const X509CertInfo signerCertInfo,
Pkcs7SignerInfo signerInfo 
)

Search a list of per-signer informations for a given signer.

Parameters
[in]signerInfosPointer to the collection of per-signer information
[in]signerCertInfoSigner's certificate
[out]signerInfoPointer to the matching SignerInfo structure, if any
Returns
Error code

Definition at line 268 of file pkcs7_sign_verify.c.

◆ pkcs7VerifyRsaSignature()

error_t pkcs7VerifyRsaSignature ( const uint8_t *  digest,
const Pkcs7SignerInfo signerInfo,
const X509SubjectPublicKeyInfo publicKeyInfo,
const X509OctetString signature 
)

RSA signature verification.

Parameters
[in]digestMessage digest
[in]signerInfoPointer to the signer information
[in]publicKeyInfoSigner's public key
[in]signatureSignature to be verified
Returns
Error code

Definition at line 193 of file pkcs7_sign_verify.c.

◆ pkcs7VerifySignature()

error_t pkcs7VerifySignature ( const uint8_t *  digest,
const Pkcs7SignerInfo signerInfo,
const X509SubjectPublicKeyInfo publicKeyInfo,
const X509OctetString signature 
)

Signature verification.

Parameters
[in]digestMessage digest
[in]signerInfoPointer to the signer information
[in]publicKeyInfoSigner's public key
[in]signatureSignature to be verified
Returns
Error code

Definition at line 145 of file pkcs7_sign_verify.c.

◆ pkcs7VerifySignedData()

error_t pkcs7VerifySignedData ( const Pkcs7SignedData signedData,
const Pkcs7SignerInfo signerInfo,
const X509CertInfo signerCertInfo 
)

Verify signature over signed-data content.

Parameters
[in]signedDataPointer to the signed-data content
[in]signerInfoPointer to the signer information
[in]signerCertInfoSigner's certificate
Returns
Error code

Definition at line 56 of file pkcs7_sign_verify.c.