pki: Improve documentation about pubkey import functions

Resolves: #253 and #254

Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
Jakub Jelen
2026-01-05 14:13:32 +01:00
parent a8ca282033
commit 1f1309c915

View File

@@ -1882,14 +1882,16 @@ fail:
/** /**
* @brief Import a base64 formatted public key from a memory c-string. * @brief Import a base64 formatted public key from a memory c-string.
* *
* @param[in] b64_key The base64 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
* @param[in] type The type of the key to format. * 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 * @param[out] pkey A pointer where the allocated key can be stored. You
* need to free the memory using ssh_key_free(). * 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() * @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. * @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 * @return `SSH_OK` on success, `SSH_ERROR` on error.
* need to free the memory using ssh_key_free().
*
* @return SSH_OK on success, SSH_ERROR on error.
* *
* @see ssh_key_free() * @see ssh_key_free()
*/ */