|
hsw-nbt 1.2.0
OPTIGA Authenticate NBT Host Library for C
|
Collection of the NBT personalization commands. More...
Go to the source code of this file.
Macros | |
| #define | NBT_FINALIZE_PERSONALIZATION UINT8_C(0x01) |
| Identifier for command finalize personalization. | |
| #define | NBT_PERSONALIZE_DATA UINT8_C(0x02) |
| Identifier for command personalize data. | |
| #define | NBT_BACKEND_TEST UINT8_C(0x03) |
| Identifier for command to perform backend test. | |
| #define | NBT_BACKEND_TEST_DISABLE UINT8_C(0x04) |
| Identifier for command to disable backend test. | |
Enumerations | |
| enum | nbt_personalize_data_dgi { NBT_DGI_A001 = UINT16_C(0xA001) , NBT_DGI_A002 = UINT16_C(0xA002) , NBT_DGI_A003 = UINT16_C(0xA003) , NBT_DGI_E104 = UINT16_C(0xE104) , NBT_DGI_E1A1 = UINT16_C(0xE1A1) , NBT_DGI_E1A2 = UINT16_C(0xE1A2) , NBT_DGI_E1A3 = UINT16_C(0xE1A3) , NBT_DGI_E1A4 = UINT16_C(0xE1A4) , NBT_DGI_E1AF = UINT16_C(0xE1AF) , NBT_DGI_BF63 = UINT16_C(0xBF63) } |
| Enumeration stores data group identifier (DGI) for personalize data command. More... | |
| enum | nbt_backend_test_request { NBT_BACKEND_TEST_RANDOM_NUM_GENERATION = (1 << 0) , NBT_BACKEND_TEST_ECDSA_SIGN = (1 << 1) , NBT_BACKEND_TEST_PUBLIC_KEY_EXTRACTION_FROM_CERT = (1 << 2) , NBT_BACKEND_TEST_ECDSA_VERIFY = (1 << 3) , NBT_BACKEND_TEST_UID_EXTRACTION_FROM_CERT = (1 << 4) , NBT_BACKEND_TEST_UID_COMPARISON = (1 << 5) , NBT_BACKEND_TEST_COTT_COMPUTATION = (1 << 6) , NBT_BACKEND_TEST_ALL = 0x7F } |
| Enumeration holds the bitmaps to perform backend tests. More... | |
Functions | |
| ifx_status_t | nbt_finalize_personalization (nbt_cmd_t *self) |
| Issues finalize personalization command. Personalization is considered completed after successful execution of finalize personalization. On successful processing of this command, the applet transitions from the 'personalization' state to the 'operational state'. Refer the PERSONALIZE_DATA command section in the datasheet to know the possible DGI and the data fields to be used. | |
| ifx_status_t | nbt_personalize_data (nbt_cmd_t *self, uint16_t dgi, const ifx_blob_t *dgi_data) |
| Issues personalize data command to personalize the data elements of the applet. Applet personalization consists of storing data in the applet as standard elementary files and personalizing proprietary key data objects using the personalize data command. | |
| ifx_status_t | nbt_backend_test (nbt_cmd_t *self, uint8_t test_request) |
| Issues backend test command to perform the requested backend tests. | |
| ifx_status_t | nbt_backend_test_disable (nbt_cmd_t *self) |
| Issues backend test command that permanently disables the backend test support in the chip. | |
Collection of the NBT personalization commands.
Definition in file nbt-cmd-perso.h.
| #define NBT_BACKEND_TEST UINT8_C(0x03) |
Identifier for command to perform backend test.
Definition at line 34 of file nbt-cmd-perso.h.
| #define NBT_BACKEND_TEST_DISABLE UINT8_C(0x04) |
Identifier for command to disable backend test.
Definition at line 39 of file nbt-cmd-perso.h.
| #define NBT_FINALIZE_PERSONALIZATION UINT8_C(0x01) |
Identifier for command finalize personalization.
Definition at line 24 of file nbt-cmd-perso.h.
| #define NBT_PERSONALIZE_DATA UINT8_C(0x02) |
Identifier for command personalize data.
Definition at line 29 of file nbt-cmd-perso.h.
Enumeration holds the bitmaps to perform backend tests.
Definition at line 81 of file nbt-cmd-perso.h.
Enumeration stores data group identifier (DGI) for personalize data command.
Definition at line 45 of file nbt-cmd-perso.h.
| ifx_status_t nbt_backend_test | ( | nbt_cmd_t * | self, |
| uint8_t | test_request ) |
Issues backend test command to perform the requested backend tests.
| [in,out] | self | Command set with communication protocol and response. |
| [in] | test_request | 8-bit field to request the backend tests to perform. |
| Bit 0 | Random number generation | | Bit 1 | ECDSA sign | | Bit 2 | Public key extraction from certificate | | Bit 3 | ECDSA verify | | Bit 4 | UID extraction from certificate | | Bit 5 | UID comparison | | Bit 6 | COTT computation | | Bit 7 | RFU (ignored) |
For example, to run ECDSA sign and ECDSA verify tests, set test_request variable to NBT_BACKEND_TEST_ECDSA_SIGN|NBT_BACKEND_TEST_ECDSA_VERIFY. Use bit map combinations from nbt_backend_test_request to request specific backend tests. 7F(OR combination of all 7 tests) is the value of the test_request_bitmap to request all tests to be performed and the expected returned test_result_bitmap is 7F, i.e. is all tests performed successfully.
C-APDU: 00 BE 00 7F (Enable all tests) Expected R-APDU: 90 00 7F (7F is returned test_result bitmap in response data if all tests are performed successfully
If the backend test command has been deactivated, response as (NBT_CLA/INS) does not exist is sent. This command is not needed on NFC interface, as the back end testing is performed via I2C.
| IFX_SUCCESS | : If API operation is successful |
| IFX_ILLEGAL_ARGUMENT | : If invalid/NULL parameter is passed to function |
| IFX_OUT_OF_MEMORY | : If any memory allocation fails |
| ifx_status_t nbt_backend_test_disable | ( | nbt_cmd_t * | self | ) |
Issues backend test command that permanently disables the backend test support in the chip.
| [in,out] | self | Command set with communication protocol and response. |
| IFX_SUCCESS | : If API operation is successful |
| IFX_ILLEGAL_ARGUMENT | : If invalid/NULL parameter is passed to function |
| IFX_OUT_OF_MEMORY | : If any memory allocation fails |
| ifx_status_t nbt_finalize_personalization | ( | nbt_cmd_t * | self | ) |
Issues finalize personalization command. Personalization is considered completed after successful execution of finalize personalization. On successful processing of this command, the applet transitions from the 'personalization' state to the 'operational state'. Refer the PERSONALIZE_DATA command section in the datasheet to know the possible DGI and the data fields to be used.
| [in,out] | self | Command set with communication protocol and response. |
| IFX_SUCCESS | : If API operation is successful |
| IFX_ILLEGAL_ARGUMENT | : If invalid/NULL parameter is passed to function |
| ifx_status_t nbt_personalize_data | ( | nbt_cmd_t * | self, |
| uint16_t | dgi, | ||
| const ifx_blob_t * | dgi_data ) |
Issues personalize data command to personalize the data elements of the applet. Applet personalization consists of storing data in the applet as standard elementary files and personalizing proprietary key data objects using the personalize data command.
| [in,out] | self | Command set with communication protocol and response. |
| [in] | dgi | Data group identifier (DGI) value |
| [in] | dgi_data | Pointer to the data field of the respective DGI. (Example: AES COTT Key, ECC Key, and NDEF file content) |
| IFX_SUCCESS | : If API operation is successful |
| IFX_ILLEGAL_ARGUMENT | : If invalid/NULL parameter is passed to function |