pki: Discourage comparing private keys

Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Pavol Žáčik <pzacik@redhat.com>
This commit is contained in:
Jakub Jelen
2026-01-08 12:55:06 +01:00
parent 5654c593df
commit b3e13b7f0b

View File

@@ -834,6 +834,10 @@ int ssh_key_is_private(const ssh_key k) {
/** /**
* @brief Compare keys if they are equal. * @brief Compare keys if they are equal.
* *
* Note that comparing private keys is almost never needed. The private key
* is cryptographically bound to the public key and comparing public keys should
* always be preferred.
*
* @param[in] k1 The first key to compare. * @param[in] k1 The first key to compare.
* *
* @param[in] k2 The second key to compare. * @param[in] k2 The second key to compare.