From 1f1309c915041295dd14deed58ee58e6fdb43514 Mon Sep 17 00:00:00 2001 From: Jakub Jelen Date: Mon, 5 Jan 2026 14:13:32 +0100 Subject: [PATCH] pki: Improve documentation about pubkey import functions Resolves: #253 and #254 Signed-off-by: Jakub Jelen Reviewed-by: Andreas Schneider --- src/pki.c | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/src/pki.c b/src/pki.c index 5e762834..c6ab4a85 100644 --- a/src/pki.c +++ b/src/pki.c @@ -1882,14 +1882,16 @@ fail: /** * @brief Import a base64 formatted public key from a memory c-string. * - * @param[in] b64_key The base64 key to format. - * - * @param[in] type The type of the key to format. + * Note that the public key is just the base64 part (without the key + * type prefix and comment suffix you can find in the OpenSSH public + * key file or known_hosts file). * + * @param[in] b64_key The base64 key to import. + * @param[in] type The type of the key to import. * @param[out] pkey A pointer where the allocated key can be stored. You * need to free the memory using ssh_key_free(). * - * @return SSH_OK on success, SSH_ERROR on error. + * @return `SSH_OK` on success, `SSH_ERROR` on error. * * @see ssh_key_free() */ @@ -2191,14 +2193,16 @@ int ssh_pki_import_pubkey_file(const char *filename, ssh_key *pkey) /** * @brief Import a base64 formatted certificate from a memory c-string. * - * @param[in] b64_cert The base64 cert to format. + * Note that the certificate is just the base64 part (without the key + * type prefix and comment suffix you can find in the OpenSSH certificate + * file). * - * @param[in] type The type of the cert to format. + * @param[in] b64_cert The base64 cert to import. + * @param[in] type The type of the cert to import. + * @param[out] pkey A pointer where the allocated certificate can be stored. + * You need to free the memory using ssh_key_free(). * - * @param[out] pkey A pointer where the allocated key can be stored. You - * need to free the memory using ssh_key_free(). - * - * @return SSH_OK on success, SSH_ERROR on error. + * @return `SSH_OK` on success, `SSH_ERROR` on error. * * @see ssh_key_free() */