diff --git a/src/pki.c b/src/pki.c index f3e195a4..63b3547d 100644 --- a/src/pki.c +++ b/src/pki.c @@ -98,6 +98,20 @@ enum ssh_keytypes_e pki_privatekey_type_from_string(const char *privkey) { return SSH_KEYTYPE_UNKNOWN; } +/** + * @brief returns the ECDSA key name ("ecdsa-sha2-nistp256" for example) + * + * @param[in] key the ssh_key whose ECDSA name to get + * + * @returns the ECDSA key name ("ecdsa-sha2-nistp256" for example) + * + * @returns "unknown" if the ECDSA key name is not known + */ +const char *ssh_pki_key_ecdsa_name(const ssh_key key) +{ + return pki_key_ecdsa_nid_to_name(key->ecdsa_nid); +} + /** * @brief creates a new empty SSH key * @returns an empty ssh_key handle, or NULL on error.