ID Chip Reader
|
Secure messaging implementation for communication with a smart card. More...
Go to the source code of this file.
Macros | |
#define | ACCESS_SECURE_MESSAGE_H_ |
Functions | |
int | ProtectedSelectAPDU (unsigned char cmdData[2], unsigned char *sendSequenceCounter, unsigned char encryptSessionKey[16], unsigned char macSessionKey[16]) |
Sends a protected SELECT APDU command to the smart card. More... | |
int | ProtectedReadBinaryAPDU (unsigned char cmdHeader[4], unsigned char resLen, unsigned char *responseBuf, unsigned char *sendSequenceCounter, unsigned char encryptSessionKey[16], unsigned char macSessionKey[16]) |
Sends a protected READ BINARY APDU command to the smart card. More... | |
Secure messaging implementation for communication with a smart card.
This file provides the interface for secure messaging between an application and a smart card. It implements protected APDU commands for SELECT and READ BINARY operations, using encryption and MAC calculation to ensure confidentiality and integrity of the communication.
#define ACCESS_SECURE_MESSAGE_H_ |
int ProtectedReadBinaryAPDU | ( | unsigned char | cmdHeader[4], |
unsigned char | resLen, | ||
unsigned char * | responseBuf, | ||
unsigned char * | sendSequenceCounter, | ||
unsigned char | encryptSessionKey[16], | ||
unsigned char | macSessionKey[16] | ||
) |
Sends a protected READ BINARY APDU command to the smart card.
This function sends a protected READ BINARY APDU command to the smart card using encryption and MAC calculation to ensure confidentiality and integrity of the communication. The response data will be decrypted and stored in the provided buffer.
cmdHeader | Pointer to a 4-byte array representing the command header for the READ BINARY operation. |
resLen | Length of expected response data in bytes. |
responseBuf | Pointer to a buffer where the decrypted response data will be stored. |
sendSequenceCounter | Pointer to an 8-byte array representing the current Send Sequence Counter (SSC). |
encryptSessionKey | Pointer to a 16-byte array containing the encryption session key (KS_Enc). |
macSessionKey | Pointer to a 16-byte array containing the MAC session key (KS_MAC). |
int ProtectedSelectAPDU | ( | unsigned char | cmdData[2], |
unsigned char * | sendSequenceCounter, | ||
unsigned char | encryptSessionKey[16], | ||
unsigned char | macSessionKey[16] | ||
) |
Sends a protected SELECT APDU command to the smart card.
This function sends a protected SELECT APDU command to the smart card using encryption and MAC calculation to ensure confidentiality and integrity of the communication.
cmdData | File identifier (2 bytes) to be selected by this command. |
sendSequenceCounter | Pointer to an 8-byte array representing the current Send Sequence Counter (SSC). |
encryptSessionKey | Pointer to a 16-byte array containing the encryption session key (KS_Enc). |
macSessionKey | Pointer to a 16-byte array containing the MAC session key (KS_MAC). |