7 #ifndef __TEE_INTERNAL_SE_H__ 8 #define __TEE_INTERNAL_SE_H__ 10 #include <tee_internal_api.h> 20 #define TEE_SE_API_1_1 (0x01010000) 25 enum tee_secure_element_function_id {
26 ID_TEE_SE_Service_Open = 0x0101,
27 ID_TEE_SE_Service_Close = 0x0102,
28 ID_TEE_SE_Service_Get_Readers = 0x0103,
29 ID_TEE_SE_Reader_Get_Properties = 0x0201,
30 ID_TEE_SE_Reader_Get_Name = 0x0202,
31 ID_TEE_SE_Reader_Open_Session = 0x0203,
32 ID_TEE_SE_Reader_Close_Sessions = 0x0204,
33 ID_TEE_SE_Session_Get_ATR = 0x0301,
34 ID_TEE_SE_Session_Is_Closed = 0x0302,
35 ID_TEE_SE_Session_Close = 0x0303,
36 ID_TEE_SE_Session_Close_Channels = 0x0304,
37 ID_TEE_SE_Session_Open_Basic_Channel = 0x0305,
38 ID_TEE_SE_Session_Open_Logical_Channel = 0x0306,
39 ID_TEE_SE_Channel_Close = 0x0401,
40 ID_TEE_SE_Channel_Select_Next = 0x0402,
41 ID_TEE_SE_Channel_Get_Select_Response = 0x0403,
42 ID_TEE_SE_Channel_Transmit = 0x0404,
43 ID_TEE_SE_Channel_Get_Response_Length = 0x0405,
44 ID_TEE_SE_Secure_Channel_Open = 0x0601,
45 ID_TEE_SE_Secure_Channel_Get_Security_Level = 0x0602,
46 ID_TEE_SE_Secure_Channel_Close = 0x0603
51 typedef struct __TEE_SEServiceHandle *TEE_SEServiceHandle;
52 typedef struct __TEE_SEReaderHandle *TEE_SEReaderHandle;
53 typedef struct __TEE_SESessionHandle *TEE_SESessionHandle;
54 typedef struct __TEE_SEChannelHandle *TEE_SEChannelHandle;
99 DSO_EXPORT TEE_Result TEE_SEServiceOpen(TEE_SEServiceHandle *seServiceHandle);
119 DSO_EXPORT
void TEE_SEServiceClose(TEE_SEServiceHandle seServiceHandle);
149 DSO_EXPORT TEE_Result
150 TEE_SEServiceGetReaders(TEE_SEServiceHandle seServiceHandle,
151 TEE_SEReaderHandle *seReaderHandleList,
152 uint32_t *seReaderHandleListLen);
194 TEE_SEReaderGetProperties(TEE_SEReaderHandle seReaderHandle,
225 DSO_EXPORT TEE_Result TEE_SEReaderGetName(TEE_SEReaderHandle seReaderHandle,
227 uint32_t *readerNameLen);
261 DSO_EXPORT TEE_Result
262 TEE_SEReaderOpenSession(TEE_SEReaderHandle seReaderHandle,
263 TEE_SESessionHandle *seSessionHandle);
280 TEE_SEReaderCloseSessions(TEE_SEReaderHandle seReaderHandle);
323 DSO_EXPORT TEE_Result TEE_SESessionGetATR(TEE_SESessionHandle seSessionHandle,
346 DSO_EXPORT TEE_Result
347 TEE_SESessionIsClosed(TEE_SESessionHandle seSessionHandle);
362 DSO_EXPORT
void TEE_SESessionClose(TEE_SESessionHandle seSessionHandle);
378 TEE_SESessionCloseChannels(TEE_SESessionHandle seSessionHandle);
419 DSO_EXPORT TEE_Result
420 TEE_SESessionOpenBasicChannel(TEE_SESessionHandle seSessionHandle,
422 TEE_SEChannelHandle *seChannelHandle);
464 DSO_EXPORT TEE_Result
465 TEE_SESessionOpenLogicalChannel(TEE_SESessionHandle seSessionHandle,
467 TEE_SEChannelHandle *seChannelHandle);
492 DSO_EXPORT
void TEE_SEChannelClose(TEE_SEChannelHandle seChannelHandle);
543 DSO_EXPORT TEE_Result
544 TEE_SEChannelSelectNext(TEE_SEChannelHandle seChannelHandle);
576 DSO_EXPORT TEE_Result
577 TEE_SEChannelGetSelectResponse(TEE_SEChannelHandle seChannelHandle,
578 void *response, uint32_t *responseLen);
633 DSO_EXPORT TEE_Result
634 TEE_SEChannelTransmit(TEE_SEChannelHandle seChannelHandle,
638 uint32_t *responseLen);
672 DSO_EXPORT TEE_Result
673 TEE_SEChannelGetResponseLength(TEE_SEChannelHandle seChannelHandle,
674 uint32_t *responseLen);
683 TEE_SC_TYPE_SCP02 = 0x00,
684 TEE_SC_TYPE_SCP03 = 0x01,
685 TEE_SC_TYPE_SCP11a = 0x02,
686 TEE_SC_TYPE_SCP11b = 0x03,
690 } TEES_SC_SecureChannelType;
703 TEE_SC_NO_SECURE_MESSAGING = 0x00,
704 TEE_AUTHENTICATE = 0x80,
714 TEE_SC_CR_MAC = 0x11,
716 TEE_SC_C_ENC_MAC = 0x03,
718 TEE_SC_R_ENC_MAC = 0x30,
720 TEE_SC_CR_ENC_MAC = 0x33,
722 } TEE_SC_SecurityLevel;
750 TEE_ObjectHandle scBaseKeyHandle;
820 DSO_EXPORT TEE_Result
821 TEE_SESecureChannelOpen(TEE_SEChannelHandle seChannelHandle,
844 TEE_SESecureChannelGetSecurityLevel(TEE_SEChannelHandle seChannelHandle);
863 DSO_EXPORT
void TEE_SESecureChannelClose(TEE_SEChannelHandle seChannelHandle);
Definition: tee_internal_se_api.h:726
TEE_SC_OID scOID
Definition: tee_internal_se_api.h:761
bool teeOnly
Definition: tee_internal_se_api.h:168
TEE_ObjectHandle scKeyMacHandle
Definition: tee_internal_se_api.h:742
uint8_t scType
Definition: tee_internal_se_api.h:760
TEE_SC_SecurityLevel scSecurityLevel
Definition: tee_internal_se_api.h:762
uint8_t * buffer
Definition: tee_internal_se_api.h:695
uint8_t scKeyID
Definition: tee_internal_se_api.h:727
bool selectResponseEnable
Definition: tee_internal_se_api.h:169
TEE_SC_KeyType scKeyType
Definition: tee_internal_se_api.h:748
uint8_t scKeyVersion
Definition: tee_internal_se_api.h:728
TEE_SC_CardKeyRef scCardKeyRef
Definition: tee_internal_se_api.h:763
Definition: tee_internal_se_api.h:747
bool sePresent
Definition: tee_internal_se_api.h:167
Definition: tee_internal_se_api.h:293
Definition: tee_internal_se_api.h:759
Definition: tee_internal_se_api.h:739
Definition: tee_internal_se_api.h:166
TEE_SC_DeviceKeyRef scDeviceKeyRef
Definition: tee_internal_se_api.h:764
uint32_t bufferLen
Definition: tee_internal_se_api.h:295
Definition: tee_internal_se_api.h:694
uint8_t * buffer
Definition: tee_internal_se_api.h:294
uint32_t bufferLen
Definition: tee_internal_se_api.h:696
TEE_ObjectHandle scKeyEncHandle
Definition: tee_internal_se_api.h:740