ascii-chat
Binary v0.15.83-53-gb711d8720
Library lib/v0.3.2-701-gb711d8720
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
37
62
105asciichat_error_t parse_ssh_private_key(const char *key_path, private_key_t *key_out);
106
131asciichat_error_t validate_ssh_key_file(const char *key_path);
132
134
139
163 uint8_t x25519_pk[X25519_KEY_SIZE]);
164
192 uint8_t x25519_sk[X25519_KEY_SIZE]);
193
195
200
224asciichat_error_t ed25519_sign_message(const private_key_t *key, const uint8_t *message, size_t message_len,
226
249 size_t message_len, const uint8_t signature[ED25519_SIGNATURE_SIZE],
250 const char *gpg_key_id);
251
⚙️ Common definitions, error codes, macros, and types shared throughout the application
unsigned char uint8_t
Definition common.h:60
asciichat_error_t
Error and exit codes - unified status values (0-255).
Definition error_codes.h:44
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:984
asciichat_error_t validate_ssh_key_file(const char *key_path)
Validate SSH key file permissions and format.
Definition ssh_keys.c:1024
#define ED25519_SIGNATURE_SIZE
Ed25519 signature size in bytes.
Definition sizes.h:37
#define ED25519_PUBLIC_KEY_SIZE
Ed25519 public key size in bytes.
Definition sizes.h:33
#define X25519_KEY_SIZE
X25519 key size in bytes.
Definition sizes.h:31
#define ED25519_PRIVATE_KEY_SIZE
Ed25519 private key size (seed + public) in bytes.
Definition sizes.h:35
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:1133
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:1235
Private identity-key material used for server authentication and signing.
Definition key_types.h:97