Path: blob/main/sys/contrib/edk2/Include/Guid/WinCertificate.h
48383 views
/** @file1GUID for UEFI WIN_CERTIFICATE structure.23Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>4SPDX-License-Identifier: BSD-2-Clause-Patent56@par Revision Reference:7GUID defined in UEFI 2.0 spec.8**/910#ifndef __EFI_WIN_CERTIFICATE_H__11#define __EFI_WIN_CERTIFICATE_H__1213//14// _WIN_CERTIFICATE.wCertificateType15//16#define WIN_CERT_TYPE_PKCS_SIGNED_DATA 0x000217#define WIN_CERT_TYPE_EFI_PKCS115 0x0EF018#define WIN_CERT_TYPE_EFI_GUID 0x0EF11920///21/// The WIN_CERTIFICATE structure is part of the PE/COFF specification.22///23typedef struct {24///25/// The length of the entire certificate,26/// including the length of the header, in bytes.27///28UINT32 dwLength;29///30/// The revision level of the WIN_CERTIFICATE31/// structure. The current revision level is 0x0200.32///33UINT16 wRevision;34///35/// The certificate type. See WIN_CERT_TYPE_xxx for the UEFI36/// certificate types. The UEFI specification reserves the range of37/// certificate type values from 0x0EF0 to 0x0EFF.38///39UINT16 wCertificateType;40///41/// The following is the actual certificate. The format of42/// the certificate depends on wCertificateType.43///44/// UINT8 bCertificate[ANYSIZE_ARRAY];45///46} WIN_CERTIFICATE;4748///49/// WIN_CERTIFICATE_UEFI_GUID.CertType50///51#define EFI_CERT_TYPE_RSA2048_SHA256_GUID \52{0xa7717414, 0xc616, 0x4977, {0x94, 0x20, 0x84, 0x47, 0x12, 0xa7, 0x35, 0xbf } }5354///55/// WIN_CERTIFICATE_UEFI_GUID.CertData56///57typedef struct {58EFI_GUID HashType;59UINT8 PublicKey[256];60UINT8 Signature[256];61} EFI_CERT_BLOCK_RSA_2048_SHA256;6263///64/// Certificate which encapsulates a GUID-specific digital signature65///66typedef struct {67///68/// This is the standard WIN_CERTIFICATE header, where69/// wCertificateType is set to WIN_CERT_TYPE_EFI_GUID.70///71WIN_CERTIFICATE Hdr;72///73/// This is the unique id which determines the74/// format of the CertData. .75///76EFI_GUID CertType;77///78/// The following is the certificate data. The format of79/// the data is determined by the CertType.80/// If CertType is EFI_CERT_TYPE_RSA2048_SHA256_GUID,81/// the CertData will be EFI_CERT_BLOCK_RSA_2048_SHA256 structure.82///83UINT8 CertData[1];84} WIN_CERTIFICATE_UEFI_GUID;8586///87/// Certificate which encapsulates the RSASSA_PKCS1-v1_5 digital signature.88///89/// The WIN_CERTIFICATE_UEFI_PKCS1_15 structure is derived from90/// WIN_CERTIFICATE and encapsulate the information needed to91/// implement the RSASSA-PKCS1-v1_5 digital signature algorithm as92/// specified in RFC2437.93///94typedef struct {95///96/// This is the standard WIN_CERTIFICATE header, where97/// wCertificateType is set to WIN_CERT_TYPE_UEFI_PKCS1_15.98///99WIN_CERTIFICATE Hdr;100///101/// This is the hashing algorithm which was performed on the102/// UEFI executable when creating the digital signature.103///104EFI_GUID HashAlgorithm;105///106/// The following is the actual digital signature. The107/// size of the signature is the same size as the key108/// (1024-bit key is 128 bytes) and can be determined by109/// subtracting the length of the other parts of this header110/// from the total length of the certificate as found in111/// Hdr.dwLength.112///113/// UINT8 Signature[];114///115} WIN_CERTIFICATE_EFI_PKCS1_15;116117extern EFI_GUID gEfiCertTypeRsa2048Sha256Guid;118119#endif120121122