iPXE
WinCertificate.h
Go to the documentation of this file.
1 /** @file
2  GUID for UEFI WIN_CERTIFICATE structure.
3 
4  Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>
5  SPDX-License-Identifier: BSD-2-Clause-Patent
6 
7  @par Revision Reference:
8  GUID defined in UEFI 2.0 spec.
9 **/
10 
11 #ifndef __EFI_WIN_CERTIFICATE_H__
12 #define __EFI_WIN_CERTIFICATE_H__
13 
14 FILE_LICENCE ( BSD2_PATENT );
15 FILE_SECBOOT ( PERMITTED );
16 
17 //
18 // _WIN_CERTIFICATE.wCertificateType
19 //
20 #define WIN_CERT_TYPE_PKCS_SIGNED_DATA 0x0002
21 #define WIN_CERT_TYPE_EFI_PKCS115 0x0EF0
22 #define WIN_CERT_TYPE_EFI_GUID 0x0EF1
23 
24 ///
25 /// The WIN_CERTIFICATE structure is part of the PE/COFF specification.
26 ///
27 typedef struct {
28  ///
29  /// The length of the entire certificate,
30  /// including the length of the header, in bytes.
31  ///
33  ///
34  /// The revision level of the WIN_CERTIFICATE
35  /// structure. The current revision level is 0x0200.
36  ///
38  ///
39  /// The certificate type. See WIN_CERT_TYPE_xxx for the UEFI
40  /// certificate types. The UEFI specification reserves the range of
41  /// certificate type values from 0x0EF0 to 0x0EFF.
42  ///
44  ///
45  /// The following is the actual certificate. The format of
46  /// the certificate depends on wCertificateType.
47  ///
48  /// UINT8 bCertificate[ANYSIZE_ARRAY];
49  ///
51 
52 ///
53 /// WIN_CERTIFICATE_UEFI_GUID.CertType
54 ///
55 #define EFI_CERT_TYPE_RSA2048_SHA256_GUID \
56  {0xa7717414, 0xc616, 0x4977, {0x94, 0x20, 0x84, 0x47, 0x12, 0xa7, 0x35, 0xbf } }
57 
58 ///
59 /// WIN_CERTIFICATE_UEFI_GUID.CertData
60 ///
61 typedef struct {
63  UINT8 PublicKey[256];
66 
67 ///
68 /// Certificate which encapsulates a GUID-specific digital signature
69 ///
70 typedef struct {
71  ///
72  /// This is the standard WIN_CERTIFICATE header, where
73  /// wCertificateType is set to WIN_CERT_TYPE_EFI_GUID.
74  ///
76  ///
77  /// This is the unique id which determines the
78  /// format of the CertData. .
79  ///
81  ///
82  /// The following is the certificate data. The format of
83  /// the data is determined by the CertType.
84  /// If CertType is EFI_CERT_TYPE_RSA2048_SHA256_GUID,
85  /// the CertData will be EFI_CERT_BLOCK_RSA_2048_SHA256 structure.
86  ///
87  UINT8 CertData[1];
89 
90 ///
91 /// Certificate which encapsulates the RSASSA_PKCS1-v1_5 digital signature.
92 ///
93 /// The WIN_CERTIFICATE_UEFI_PKCS1_15 structure is derived from
94 /// WIN_CERTIFICATE and encapsulate the information needed to
95 /// implement the RSASSA-PKCS1-v1_5 digital signature algorithm as
96 /// specified in RFC2437.
97 ///
98 typedef struct {
99  ///
100  /// This is the standard WIN_CERTIFICATE header, where
101  /// wCertificateType is set to WIN_CERT_TYPE_UEFI_PKCS1_15.
102  ///
104  ///
105  /// This is the hashing algorithm which was performed on the
106  /// UEFI executable when creating the digital signature.
107  ///
109  ///
110  /// The following is the actual digital signature. The
111  /// size of the signature is the same size as the key
112  /// (1024-bit key is 128 bytes) and can be determined by
113  /// subtracting the length of the other parts of this header
114  /// from the total length of the certificate as found in
115  /// Hdr.dwLength.
116  ///
117  /// UINT8 Signature[];
118  ///
120 
122 
123 #endif
128 bit buffer containing a unique identifier value.
Definition: Base.h:216
unsigned int UINT32
Definition: ProcessorBind.h:99
Certificate which encapsulates a GUID-specific digital signature.
unsigned char UINT8
FILE_SECBOOT(PERMITTED)
EFI_GUID HashAlgorithm
This is the hashing algorithm which was performed on the UEFI executable when creating the digital si...
EFI_GUID CertType
This is the unique id which determines the format of the CertData.
EFI_GUID gEfiCertTypeRsa2048Sha256Guid
WIN_CERTIFICATE_UEFI_GUID.CertData.
UINT32 dwLength
The length of the entire certificate, including the length of the header, in bytes.
unsigned short UINT16
UINT8_t Signature[6]
Signature.
Definition: pxe_api.h:61
WIN_CERTIFICATE Hdr
This is the standard WIN_CERTIFICATE header, where wCertificateType is set to WIN_CERT_TYPE_UEFI_PKCS...
UINT16 wCertificateType
The certificate type.
Certificate which encapsulates the RSASSA_PKCS1-v1_5 digital signature.
UINT16 wRevision
The revision level of the WIN_CERTIFICATE structure.
WIN_CERTIFICATE Hdr
This is the standard WIN_CERTIFICATE header, where wCertificateType is set to WIN_CERT_TYPE_EFI_GUID.
The WIN_CERTIFICATE structure is part of the PE/COFF specification.
FILE_LICENCE(BSD2_PATENT)