|
ascii-chat 0.6.0
Real-time terminal-based video chat with ASCII art conversion
|
Identity key management for discovery server. More...
Go to the source code of this file.
Functions | |
| asciichat_error_t | acds_identity_generate (uint8_t public_key[32], uint8_t secret_key[64]) |
| Generate new Ed25519 keypair. | |
| asciichat_error_t | acds_identity_load (const char *path, uint8_t public_key[32], uint8_t secret_key[64]) |
| Load identity from file. | |
| 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. | |
| void | acds_identity_fingerprint (const uint8_t public_key[32], char fingerprint[65]) |
| Compute SHA256 fingerprint of public key. | |
| asciichat_error_t | acds_identity_default_path (char *path_out, size_t path_size) |
| Get default identity file path for current platform. | |
Identity key management for discovery server.
Simple Ed25519 key generation, storage, and fingerprint computation. This is a minimal inline implementation - will be refactored to lib/identity/ in the future when we add randomart and other features.
Definition in file identity.h.
| asciichat_error_t acds_identity_default_path | ( | char * | path_out, |
| size_t | path_size | ||
| ) |
Get default identity file path for current platform.
| path_out | Output buffer for path (should be at least 256 bytes) |
| path_size | Size of output buffer |
Returns:
Definition at line 198 of file identity.c.
References ASCIICHAT_OK, ERROR_CONFIG, ERROR_INVALID_PARAM, SAFE_GETENV, and SET_ERRNO.
| void acds_identity_fingerprint | ( | const uint8_t | public_key[32], |
| char | fingerprint[65] | ||
| ) |
Compute SHA256 fingerprint of public key.
| public_key | 32-byte Ed25519 public key |
| fingerprint | Output buffer for 65 bytes (64 hex chars + null terminator) |
Definition at line 181 of file identity.c.
References log_error.
Referenced by main().
| asciichat_error_t acds_identity_generate | ( | uint8_t | public_key[32], |
| uint8_t | secret_key[64] | ||
| ) |
Generate new Ed25519 keypair.
| public_key | Output buffer for 32-byte public key |
| secret_key | Output buffer for 64-byte secret key |
Definition at line 21 of file identity.c.
References ASCIICHAT_OK, ERROR_CRYPTO, ERROR_INVALID_PARAM, log_debug, and SET_ERRNO.
Referenced by main().
| asciichat_error_t acds_identity_load | ( | const char * | path, |
| uint8_t | public_key[32], | ||
| uint8_t | secret_key[64] | ||
| ) |
Load identity from file.
| path | Path to identity file (e.g., ~/.config/ascii-chat/acds_identity) |
| public_key | Output buffer for 32-byte public key |
| secret_key | Output buffer for 64-byte secret key |
Definition at line 35 of file identity.c.
References ASCIICHAT_OK, errno, ERROR_CONFIG, ERROR_INVALID_PARAM, log_info, SET_ERRNO, and SET_ERRNO_SYS.
Referenced by main().
| 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.
| path | Path to identity file |
| public_key | 32-byte public key |
| secret_key | 64-byte secret key |
Definition at line 138 of file identity.c.
References ASCIICHAT_OK, ERROR_CONFIG, ERROR_INVALID_PARAM, log_info, platform_open(), SAFE_STRNCPY, SET_ERRNO, and SET_ERRNO_SYS.
Referenced by main().