pub fn import_ssh_key(
imported_key: &str,
password: Option<String>,
) -> Result<SshKey, SshKeyImportError>
Expand description
Convert a PCKS8 or OpenSSH encrypted or unencrypted private key to an OpenSSH private key with public key and fingerprint
§Arguments
imported_key
- The private key to convertpassword
- The password to use for decrypting the key
§Returns
Ok(SshKey)
if the key was successfully conevertedErr(PasswordRequired)
if the key is encrypted and no password was providedErr(WrongPassword)
if the password provided is incorrectErr(ParsingError)
if the key could not be parsedErr(UnsupportedKeyType)
if the key type is not supported