Embedded SDK
Embedded SDK
Loading...
Searching...
No Matches
identity.h
Go to the documentation of this file.
1/*****************************************************************************
2 * (c) 2026 Ledger SAS.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 *****************************************************************************/
16
17#pragma once
18
31
32#if defined(HAVE_ADDRESS_BOOK)
33
34/* Includes ------------------------------------------------------------------*/
35#include "os_types.h"
36#include "address_book.h"
37#include "bip32.h"
38
39/* Exported defines --------------------------------------------------------*/
40#define TYPE_REGISTER_IDENTITY 0x2d
41#define TYPE_EDIT_CONTACT_NAME 0x2e
42#define TYPE_EDIT_IDENTIFIER 0x31
43#define TYPE_EDIT_SCOPE 0x32
44#define TYPE_PROVIDE_CONTACT 0x33
45
46/* Exported defines (unconditional — plain numeric constants) ----------------*/
47#define GID_SIZE 32
48#define GROUP_HANDLE_SIZE 64
49
50#define CONTACT_NAME_LENGTH 33
51#define SCOPE_LENGTH 33
52#define IDENTIFIER_MAX_LENGTH 80
53
54/* Exported types, structures, unions ----------------------------------------*/
55
71
80
89
100
101/* Exported functions prototypes --------------------------------------------- */
102bolos_err_t register_identity(uint8_t *buffer_in, size_t buffer_in_length);
103bolos_err_t edit_contact_name(uint8_t *buffer_in, size_t buffer_in_length);
104bolos_err_t edit_identifier(uint8_t *buffer_in, size_t buffer_in_length);
105bolos_err_t edit_scope(uint8_t *buffer_in, size_t buffer_in_length);
106bolos_err_t provide_contact(uint8_t *buffer_in, size_t buffer_in_length);
107
108#endif // HAVE_ADDRESS_BOOK
blockchain_family_e
#define GID_SIZE
32-byte random group ID generated by the device
Definition identity.h:47
#define CONTACT_NAME_LENGTH
max 32 printable chars + null terminator
Definition identity.h:50
bolos_err_t provide_contact(uint8_t *buffer_in, size_t buffer_in_length)
Deliver a verified contact to the coin application.
bolos_err_t register_identity(uint8_t *buffer_in, size_t buffer_in_length)
Register a new identity.
bolos_err_t edit_scope(uint8_t *buffer_in, size_t buffer_in_length)
Edit the SCOPE of an existing Identity contact.
#define SCOPE_LENGTH
max 32 printable chars + null terminator
Definition identity.h:51
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_contact_name(uint8_t *buffer_in, size_t buffer_in_length)
Edit the CONTACT_NAME of an existing Identity contact.
#define IDENTIFIER_MAX_LENGTH
blockchain address or public key, raw bytes
Definition identity.h:52
Data extracted from an Edit Contact Name TLV payload.
Definition identity.h:84
char contact_name[CONTACT_NAME_LENGTH]
New contact name.
Definition identity.h:86
uint8_t gid[GID_SIZE]
Group ID extracted from group_handle.
Definition identity.h:85
char old_contact_name[CONTACT_NAME_LENGTH]
old contact name
Definition identity.h:87
Data extracted from an Edit Identifier TLV payload.
Definition identity.h:75
uint8_t old_identifier[IDENTIFIER_MAX_LENGTH]
Identifier being replaced.
Definition identity.h:77
identity_t identity
Updated identity (identifier = new).
Definition identity.h:76
uint8_t old_identifier_len
Length of the old identifier.
Definition identity.h:78
Data extracted from an Edit Scope Name TLV payload.
Definition identity.h:96
char old_scope[SCOPE_LENGTH]
Scope being replaced.
Definition identity.h:98
identity_t identity
New identity (scope = new).
Definition identity.h:97
Data extracted from a Register Identity TLV payload.
Definition identity.h:62
char scope[SCOPE_LENGTH]
Definition identity.h:65
blockchain_family_e blockchain_family
Definition identity.h:68
uint64_t chain_id
Mandatory when blockchain_family == FAMILY_ETHEREUM.
Definition identity.h:69
uint8_t gid[GID_SIZE]
Device-generated group ID (first 32B of group_handle).
Definition identity.h:63
uint8_t identifier[IDENTIFIER_MAX_LENGTH]
Definition identity.h:66
uint8_t identifier_len
Definition identity.h:67
char contact_name[CONTACT_NAME_LENGTH]
Definition identity.h:64