pub struct PrivateKey<const LEN: usize> { /* private fields */ }Expand description
An RSA Private Key that is LEN bytes long.
Implementations§
Source§impl PrivateKey<256>
impl PrivateKey<256>
Sourcepub fn from_components(n: [u8; 256], d: [u8; 256]) -> Self
pub fn from_components(n: [u8; 256], d: [u8; 256]) -> Self
Constructor for the private key based on n and d.
Sourcepub fn as_var_len(&self) -> VarLenPrivateKey<'_>
pub fn as_var_len(&self) -> VarLenPrivateKey<'_>
Returns the slice-based private key
Source§impl PrivateKey<384>
impl PrivateKey<384>
Sourcepub fn from_components(n: [u8; 384], d: [u8; 384]) -> Self
pub fn from_components(n: [u8; 384], d: [u8; 384]) -> Self
Constructor for the private key based on n and d.
Sourcepub fn as_var_len(&self) -> VarLenPrivateKey<'_>
pub fn as_var_len(&self) -> VarLenPrivateKey<'_>
Returns the slice-based private key
Source§impl PrivateKey<512>
impl PrivateKey<512>
Sourcepub fn from_components(n: [u8; 512], d: [u8; 512]) -> Self
pub fn from_components(n: [u8; 512], d: [u8; 512]) -> Self
Constructor for the private key based on n and d.
Sourcepub fn as_var_len(&self) -> VarLenPrivateKey<'_>
pub fn as_var_len(&self) -> VarLenPrivateKey<'_>
Returns the slice-based private key
Source§impl PrivateKey<768>
impl PrivateKey<768>
Sourcepub fn from_components(n: [u8; 768], d: [u8; 768]) -> Self
pub fn from_components(n: [u8; 768], d: [u8; 768]) -> Self
Constructor for the private key based on n and d.
Sourcepub fn as_var_len(&self) -> VarLenPrivateKey<'_>
pub fn as_var_len(&self) -> VarLenPrivateKey<'_>
Returns the slice-based private key
Source§impl PrivateKey<1024>
impl PrivateKey<1024>
Sourcepub fn from_components(n: [u8; 1024], d: [u8; 1024]) -> Self
pub fn from_components(n: [u8; 1024], d: [u8; 1024]) -> Self
Constructor for the private key based on n and d.
Sourcepub fn as_var_len(&self) -> VarLenPrivateKey<'_>
pub fn as_var_len(&self) -> VarLenPrivateKey<'_>
Returns the slice-based private key
Trait Implementations§
Source§impl<const LEN: usize> Debug for PrivateKey<LEN>
impl<const LEN: usize> Debug for PrivateKey<LEN>
Source§impl<'a> From<&'a PrivateKey<1024>> for VarLenPrivateKey<'a>
impl<'a> From<&'a PrivateKey<1024>> for VarLenPrivateKey<'a>
Source§fn from(value: &'a PrivateKey<1024>) -> Self
fn from(value: &'a PrivateKey<1024>) -> Self
Converts to this type from the input type.
Source§impl<'a> From<&'a PrivateKey<256>> for VarLenPrivateKey<'a>
impl<'a> From<&'a PrivateKey<256>> for VarLenPrivateKey<'a>
Source§fn from(value: &'a PrivateKey<256>) -> Self
fn from(value: &'a PrivateKey<256>) -> Self
Converts to this type from the input type.
Source§impl<'a> From<&'a PrivateKey<384>> for VarLenPrivateKey<'a>
impl<'a> From<&'a PrivateKey<384>> for VarLenPrivateKey<'a>
Source§fn from(value: &'a PrivateKey<384>) -> Self
fn from(value: &'a PrivateKey<384>) -> Self
Converts to this type from the input type.
Source§impl<'a> From<&'a PrivateKey<512>> for VarLenPrivateKey<'a>
impl<'a> From<&'a PrivateKey<512>> for VarLenPrivateKey<'a>
Source§fn from(value: &'a PrivateKey<512>) -> Self
fn from(value: &'a PrivateKey<512>) -> Self
Converts to this type from the input type.
Source§impl<'a> From<&'a PrivateKey<768>> for VarLenPrivateKey<'a>
impl<'a> From<&'a PrivateKey<768>> for VarLenPrivateKey<'a>
Source§fn from(value: &'a PrivateKey<768>) -> Self
fn from(value: &'a PrivateKey<768>) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl<const LEN: usize> Freeze for PrivateKey<LEN>
impl<const LEN: usize> RefUnwindSafe for PrivateKey<LEN>
impl<const LEN: usize> Send for PrivateKey<LEN>
impl<const LEN: usize> Sync for PrivateKey<LEN>
impl<const LEN: usize> Unpin for PrivateKey<LEN>
impl<const LEN: usize> UnwindSafe for PrivateKey<LEN>
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