ascii-chat
Binary v0.16.114-28-gf5913657f
Library lib/v0.3.2-3302-gf5913657f
Video chat in your terminal
Loading...
Searching...
No Matches
identity.h
Go to the documentation of this file.
1#pragma once
2
11
13#include <stdbool.h>
14#include <stdint.h>
15// NOTE: Use explicit path to avoid Windows include resolution picking up
16// options/common.h
17#include "../common.h"
18
19#ifdef __cplusplus
20extern "C" {
21#endif
22
32
41acds_identity_load(const char *path,
44
53acds_identity_save(const char *path,
54 const uint8_t public_key[ED25519_PUBLIC_KEY_SIZE],
55 const uint8_t secret_key[ED25519_PRIVATE_KEY_SIZE]);
56
64 const uint8_t public_key[ED25519_PUBLIC_KEY_SIZE],
65 char fingerprint[HEX_STRING_SIZE_32]);
66
77asciichat_error_t acds_identity_default_path(char *path_out, size_t path_size);
78
79#ifdef __cplusplus
80}
81#endif
unsigned char uint8_t
asciichat_error_t
Error and exit codes - unified status values (0-255).
Definition error_codes.h:48
asciichat_error_t acds_identity_load(const char *path, uint8_t public_key[32], uint8_t secret_key[64])
Load identity from file.
Definition identity.c:40
void acds_identity_fingerprint(const uint8_t public_key[32], char fingerprint[(32 *2+1)])
Compute SHA256 fingerprint of public key.
Definition identity.c:150
asciichat_error_t acds_identity_default_path(char *path_out, size_t path_size)
Get default identity file path for current platform.
Definition identity.c:172
asciichat_error_t acds_identity_save(const char *path, const uint8_t public_key[32], const uint8_t secret_key[64])
Save identity to file.
Definition identity.c:100
asciichat_error_t acds_identity_generate(uint8_t public_key[32], uint8_t secret_key[64])
Generate new Ed25519 keypair.
Definition identity.c:23
⚙️ Common definitions, error codes, macros, and types shared throughout the application
#define ED25519_PUBLIC_KEY_SIZE
Ed25519 public key size in bytes.
Definition sizes.h:38
#define HEX_STRING_SIZE_32
Hex string size for 32-byte values (64 hex chars + null terminator).
Definition sizes.h:163
#define ED25519_PRIVATE_KEY_SIZE
Ed25519 private key size (seed + public) in bytes.
Definition sizes.h:40