![]() |
m2mb API docs
30.00.007
m2mb API sets documentation
|
Secure Microservice Support. More...
Go to the source code of this file.
Macros | |
| #define | M2MB_SYSTEM_FILE_ID (-1) |
| #define | M2MB_SECURE_MS_READ 0x0000 |
| #define | M2MB_SECURE_MS_WRITE 0x0001 |
| #define | M2MB_SECURE_MS_CREATE 0x0002 |
| #define | M2MB_SECURE_MS_ADMIN 0x0004 |
| #define | M2MB_SECURE_MS_READ_ONLY 0x0008 |
| #define | M2MB_SECURE_MS_TRUSTED 0x0010 |
| #define | M2MB_SECURE_MS_ALLOW_COMPARE 0x0020 |
| #define | M2MB_SECURE_MS_NO_ENCRYPTION 0x0080 |
Typedefs | |
| typedef struct M2MB_SECURE_MS_HANDLE_S * | M2MB_SECURE_MS_HANDLE |
| Opaque Handle used for the Secure Microservice calls. | |
Functions | |
| M2MB_RESULT_E | m2mb_secure_ms_manage (M2MB_SECURE_MS_MANAGE_REQ_E request, M2MB_SECURE_MS_MANAGE_STATE_E *state) |
| A management function that handles Telit's and the Customer's default values. More... | |
| M2MB_RESULT_E | m2mb_secure_ms_remove_file (INT32 file_id) |
| Deletes the relevant secure data file. More... | |
| M2MB_RESULT_E | m2mb_secure_ms_open (M2MB_SECURE_MS_HANDLE *handle, INT32 file_id, UINT16 item_id, UINT16 flags) |
| Open the relevant secure data file. More... | |
| M2MB_RESULT_E | m2mb_secure_ms_read (M2MB_SECURE_MS_HANDLE handle, UINT32 max_len, UINT8 *data, UINT32 *act_len) |
| Read a Secured Data item. More... | |
| M2MB_RESULT_E | m2mb_secure_ms_write (M2MB_SECURE_MS_HANDLE handle, UINT8 *data, UINT32 len) |
| Writes a Secured Data item. More... | |
| M2MB_RESULT_E | m2mb_secure_ms_compare (M2MB_SECURE_MS_HANDLE handle, UINT8 *data, UINT32 len) |
| Compare the input Item to the Secured copy. More... | |
| M2MB_RESULT_E | m2mb_secure_ms_delete (M2MB_SECURE_MS_HANDLE handle) |
| Delete an Item from the Secured file. More... | |
| M2MB_RESULT_E | m2mb_secure_ms_close (M2MB_SECURE_MS_HANDLE handle) |
| Close the opened secure data file. More... | |
| M2MB_SECURE_MS_ERRNO_E | m2mb_secure_ms_errno (M2MB_SECURE_MS_HANDLE handle) |
| Return the last error obtained calling Secure MS functions. More... | |
| M2MB_RESULT_E | m2mb_secure_ms_init (void) |
| Module initialization. More... | |
Secure Microservice Support.
m2m/m2m_common/m2mb_inc/m2mb_secure_ms.h
APIs for all the secure data.
| #define M2MB_SECURE_MS_ADMIN 0x0004 |
When with the CREATE flag then the new item can be access only with the ADMIN flag
| #define M2MB_SECURE_MS_ALLOW_COMPARE 0x0020 |
The new item can be used by the m2mb_secure_ms_compare function (has to come with the CREATE flag)
| #define M2MB_SECURE_MS_CREATE 0x0002 |
For writing a new item
| #define M2MB_SECURE_MS_NO_ENCRYPTION 0x0080 |
The new item doesn't need to be encrypted (has to come with the CREATE flag)
| #define M2MB_SECURE_MS_READ 0x0000 |
In all modes items can be read
| #define M2MB_SECURE_MS_READ_ONLY 0x0008 |
The new item is READ ONLY (has to come with the CREATE flag). A READ_ONLY item can't be deleted
| #define M2MB_SECURE_MS_TRUSTED 0x0010 |
The new item is a trusted item (e.g. PrK, PsK) This data cannot be read using m2mb_secure_read Has to come with the CREATE flag
| #define M2MB_SECURE_MS_WRITE 0x0001 |
For writing on existing item
| #define M2MB_SYSTEM_FILE_ID (-1) |
file_id to be used when accessing the system file.
Enumeration representing all supported: value different got. has line code meaning: provide number to analyze.
Management request option.
| M2MB_RESULT_E m2mb_secure_ms_close | ( | M2MB_SECURE_MS_HANDLE | handle | ) |
Close the opened secure data file.
This function deletes the secure data file handle.
| [in] | handle | Secure data file handle |
Example
| M2MB_RESULT_E m2mb_secure_ms_compare | ( | M2MB_SECURE_MS_HANDLE | handle, |
| UINT8 * | data, | ||
| UINT32 | len | ||
| ) |
Compare the input Item to the Secured copy.
This function checks if the input data is equal to the Secure Data. Only items that were created using the M2MB_SECURE_MS_ALLOW_COMPARE flag can be compared. Typically this item will also be created with the M2MB_SECURE_MS_TRUSTED flag.
| [in] | handle | Secure data file handle |
| [in] | data | Data (item) to compare. |
| [out] | len | The number of bytes in data. |
Example
| M2MB_RESULT_E m2mb_secure_ms_delete | ( | M2MB_SECURE_MS_HANDLE | handle | ) |
Delete an Item from the Secured file.
This function deletes a specific item from the Secure Data. The item should have been open as M2MB_SECURE_MS_WRITE with M2MB_SECURE_MS_ADMIN as an option flag. A READ_ONLY file cannot be deleted.
| [in] | handle | Secure data file handle |
Example
| M2MB_SECURE_MS_ERRNO_E m2mb_secure_ms_errno | ( | M2MB_SECURE_MS_HANDLE | handle | ) |
Return the last error obtained calling Secure MS functions.
This function return last specific error number.
| [in] | handle | Secure data file handle |
Example
| M2MB_RESULT_E m2mb_secure_ms_init | ( | void | ) |
Module initialization.
This function initializes the module.
Example
| M2MB_RESULT_E m2mb_secure_ms_manage | ( | M2MB_SECURE_MS_MANAGE_REQ_E | request, |
| M2MB_SECURE_MS_MANAGE_STATE_E * | state | ||
| ) |
A management function that handles Telit's and the Customer's default values.
There are 3 System Files:
The effect of the request parameter is on the identity of the system file (M2MB_SYSTEM_FILE_ID) as following:
M2MB_SECURE_MS_LOCK_TSD
From now on, no data can be added to the TSD.
This causes the following State change:
M2MB_SYSTEM_FILE_ID --> CSD.
M2MB_SECURE_MS_TSD_ACTIVE --> M2MB_SECURE_MS_CSD_ACTIVE.
M2MB_SECURE_MS_TELIT_FACTORY_RESET
This will remove both the OSD and the CSD files.
Note that the USD files are not deleted.
This causes the following State change:
M2MB_SYSTEM_FILE_ID --> TSD.
M2MB_SECURE_MS_CSD_ACTIVE/M2MB_SECURE_MS_OSD_ACTIVE --> M2MB_SECURE_MS_TSD_ACTIVE.
M2MB_SECURE_MS_LOCK_CSD
From now on, no data can be added to the CSD.
This causes the following State change:
M2MB_SYSTEM_FILE_ID --> OSD.
M2MB_SECURE_MS_CSD_ACTIVE --> M2MB_SECURE_MS_OSD_ACTIVE.
M2MB_SECURE_MS_CUSTOMER_FACTORY_RESET
This will remove the OSD file.
Note that the USD files are not deleted.
This causes the following State change:
M2MB_SYSTEM_FILE_ID --> OSD.
M2MB_SECURE_MS_OSD_ACTIVE --> M2MB_SECURE_MS_CSD_ACTIVE.
| [in] | request | M2MB_SECURE_MS_MANAGE_REQ_E |
| [out] | state | M2MB_SECURE_MS_MANAGE_REQ_E |
Example
| M2MB_RESULT_E m2mb_secure_ms_open | ( | M2MB_SECURE_MS_HANDLE * | handle, |
| INT32 | file_id, | ||
| UINT16 | item_id, | ||
| UINT16 | flags | ||
| ) |
Open the relevant secure data file.
This function creates a Handle and associates it with the relevant item in the relevant file. If file_id == M2MB_SYSTEM_FILE_ID then The item_id will be searched for in the system files in the following order: OSD, CSD, TSD.
| [out] | handle | Pointer to a Handle |
| [in] | file_id | M2MB_SYSTEM_FILE_ID System Data 0..11 eUICC Profile ID |
| [in] | item_id | The ID of the item. |
| [in] | flags | A combination of the following: M2MB_SECURE_MS_READ M2MB_SECURE_MS_WRITE M2MB_SECURE_MS_ADMIN M2MB_SECURE_MS_CREATE The following flags are used only with M2MB_SECURE_MS_CREATE M2MB_SECURE_MS_READ_ONLY M2MB_SECURE_MS_TRUSTED M2MB_SECURE_MS_NO_ENCRYPTION |
| M2MB_RESULT_E m2mb_secure_ms_read | ( | M2MB_SECURE_MS_HANDLE | handle, |
| UINT32 | max_len, | ||
| UINT8 * | data, | ||
| UINT32 * | act_len | ||
| ) |
Read a Secured Data item.
This function enables reading an item from the Secure Data. Partial read is not supported - always have to read all the data.
| [in] | handle | Secure data file handle |
| [in] | max_len | The number of the maximum bytes to read. This should be a product of 16 and big enough to contain all the item's data. |
| [out] | data | Returned data. |
| [out] | act_len | The actual number of bytes returned. |
Example
| M2MB_RESULT_E m2mb_secure_ms_remove_file | ( | INT32 | file_id | ) |
Deletes the relevant secure data file.
This function deletes a secure data file.
| [in] | file_id | 0..11 eUICC Profile ID |
Example
| M2MB_RESULT_E m2mb_secure_ms_write | ( | M2MB_SECURE_MS_HANDLE | handle, |
| UINT8 * | data, | ||
| UINT32 | len | ||
| ) |
Writes a Secured Data item.
This function enables writing an item to the Secure Data.
| [in] | handle | Secure data file handle |
| [in] | data | Data (item) to set. |
| [out] | len | The number of bytes in data. |
Example