ascii-chat
Binary v0.15.83-53-gb711d8720
Library lib/v0.3.2-701-gb711d8720
Video chat in your terminal
Loading...
Searching...
No Matches
keys.h File Reference

Go to the source code of this file.

Functions

Public Key Parsing
asciichat_error_t parse_public_key (const char *input, public_key_t *key_out)
 Parse SSH/GPG public key from any format (returns first key only).
asciichat_error_t parse_public_keys (const char *input, public_key_t *keys_out, size_t *num_keys, size_t max_keys)
 Parse all SSH/GPG public keys from any format (returns all keys).
Private Key Parsing
asciichat_error_t parse_private_key (const char *path, private_key_t *key_out)
 Parse SSH private key from file.
Key Conversion
asciichat_error_t public_key_to_x25519 (const public_key_t *key, uint8_t x25519_pk[32])
 Convert public key to X25519 for Diffie-Hellman key exchange.
asciichat_error_t private_key_to_x25519 (const private_key_t *key, uint8_t x25519_sk[32])
 Convert private key to X25519 for Diffie-Hellman key exchange.
Ed25519 Signing and Verification
asciichat_error_t ed25519_sign_message (const private_key_t *key, const uint8_t *message, size_t message_len, uint8_t signature[64])
 Sign a message with Ed25519 (uses SSH agent if available, otherwise in-memory key).
asciichat_error_t ed25519_verify_signature (const uint8_t public_key[32], const uint8_t *message, size_t message_len, const uint8_t signature[64], const char *gpg_key_id)
 Verify an Ed25519 signature.
Key Fetching (GitHub/GitLab)

Fetch SSH/GPG keys from GitHub and GitLab using HTTPS (BearSSL). Requires network connectivity and valid usernames.

asciichat_error_t fetch_github_keys (const char *username, char ***keys_out, size_t *num_keys, bool use_gpg)
 Fetch SSH/GPG keys from GitHub using BearSSL.
asciichat_error_t fetch_gitlab_keys (const char *username, char ***keys_out, size_t *num_keys, bool use_gpg)
 Fetch SSH/GPG keys from GitLab using BearSSL.
HTTPS Key Fetching

Fetch SSH/GPG keys from GitHub and GitLab using HTTPS (BearSSL). Requires network connectivity and valid usernames.

asciichat_error_t fetch_github_gpg_keys (const char *username, char ***keys_out, size_t *num_keys)
 Fetch GPG keys from GitHub using HTTPS.
asciichat_error_t fetch_gitlab_gpg_keys (const char *username, char ***keys_out, size_t *num_keys)
 Fetch GPG keys from GitLab using HTTPS.
GPG Key Parsing
asciichat_error_t parse_gpg_key (const char *gpg_key_text, public_key_t *key_out)
 Parse GPG key from armored text format.
Key Parsing
asciichat_error_t parse_keys_from_file (const char *path, public_key_t *keys, size_t *num_keys, size_t max_keys)
 Parse SSH keys from file (supports authorized_keys and known_hosts formats).
Key Formatting and Utilities
void format_public_key (const public_key_t *key, char *output, size_t output_size)
 Convert public key to display format (ssh-ed25519 or x25519 hex).
asciichat_error_t hex_decode (const char *hex, uint8_t *output, size_t output_len)
 Decode hex string to binary (utility function for testing).
asciichat_error_t validate_ssh_key_file (const char *key_path)
 Validate SSH key file before parsing.