You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
bail!("Must specify both a 64-character private key AND a user ID, e.g.: `bpb restore [-f] YOUR_PRIVATE_KEY \"Name <email@example.com>\" [TIMESTAMP]`")
68
+
}
69
+
}else{
70
+
bail!("Must specify a 64-character private key and a user ID, e.g.: `bpb restore [-f] YOUR_PRIVATE_KEY \"Name <email@example.com>\" [TIMESTAMP]`")
println!(" fingerprint: Print the fingerprint of the public key.");
69
106
println!(" key-id: Print the key ID of the public key.");
70
107
println!(" sign-hex <hex>: Sign a hex string and print the signature and public key.\n");
108
+
println!(" timestamp: Print the timestamp of the current key.");
109
+
println!(" restore [-f] <key> <userid> [timestamp]: Restore a key from a 64-character private key.\n The -f flag will override any existing key.\n The timestamp is optional and will be used to generate the same public key format.");
71
110
println!("See https://github.com/pkgxdev/bpb for more information.");
// Check for existing configuration and handle force flag
264
+
let existing_config = Config::load().ok();
265
+
266
+
ifletSome(config) = &existing_config {
267
+
if !force {
268
+
let config_path = config::keys_file();
269
+
eprintln!(
270
+
"A keypair already exists. Use -f flag to override or manually perform these steps:\n\n1. Run `security delete-generic-password -s {}`\n2. Delete the config file at `{}`",
271
+
config.service(),
272
+
config_path.display()
273
+
);
274
+
returnOk(());
275
+
}else{
276
+
// Force flag is set, we'll remove existing config and keychain entry
277
+
println!("Force flag set: overriding existing key");
0 commit comments