Embedded SDK
Embedded SDK
Loading...
Searching...
No Matches
identity.h File Reference

Register / Edit Contact Name / Edit Scope / Edit Identifier. More...

#include "os_types.h"
#include "address_book.h"
#include "bip32.h"
Include dependency graph for identity.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  identity_t
 Data extracted from a Register Identity TLV payload. More...
struct  edit_identifier_t
 Data extracted from an Edit Identifier TLV payload. More...
struct  edit_contact_name_t
 Data extracted from an Edit Contact Name TLV payload. More...
struct  edit_scope_t
 Data extracted from an Edit Scope Name TLV payload. More...

Macros

#define TYPE_REGISTER_IDENTITY   0x2d
#define TYPE_EDIT_CONTACT_NAME   0x2e
#define TYPE_EDIT_IDENTIFIER   0x31
#define TYPE_EDIT_SCOPE   0x32
#define TYPE_PROVIDE_CONTACT   0x33
#define GID_SIZE   32
 32-byte random group ID generated by the device
#define GROUP_HANDLE_SIZE   64
 group_handle = gid(32) | MAC(K_group, gid)(32)
#define CONTACT_NAME_LENGTH   33
 max 32 printable chars + null terminator
#define SCOPE_LENGTH   33
 max 32 printable chars + null terminator
#define IDENTIFIER_MAX_LENGTH   80
 blockchain address or public key, raw bytes

Functions

bolos_err_t register_identity (uint8_t *buffer_in, size_t buffer_in_length)
 Register a new identity.
bolos_err_t edit_contact_name (uint8_t *buffer_in, size_t buffer_in_length)
 Edit the CONTACT_NAME of an existing Identity contact.
bolos_err_t edit_identifier (uint8_t *buffer_in, size_t buffer_in_length)
 Edit the IDENTIFIER of an existing Identity contact.
bolos_err_t edit_scope (uint8_t *buffer_in, size_t buffer_in_length)
 Edit the SCOPE of an existing Identity contact.
bolos_err_t provide_contact (uint8_t *buffer_in, size_t buffer_in_length)
 Deliver a verified contact to the coin application.

Detailed Description

Register / Edit Contact Name / Edit Scope / Edit Identifier.

An Identity is a contact identified by a name, an IDENTIFIER (blockchain address or public key, up to 80 bytes), and an optional SCOPE (context string, e.g. "Ethereum"). HMAC keys are derived from a hardcoded BIP32 path (g_identity_bip32_path); the TAG_DERIVATION_PATH TLV field is accepted for backward compatibility but ignored.

Active under HAVE_ADDRESS_BOOK (no sub-flag required).

Definition in file identity.h.

Macro Definition Documentation

◆ CONTACT_NAME_LENGTH

#define CONTACT_NAME_LENGTH   33

max 32 printable chars + null terminator

Definition at line 50 of file identity.h.

◆ GID_SIZE

#define GID_SIZE   32

32-byte random group ID generated by the device

Definition at line 47 of file identity.h.

◆ GROUP_HANDLE_SIZE

#define GROUP_HANDLE_SIZE   64

group_handle = gid(32) | MAC(K_group, gid)(32)

Definition at line 48 of file identity.h.

◆ IDENTIFIER_MAX_LENGTH

#define IDENTIFIER_MAX_LENGTH   80

blockchain address or public key, raw bytes

Definition at line 52 of file identity.h.

◆ SCOPE_LENGTH

#define SCOPE_LENGTH   33

max 32 printable chars + null terminator

Definition at line 51 of file identity.h.

◆ TYPE_EDIT_CONTACT_NAME

#define TYPE_EDIT_CONTACT_NAME   0x2e

Definition at line 41 of file identity.h.

◆ TYPE_EDIT_IDENTIFIER

#define TYPE_EDIT_IDENTIFIER   0x31

Definition at line 42 of file identity.h.

◆ TYPE_EDIT_SCOPE

#define TYPE_EDIT_SCOPE   0x32

Definition at line 43 of file identity.h.

◆ TYPE_PROVIDE_CONTACT

#define TYPE_PROVIDE_CONTACT   0x33

Definition at line 44 of file identity.h.

◆ TYPE_REGISTER_IDENTITY

#define TYPE_REGISTER_IDENTITY   0x2d

Definition at line 40 of file identity.h.

Function Documentation

◆ edit_contact_name()

bolos_err_t edit_contact_name ( uint8_t * buffer_in,
size_t buffer_in_length )

Edit the CONTACT_NAME of an existing Identity contact.

Parameters
[in]buffer_inthe TLV payload
[in]buffer_in_lengththe length of the payload
Returns
bolos_err_t the result of the edit

Definition at line 317 of file identity_edit_contact_name.c.

◆ edit_identifier()

bolos_err_t edit_identifier ( uint8_t * buffer_in,
size_t buffer_in_length )

Edit the IDENTIFIER of an existing Identity contact.

Parameters
[in]buffer_inthe fully assembled TLV payload
[in]buffer_in_lengththe length of the payload
Returns
bolos_err_t the result of the edit

Definition at line 439 of file identity_edit_identifier.c.

◆ edit_scope()

bolos_err_t edit_scope ( uint8_t * buffer_in,
size_t buffer_in_length )

Edit the SCOPE of an existing Identity contact.

Parameters
[in]buffer_inthe fully assembled TLV payload
[in]buffer_in_lengththe length of the payload
Returns
bolos_err_t the result of the edit

Definition at line 446 of file identity_edit_scope.c.

◆ provide_contact()

bolos_err_t provide_contact ( uint8_t * buffer_in,
size_t buffer_in_length )

Deliver a verified contact to the coin application.

Parses, verifies, and passes the contact to the coin app callback. Returns SWO_SUCCESS (9000) with no response data on success.

Parameters
[in]buffer_inthe fully assembled TLV payload
[in]buffer_in_lengththe length of the payload
Returns
bolos_err_t the result of the command

Definition at line 337 of file identity_provide_contact.c.

◆ register_identity()

bolos_err_t register_identity ( uint8_t * buffer_in,
size_t buffer_in_length )

Register a new identity.

Parameters
[in]buffer_inthe input buffer containing the identity data
[in]buffer_in_lengththe length of the input buffer
Returns
bolos_err_t the result of the registration

Definition at line 430 of file identity_register.c.