11.12.3.4.98. Function Se05x_API_I2CM_ExecuteCommandSet

11.12.3.4.98.1. Function Documentation

smStatus_t Se05x_API_I2CM_ExecuteCommandSet(pSe05xSession_t session_ctx, const uint8_t *inputData, size_t inputDataLen, uint32_t attestationID, uint8_t attestationAlgo, uint8_t *response, size_t *presponseLen, SE05x_TimeStamp_t *ptimeStamp, uint8_t *freshness, size_t *pfreshnessLen, uint8_t *chipId, size_t *pchipIdLen, uint8_t *signature, size_t *psignatureLen, uint8_t *randomAttst, size_t randomAttstLen)

Se05x_API_I2CM_ExecuteCommandSet

Execute one or multiple I2C commands in master mode. Execution is conditional to the presence of the authentication object identified by RESERVED_ID_I2CM_ACCESS. If the credential is not present in the eSE, access is allowed in general. Otherwise, a session shall be established before executing this command. In this case, the I2CM_ExecuteCommandSet command shall be sent within the mentioned session.

The I2C command set is constructed as a sequence of instructions described in with the following rules:

  • The length should be limited to MAX_I2CM_COMMAND_LENGTH.

  • The data to be read cannot exceed MAX_I2CM_COMMAND_LENGTH, including protocol overhead.

Command to Applet

Field

Value

Description

CLA

0x80

INS

INS_CRYPTO

See SE05x_INS_t, in addition to INS_CRYPTO, users can set the INS_ATTEST flag. In that case, attestation applies.

P1

P1_DEFAULT

See SE05x_P1_t

P2

P2_I2CM

See SE05x_P2_t

Lc

#(Payload)

TLV[TAG_1]

Byte array containing I2C Command set as TLV array.

TLV[TAG_2]

4-byte attestation object identifier. [Optional] [Conditional: only when INS_ATTEST is set]

TLV[TAG_3]

1-byte SE05x_AttestationAlgo_t [Optional] [Conditional: only when INS_ATTEST is set]

TLV[TAG_7]

16-byte freshness random [Optional] [Conditional: only when INS_ATTEST is set]

Le

0x00

Expecting TLV with return data.

R-APDU Body

Value

Description

TLV[TAG_1]

Read response, a bytestring containing a sequence of: * CONFIGURE (0x01), followed by 1 byte of return code (0x5A = SUCCESS). * WRITE (0x03), followed by 1 byte of return code * READ (0x04), followed by - Length: 2 bytes in big endian encoded without TLV length encoding - Read bytes * 0xFF followed by the error return code in case of a structural error of the incoming buffer (too long, for example)

TLV[TAG_3]

TLV containing 12-byte timestamp

TLV[TAG_4]

TLV containing 16-byte freshness (random)

TLV[TAG_5]

TLV containing 18-byte chip unique ID

TLV[TAG_6]

TLV containing signature over the concatenated values of TLV[TAG_1], TLV[TAG_3], TLV[TAG_4] and TLV[TAG_5].

R-APDU Trailer

SW

Description

SW_NO_ERROR

The command is handled successfully.

Return

The sm status.

Parameters
  • [in] session_ctx: The session context

  • [in] inputData: The input data

  • [in] inputDataLen: The input data length

  • [in] attestationID: The attestation id

  • [in] attestationAlgo: The attestation algorithm

  • response: The response

  • presponseLen: The presponse length

  • ptimeStamp: The ptime stamp

  • freshness: The freshness

  • pfreshnessLen: The pfreshness length

  • chipId: The chip identifier

  • pchipIdLen: The pchip identifier length

  • signature: The signature

  • psignatureLen: The psignature length

  • randomAttst: The random attst

  • [in] randomAttstLen: The random attst length