11.12.3.4.134. Function Se05x_API_WritePCR

11.12.3.4.134.1. Function Documentation

smStatus_t Se05x_API_WritePCR(pSe05xSession_t session_ctx, pSe05xPolicy_t policy, uint32_t pcrID, const uint8_t *initialValue, size_t initialValueLen, const uint8_t *inputData, size_t inputDataLen)

Se05x_API_WritePCR

Creates or writes to a PCR object.

A PCR is a hash to which data can be appended; i.e., writing data to a PCR will update the value of the PCR to be the hash of all previously inserted data concatenated with the new input data.

A PCR will always use DigestMode = DIGEST_SHA256; no other configuration possible.

If TAG_2 and TAG_3 is not passed, the PCR is reset to its initial value (i.e., the value set when the PCR was created).

This reset is controlled under the POLICY_OBJ_ALLOW_DELETE policy, so users that can delete the PCR can also reset the PCR to initial value.

Command to Applet

Field

Value

Description

P1

P1_PCR

See SE05x_P1_t

P2

P2_DEFAULT

See SE05x_P2_t

Payload

TLV[TAG_POLICY]

Byte array containing the object policy. [Optional: default policy applies] [Conditional: only when the object identifier is not in use yet]

TLV[TAG_1]

4-byte PCR identifier.

TLV[TAG_2]

Initial hash value [Conditional: only when the object identifier is not in use yet]

TLV[TAG_3]

Data to be extended to the existing PCR. [Conditional: only when the object identifier is already in use] [Optional: not present if a Reset is requested]

R-APDU Body

NA

R-APDU Trailer

Parameters
  • [in] session_ctx: Session Context [0:kSE05x_pSession]

  • [in] policy: policy [1:kSE05x_TAG_POLICY]

  • [in] pcrID: object id [2:kSE05x_TAG_1]

  • [in] initialValue: initialValue [3:kSE05x_TAG_2]

  • [in] initialValueLen: Length of initialValue

  • [in] inputData: inputData [4:kSE05x_TAG_3]

  • [in] inputDataLen: Length of inputData