ascii-chat
Binary v0.16.114-28-gf5913657f
Library lib/v0.3.2-3302-gf5913657f
Video chat in your terminal
Loading...
Searching...
No Matches
ssh_keys.h
Go to the documentation of this file.
1#pragma once
2
25
27#include "../../common.h"
28#include "../../crypto/key_types.h" // Include the key type definitions
29#include <stdint.h>
30#include <stddef.h>
31#include <stdbool.h>
32
33#ifdef __cplusplus
34extern "C" {
35#endif
36
41
66
109asciichat_error_t parse_ssh_private_key(const char *key_path, private_key_t *key_out);
110
135asciichat_error_t validate_ssh_key_file(const char *key_path);
136
138
143
167
195
197
202
226asciichat_error_t ed25519_sign_message(const private_key_t *key, const uint8_t *message, size_t message_len, uint8_t signature[ED25519_SIGNATURE_SIZE]);
227
249asciichat_error_t ed25519_verify_signature(const uint8_t public_key[ED25519_PUBLIC_KEY_SIZE], const uint8_t *message, size_t message_len, const uint8_t signature[ED25519_SIGNATURE_SIZE],
250 const char *gpg_key_id);
251
253
254#ifdef __cplusplus
255}
256#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 ed25519_to_x25519_private(const uint8_t ed25519_sk[64], uint8_t x25519_sk[32])
Convert Ed25519 private key to X25519 for key exchange.
asciichat_error_t ed25519_to_x25519_public(const uint8_t ed25519_pk[32], uint8_t x25519_pk[32])
Convert Ed25519 public key to X25519 for key exchange.
asciichat_error_t parse_ssh_ed25519_line(const char *line, uint8_t ed25519_pk[32])
Parse SSH Ed25519 public key from "ssh-ed25519 AAAAC3..." format.
asciichat_error_t parse_ssh_private_key(const char *key_path, private_key_t *key_out)
Parse SSH Ed25519 private key from file.
Definition ssh_keys.c:1156
asciichat_error_t validate_ssh_key_file(const char *key_path)
Validate SSH key file permissions and format.
Definition ssh_keys.c:1202
⚙️ Common definitions, error codes, macros, and types shared throughout the application
#define ED25519_SIGNATURE_SIZE
Ed25519 signature size in bytes.
Definition sizes.h:42
#define ED25519_PUBLIC_KEY_SIZE
Ed25519 public key size in bytes.
Definition sizes.h:38
#define X25519_KEY_SIZE
X25519 key size in bytes.
Definition sizes.h:36
#define ED25519_PRIVATE_KEY_SIZE
Ed25519 private key size (seed + public) in bytes.
Definition sizes.h:40
asciichat_error_t ed25519_sign_message(const private_key_t *key, const uint8_t *message, size_t message_len, uint8_t signature[ED25519_SIGNATURE_SIZE])
Definition ssh_keys.c:1331
asciichat_error_t ed25519_verify_signature(const uint8_t public_key[ED25519_PUBLIC_KEY_SIZE], const uint8_t *message, size_t message_len, const uint8_t signature[ED25519_SIGNATURE_SIZE], const char *gpg_key_id)
Definition ssh_keys.c:1454
Private identity-key material used for server authentication and signing.
Definition key_types.h:113