pub struct Es384KeyPairLoader { /* private fields */ }Expand description
Loads or initializes an ES384 key pair from the filesystem.
Implementations§
Source§impl Es384KeyPairLoader
impl Es384KeyPairLoader
Sourcepub fn new(
private_key_path: impl Into<PathBuf>,
public_key_path: impl Into<PathBuf>,
) -> Self
pub fn new( private_key_path: impl Into<PathBuf>, public_key_path: impl Into<PathBuf>, ) -> Self
Creates a new loader for the given private and public key paths.
Sourcepub fn paths(&self) -> &Es384KeyPairPaths
pub fn paths(&self) -> &Es384KeyPairPaths
Returns the configured key paths.
Sourcepub async fn initialize_if_required(&self) -> Result<Es384KeyPair>
pub async fn initialize_if_required(&self) -> Result<Es384KeyPair>
Creates the key pair if missing and then loads both PEM files.
If both files already exist, they are reused unchanged. If neither file exists, a new ES384 key pair is generated, written to disk, and loaded.
§Errors
Returns an error when only one key file exists, when directories or files cannot be created or read, or when the resulting PEM bytes are not a valid ES384 key pair.
Sourcepub async fn load(&self) -> Result<Es384KeyPair>
pub async fn load(&self) -> Result<Es384KeyPair>
Loads both PEM files from disk.
§Errors
Returns an error if either file cannot be read or if the loaded bytes do not form a valid ES384 key pair.
Trait Implementations§
Source§impl Clone for Es384KeyPairLoader
impl Clone for Es384KeyPairLoader
Source§fn clone(&self) -> Es384KeyPairLoader
fn clone(&self) -> Es384KeyPairLoader
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for Es384KeyPairLoader
impl Debug for Es384KeyPairLoader
Source§impl PartialEq for Es384KeyPairLoader
impl PartialEq for Es384KeyPairLoader
Source§fn eq(&self, other: &Es384KeyPairLoader) -> bool
fn eq(&self, other: &Es384KeyPairLoader) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Eq for Es384KeyPairLoader
impl StructuralPartialEq for Es384KeyPairLoader
Auto Trait Implementations§
impl Freeze for Es384KeyPairLoader
impl RefUnwindSafe for Es384KeyPairLoader
impl Send for Es384KeyPairLoader
impl Sync for Es384KeyPairLoader
impl Unpin for Es384KeyPairLoader
impl UnsafeUnpin for Es384KeyPairLoader
impl UnwindSafe for Es384KeyPairLoader
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