TianoCore EDK2 master
Loading...
Searching...
No Matches
CryptPkcs7Sign.c File Reference
#include "InternalCryptLib.h"
#include <openssl/objects.h>
#include <openssl/x509.h>
#include <openssl/pkcs7.h>

Go to the source code of this file.

Functions

BOOLEAN EFIAPI Pkcs7Sign (IN CONST UINT8 *PrivateKey, IN UINTN PrivateKeySize, IN CONST UINT8 *KeyPassword, IN UINT8 *InData, IN UINTN InDataSize, IN UINT8 *SignCert, IN UINT8 *OtherCerts OPTIONAL, OUT UINT8 **SignedData, OUT UINTN *SignedDataSize)
 

Detailed Description

PKCS#7 SignedData Sign Wrapper Implementation over OpenSSL.

Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file CryptPkcs7Sign.c.

Function Documentation

◆ Pkcs7Sign()

BOOLEAN EFIAPI Pkcs7Sign ( IN CONST UINT8 *  PrivateKey,
IN UINTN  PrivateKeySize,
IN CONST UINT8 *  KeyPassword,
IN UINT8 *  InData,
IN UINTN  InDataSize,
IN UINT8 *  SignCert,
IN UINT8 *OtherCerts  OPTIONAL,
OUT UINT8 **  SignedData,
OUT UINTN SignedDataSize 
)

Creates a PKCS#7 signedData as described in "PKCS #7: Cryptographic Message Syntax Standard, version 1.5". This interface is only intended to be used for application to perform PKCS#7 functionality validation.

Parameters
[in]PrivateKeyPointer to the PEM-formatted private key data for data signing.
[in]PrivateKeySizeSize of the PEM private key data in bytes.
[in]KeyPasswordNULL-terminated passphrase used for encrypted PEM key data.
[in]InDataPointer to the content to be signed.
[in]InDataSizeSize of InData in bytes.
[in]SignCertPointer to signer's DER-encoded certificate to sign with.
[in]OtherCertsPointer to an optional additional set of certificates to include in the PKCS#7 signedData (e.g. any intermediate CAs in the chain).
[out]SignedDataPointer to output PKCS#7 signedData. It's caller's responsibility to free the buffer with FreePool().
[out]SignedDataSizeSize of SignedData in bytes.
Return values
TRUEPKCS#7 data signing succeeded.
FALSEPKCS#7 data signing failed.

Definition at line 41 of file CryptPkcs7Sign.c.