pub struct KeyManager;Implementations§
Source§impl KeyManager
impl KeyManager
Sourcepub fn load_private_key<P: AsRef<Path>>(path: P) -> Result<RsaPrivateKey>
pub fn load_private_key<P: AsRef<Path>>(path: P) -> Result<RsaPrivateKey>
Loads an RSA private key from a PEM file.
Sourcepub fn load_public_key<P: AsRef<Path>>(path: P) -> Result<RsaPublicKey>
pub fn load_public_key<P: AsRef<Path>>(path: P) -> Result<RsaPublicKey>
Loads an RSA public key from a PEM file.
Sourcepub fn wrap_key(public_key: &RsaPublicKey, cek: &[u8]) -> Result<Vec<u8>>
pub fn wrap_key(public_key: &RsaPublicKey, cek: &[u8]) -> Result<Vec<u8>>
Wraps (encrypts) a CEK using the public key (KEK). Uses RSA-OAEP with SHA-1 digest (per 3MF spec).
Sourcepub fn unwrap_key(
private_key: &RsaPrivateKey,
wrapped_key: &[u8],
) -> Result<Vec<u8>>
pub fn unwrap_key( private_key: &RsaPrivateKey, wrapped_key: &[u8], ) -> Result<Vec<u8>>
Unwraps (decrypts) a CEK using the private key (KEK). Uses RSA-OAEP with SHA-1 digest.
Auto Trait Implementations§
impl Freeze for KeyManager
impl RefUnwindSafe for KeyManager
impl Send for KeyManager
impl Sync for KeyManager
impl Unpin for KeyManager
impl UnsafeUnpin for KeyManager
impl UnwindSafe for KeyManager
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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