pub struct KeyCreateParams {
pub key_type: KeyType,
pub name: String,
pub comment: Option<String>,
pub passphrase: Option<String>,
pub kdf_rounds: Option<u32>,
pub add_to_agent: bool,
pub add_to_config: bool,
pub config_host: Option<String>,
pub touch_required: bool,
pub verify_required: bool,
}Expand description
Parameters for creating a new SSH key.
Fields§
§key_type: KeyTypeAlgorithm to use.
name: StringFile name (without path or extension).
comment: Option<String>Optional comment for the public key.
passphrase: Option<String>Passphrase to encrypt the private key.
kdf_rounds: Option<u32>bcrypt KDF rounds (higher = slower but more resistant to brute-force).
add_to_agent: boolWhether to add the key to the SSH agent after creation.
add_to_config: boolWhether to add a Host block to ~/.ssh/config.
config_host: Option<String>Host alias to use in config when add_to_config is true.
touch_required: boolRequire physical touch on FIDO/security key before signing.
verify_required: boolRequire user verification (biometric/PIN) on FIDO/security key.
Implementations§
Source§impl KeyCreateParams
impl KeyCreateParams
Sourcepub fn ed25519(name: String) -> KeyCreateParams
pub fn ed25519(name: String) -> KeyCreateParams
Create parameters for an Ed25519 key with sensible defaults.
Sourcepub fn rsa_4096(name: String) -> KeyCreateParams
pub fn rsa_4096(name: String) -> KeyCreateParams
Create parameters for an RSA 4096-bit key with sensible defaults.
Sourcepub fn ed25519_sk(name: String) -> KeyCreateParams
pub fn ed25519_sk(name: String) -> KeyCreateParams
Create parameters for a FIDO2 Ed25519 security key with sensible defaults.
Sourcepub fn ecdsa_sk(name: String) -> KeyCreateParams
pub fn ecdsa_sk(name: String) -> KeyCreateParams
Create parameters for a FIDO2 ECDSA P-256 security key with sensible defaults.
Trait Implementations§
Source§impl Clone for KeyCreateParams
impl Clone for KeyCreateParams
Source§fn clone(&self) -> KeyCreateParams
fn clone(&self) -> KeyCreateParams
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more