ascii-chat
Binary v0.16.114-28-gf5913657f
Library lib/v0.3.2-3302-gf5913657f
Video chat in your terminal
Loading...
Searching...
No Matches
keys_validation.h
Go to the documentation of this file.
1#pragma once
2
25
26#include "../common.h"
27#include "key_types.h" // Include the key type definitions
28#include <stdbool.h>
29#include <stddef.h>
30#include <stdint.h>
31
32#ifdef __cplusplus
33extern "C" {
34#endif
35
40
66
96
116asciichat_error_t check_key_expiry(const public_key_t *key, bool *is_expired);
117
142asciichat_error_t validate_key_security(const char *key_path);
143
145
150
170asciichat_error_t validate_ssh_key_format(const char *key_text);
171
193asciichat_error_t validate_gpg_key_format(const char *key_text);
194
215
217
222
245asciichat_error_t check_key_strength(const public_key_t *key, bool *is_weak);
246
271 bool *has_weak_patterns);
272
274
279
306 const public_key_t *key2,
307 bool *are_equal);
308
337 const uint8_t *fingerprint,
338 size_t fingerprint_len, bool *matches);
339
367 uint8_t *fingerprint_out,
368 size_t fingerprint_size);
369
371
372#ifdef __cplusplus
373}
374#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 check_key_expiry(const public_key_t *key, bool *is_expired)
Check if a key is expired.
asciichat_error_t validate_gpg_key_format(const char *key_text)
Validate GPG key format.
asciichat_error_t validate_ssh_key_format(const char *key_text)
Validate SSH key format.
asciichat_error_t validate_key_security(const char *key_path)
Validate key permissions and security.
asciichat_error_t validate_private_key(const private_key_t *key)
Validate a private key structure.
asciichat_error_t validate_public_key(const public_key_t *key)
Validate a public key structure.
asciichat_error_t check_key_fingerprint(const public_key_t *key, const uint8_t *fingerprint, size_t fingerprint_len, bool *matches)
Check if key matches a fingerprint.
asciichat_error_t check_key_patterns(const public_key_t *key, bool *has_weak_patterns)
Check for key reuse or weak patterns.
asciichat_error_t check_key_strength(const public_key_t *key, bool *is_weak)
Check if key has weak parameters.
asciichat_error_t validate_x25519_key_format(const char *key_hex)
Validate X25519 key format.
asciichat_error_t compare_public_keys(const public_key_t *key1, const public_key_t *key2, bool *are_equal)
Compare two public keys for equality.
asciichat_error_t generate_key_fingerprint(const public_key_t *key, uint8_t *fingerprint_out, size_t fingerprint_size)
Generate key fingerprint.
⚙️ Common definitions, error codes, macros, and types shared throughout the application
Private identity-key material used for server authentication and signing.
Definition key_types.h:113
The normalized public identity used by ascii-chat's crypto and key-management code.
Definition key_types.h:83