bitwarden_wasm_internal::ssh

Function import_ssh_key

Source
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 convert
  • password - The password to use for decrypting the key

§Returns

  • Ok(SshKey) if the key was successfully coneverted
  • Err(PasswordRequired) if the key is encrypted and no password was provided
  • Err(WrongPassword) if the password provided is incorrect
  • Err(ParsingError) if the key could not be parsed
  • Err(UnsupportedKeyType) if the key type is not supported