mirror of
https://github.com/Noratrieb/cluelessh.git
synced 2026-01-14 16:35:06 +01:00
changes
This commit is contained in:
parent
5f203d0f5b
commit
dcba4931e5
23 changed files with 317 additions and 132 deletions
|
|
@ -6,7 +6,7 @@ use std::{
|
|||
|
||||
use base64::Engine;
|
||||
use clap::Parser;
|
||||
use cluelessh_keys::{KeyEncryptionParams, PrivateKeyType};
|
||||
use cluelessh_keys::{KeyEncryptionParams, PrivateKey};
|
||||
use eyre::{bail, Context};
|
||||
|
||||
#[derive(clap::Parser)]
|
||||
|
|
@ -125,17 +125,23 @@ fn info(id_file: &Path, decrypt: bool, show_private: bool) -> eyre::Result<()> {
|
|||
None
|
||||
};
|
||||
|
||||
let keys = keys.parse_private(passphrase.as_deref())?;
|
||||
let keys = keys.decrypt(passphrase.as_deref())?;
|
||||
for key in keys {
|
||||
println!("{} {}", key.private_key.public_key(), key.comment);
|
||||
if show_private {
|
||||
match key.private_key {
|
||||
PrivateKeyType::Ed25519 { private_key, .. } => {
|
||||
PrivateKey::Ed25519 { private_key, .. } => {
|
||||
println!(
|
||||
" private key: {}",
|
||||
base64::prelude::BASE64_STANDARD_NO_PAD.encode(private_key)
|
||||
)
|
||||
}
|
||||
PrivateKey::EcdsaSha2NistP256 { private_key, .. } => {
|
||||
println!(
|
||||
" private key: {}",
|
||||
base64::prelude::BASE64_STANDARD_NO_PAD.encode(private_key.to_bytes())
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue