66#define PQS_KEY_FINGERPRINT_SIZE 32U
71#define PQS_KEY_FINGERPRINT_STRING_SIZE ((PQS_KEY_FINGERPRINT_SIZE * 2U) + PQS_STRING_TERMINATOR_SIZE)
76#define PQS_KEY_KNOWN_HOST_LINE_MAX 384U
81#define PQS_KEY_HOST_NAME_MAX 256U
86#define PQS_KEY_KNOWN_HOST_MAGIC "# PQSKNOWNHOSTS1"
152PQS_EXPORT_API
bool pqs_key_known_host_find(
const char* fpath,
const char* host,
char* fingerprint,
size_t fplen);
PQS_EXPORT_API bool pqs_key_known_host_remove(const char *fpath, const char *host)
Remove a host fingerprint from a known-hosts file.
Definition pqskey.c:328
PQS_EXPORT_API bool pqs_key_known_host_find(const char *fpath, const char *host, char *fingerprint, size_t fplen)
Read the expected fingerprint for a host from a known-hosts file.
Definition pqskey.c:399
PQS_EXPORT_API bool pqs_key_fingerprint_is_valid(const char *fingerprint)
Test whether a string is a valid PQS host-key fingerprint.
Definition pqskey.c:231
PQS_EXPORT_API bool pqs_key_fingerprint_string(char *output, size_t outlen, const qsms_client_verification_key *pubkey)
Compute the PQS host-key fingerprint as hexadecimal text.
Definition pqskey.c:208
PQS_EXPORT_API void pqs_key_fingerprint(uint8_t output[PQS_KEY_FINGERPRINT_SIZE], const qsms_client_verification_key *pubkey)
Compute the PQS host-key fingerprint.
Definition pqskey.c:186
PQS_EXPORT_API bool pqs_key_fingerprint_file(char *output, size_t outlen, const char *fpath)
Compute the PQS host-key fingerprint from an encoded public-key file.
Definition pqskey.c:286
PQS_EXPORT_API bool pqs_key_host_is_valid(const char *host)
Test whether a host token is valid for known-host storage.
Definition pqskey.c:42
PQS_EXPORT_API bool pqs_key_private_file_permissions_are_strict(const char *fpath)
Test whether a private key file has strict local permissions where supported.
Definition pqskey.c:260
PQS_EXPORT_API bool pqs_key_known_host_verify(const char *fpath, const char *host, const char *fingerprint)
Verify a host fingerprint against the known-hosts file.
Definition pqskey.c:511
#define PQS_KEY_FINGERPRINT_SIZE
The binary SHA3-256 host-key fingerprint size.
Definition pqskey.h:66
PQS_EXPORT_API bool pqs_key_known_host_set(const char *fpath, const char *host, const char *fingerprint)
Add or replace a host fingerprint in a known-hosts file.
Definition pqskey.c:433