17#ifndef __SMART_CARD_EDGE_H__
18#define __SMART_CARD_EDGE_H__
20#define EFI_SMART_CARD_EDGE_PROTOCOL_GUID \
22 0xd317f29b, 0xa325, 0x4712, {0x9b, 0xf1, 0xc6, 0x19, 0x54, 0xdc, 0x19, 0x8c} \
30#define SCARD_AID_MAXSIZE 0x0010
34#define SCARD_CSN_SIZE 0x0010
38#define SMART_CARD_EDGE_PROTOCOL_VERSION_1 0x00000100
42typedef UINT8 SMART_CARD_AID[SCARD_AID_MAXSIZE];
43typedef UINT8 SMART_CARD_CSN[SCARD_CSN_SIZE];
50#define SC_EDGE_TAG_HEADER 0x0000
54#define SC_EDGE_TAG_CERT 0x0001
58#define SC_EDGE_TAG_KEY_ID 0x0002
62#define SC_EDGE_TAG_KEY_TYPE 0x0003
66#define SC_EDGE_TAG_KEY_SIZE 0x0004
74#define SC_EDGE_L_SIZE_HEADER 1
78#define SC_EDGE_L_SIZE_CERT 2
82#define SC_EDGE_L_SIZE_KEY_ID 1
86#define SC_EDGE_L_SIZE_KEY_TYPE 1
90#define SC_EDGE_L_SIZE_KEY_SIZE 2
97#define SC_EDGE_L_VALUE_HEADER 1
101#define SC_EDGE_L_VALUE_KEY_ID 1
105#define SC_EDGE_L_VALUE_KEY_TYPE 1
109#define SC_EDGE_L_VALUE_KEY_SIZE 2
117#define SC_EDGE_RSA_EXCHANGE 0x01
121#define SC_EDGE_RSA_SIGNATURE 0x02
125#define SC_EDGE_ECDSA_256 0x03
129#define SC_EDGE_ECDSA_384 0x04
133#define SC_EDGE_ECDSA_521 0x05
137#define SC_EDGE_ECDH_256 0x06
141#define SC_EDGE_ECDH_384 0x07
145#define SC_EDGE_ECDH_521 0x08
153#define EFI_PADDING_RSASSA_PKCS1V1P5_GUID \
155 0x9317ec24, 0x7cb0, 0x4d0e, {0x8b, 0x32, 0x2e, 0xd9, 0x20, 0x9c, 0xd8, 0xaf} \
158extern EFI_GUID gEfiPaddingRsassaPkcs1V1P5Guid;
163#define EFI_PADDING_RSASSA_PSS_GUID \
165 0x7b2349e0, 0x522d, 0x4f8e, {0xb9, 0x27, 0x69, 0xd9, 0x7c, 0x9e, 0x79, 0x5f} \
168extern EFI_GUID gEfiPaddingRsassaPssGuid;
176#define EFI_PADDING_NONE_GUID \
178 0x3629ddb1, 0x228c, 0x452e, {0xb6, 0x16, 0x09, 0xed, 0x31, 0x6a, 0x97, 0x00} \
186#define EFI_PADDING_RSAES_PKCS1V1P5_GUID \
188 0xe1c1d0a9, 0x40b1, 0x4632, {0xbd, 0xcc, 0xd9, 0xd6, 0xe5, 0x29, 0x56, 0x31} \
191extern EFI_GUID gEfiPaddingRsaesPkcs1V1P5Guid;
196#define EFI_PADDING_RSAES_OAEP_GUID \
198 0xc1e63ac4, 0xd0cf, 0x4ce6, {0x83, 0x5b, 0xee, 0xd0, 0xe6, 0xa8, 0xa4, 0x5b} \
201extern EFI_GUID gEfiPaddingRsaesOaepGuid;
338 OUT UINT8 Csn[SCARD_CSN_SIZE]
417 OUT BOOLEAN *PinResult,
446 OUT UINT32 *RemainingAttempts
598 IN UINT8 *HashedData,
599 OUT UINT8 *SignatureData
662 IN UINT8 *EncryptedData,
664 OUT UINT8 *PlaintextData
711 OUT UINT8 *DHAgreement
733extern EFI_GUID gEfiSmartCardEdgeProtocolGuid;
EFI_STATUS(EFIAPI * EFI_SMART_CARD_EDGE_GET_READER_NAME)(IN EFI_SMART_CARD_EDGE_PROTOCOL *This, IN EFI_HANDLE SCardHandle, IN OUT UINTN *ReaderNameLength, OUT CHAR16 *ReaderName OPTIONAL)
EFI_STATUS(EFIAPI * EFI_SMART_CARD_EDGE_GET_CONTEXT)(IN EFI_SMART_CARD_EDGE_PROTOCOL *This, OUT UINTN *NumberAidSupported, IN OUT UINTN *AidTableSize OPTIONAL, OUT SMART_CARD_AID *AidTable OPTIONAL, OUT UINTN *NumberSCPresent, IN OUT UINTN *CsnTableSize OPTIONAL, OUT SMART_CARD_CSN *CsnTable OPTIONAL, OUT UINT32 *VersionScEdgeProtocol OPTIONAL)
EFI_STATUS(EFIAPI * EFI_SMART_CARD_EDGE_VERIFY_PIN)(IN EFI_SMART_CARD_EDGE_PROTOCOL *This, IN EFI_HANDLE SCardHandle, IN INT32 PinSize, IN UINT8 *PinCode, OUT BOOLEAN *PinResult, OUT UINT32 *RemainingAttempts OPTIONAL)
EFI_STATUS(EFIAPI * EFI_SMART_CARD_EDGE_GET_CSN)(IN EFI_SMART_CARD_EDGE_PROTOCOL *This, IN EFI_HANDLE SCardHandle, OUT UINT8 Csn[SCARD_CSN_SIZE])
EFI_STATUS(EFIAPI * EFI_SMART_CARD_EDGE_GET_PIN_REMAINING)(IN EFI_SMART_CARD_EDGE_PROTOCOL *This, IN EFI_HANDLE SCardHandle, OUT UINT32 *RemainingAttempts)
EFI_STATUS(EFIAPI * EFI_SMART_CARD_EDGE_SIGN_DATA)(IN EFI_SMART_CARD_EDGE_PROTOCOL *This, IN EFI_HANDLE SCardHandle, IN UINTN KeyId, IN UINTN KeyType, IN EFI_GUID *HashAlgorithm, IN EFI_GUID *PaddingMethod, IN UINT8 *HashedData, OUT UINT8 *SignatureData)
EFI_STATUS(EFIAPI * EFI_SMART_CARD_EDGE_DISCONNECT)(IN EFI_SMART_CARD_EDGE_PROTOCOL *This, IN EFI_HANDLE SCardHandle)
EFI_STATUS(EFIAPI * EFI_SMART_CARD_EDGE_GET_CREDENTIAL)(IN EFI_SMART_CARD_EDGE_PROTOCOL *This, IN EFI_HANDLE SCardHandle, IN OUT UINTN *CredentialSize, OUT UINT8 *CredentialList OPTIONAL)
EFI_STATUS(EFIAPI * EFI_SMART_CARD_EDGE_BUILD_DH_AGREEMENT)(IN EFI_SMART_CARD_EDGE_PROTOCOL *This, IN EFI_HANDLE SCardHandle, IN UINTN KeyId, IN UINT8 *dataQx, IN UINT8 *dataQy, OUT UINT8 *DHAgreement)
EFI_STATUS(EFIAPI * EFI_SMART_CARD_EDGE_GET_DATA)(IN EFI_SMART_CARD_EDGE_PROTOCOL *This, IN EFI_HANDLE SCardHandle, IN EFI_GUID *DataId, IN OUT UINTN *DataSize, OUT VOID *Data OPTIONAL)
EFI_STATUS(EFIAPI * EFI_SMART_CARD_EDGE_CONNECT)(IN EFI_SMART_CARD_EDGE_PROTOCOL *This, OUT EFI_HANDLE *SCardHandle, IN UINT8 *ScardCsn OPTIONAL, OUT UINT8 *ScardAid OPTIONAL)
EFI_STATUS(EFIAPI * EFI_SMART_CARD_EDGE_DECRYPT_DATA)(IN EFI_SMART_CARD_EDGE_PROTOCOL *This, IN EFI_HANDLE SCardHandle, IN UINTN KeyId, IN EFI_GUID *HashAlgorithm, IN EFI_GUID *PaddingMethod, IN UINTN EncryptedSize, IN UINT8 *EncryptedData, IN OUT UINTN *PlaintextSize, OUT UINT8 *PlaintextData)