pub struct KeyGenerator { /* private fields */ }Expand description
Builder for key generation operations.
§Examples
use libsignify_rs::KeyGenerator;
use tempfile::tempdir;
let dir = tempdir()?;
let pub_path = dir.path().join("key.pub");
let sec_path = dir.path().join("key.sec");
// Generate with default settings (secure KDF rounds)
KeyGenerator::new()
.rounds(0) // No encryption for automated testing
.comment("test-key")
.generate(&pub_path, &sec_path)?;
assert!(pub_path.exists());
assert!(sec_path.exists());Implementations§
Source§impl KeyGenerator
impl KeyGenerator
Sourcepub fn tty_handle(self, tty: File) -> Self
pub fn tty_handle(self, tty: File) -> Self
Set TTY handle for interactive password prompts.
Sourcepub fn comment(self, comment: impl Into<String>) -> Self
pub fn comment(self, comment: impl Into<String>) -> Self
Set key comment.
Default is “signify key”.
Trait Implementations§
Source§impl Default for KeyGenerator
impl Default for KeyGenerator
Source§fn default() -> KeyGenerator
fn default() -> KeyGenerator
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for KeyGenerator
impl RefUnwindSafe for KeyGenerator
impl Send for KeyGenerator
impl Sync for KeyGenerator
impl Unpin for KeyGenerator
impl UnwindSafe for KeyGenerator
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more