pub struct RawKey<N: ArrayLength>(/* private fields */);Expand description
A generic secret key.
Implementations§
Source§impl<N: ArrayLength> RawKey<N>
impl<N: ArrayLength> RawKey<N>
Sourcepub const fn new(key: SecretKeyBytes<N>) -> Self
pub const fn new(key: SecretKeyBytes<N>) -> Self
Creates a new raw key.
Sourcepub const fn len(&self) -> usize
pub const fn len(&self) -> usize
Returns the length in bytes of the key.
Will always be exactly N.
Sourcepub const fn as_bytes(&self) -> &SecretKeyBytes<N>
pub const fn as_bytes(&self) -> &SecretKeyBytes<N>
Returns the raw key bytes.
Sourcepub fn into_bytes(self) -> SecretKeyBytes<N>
pub fn into_bytes(self) -> SecretKeyBytes<N>
Converts the key into its raw key bytes.
Trait Implementations§
Source§impl<N: ArrayLength> ConstantTimeEq for RawKey<N>
impl<N: ArrayLength> ConstantTimeEq for RawKey<N>
Source§impl<N: ArrayLength> Debug for RawKey<N>
impl<N: ArrayLength> Debug for RawKey<N>
Source§impl<N: ArrayLength> Drop for RawKey<N>
impl<N: ArrayLength> Drop for RawKey<N>
Source§impl<N> Expand for RawKey<N>
impl<N> Expand for RawKey<N>
Source§impl<N: ArrayLength> Random for RawKey<N>
impl<N: ArrayLength> Random for RawKey<N>
Source§impl<N: ArrayLength> RawSecretBytes for RawKey<N>
impl<N: ArrayLength> RawSecretBytes for RawKey<N>
Source§fn raw_secret_bytes(&self) -> &[u8] ⓘ
fn raw_secret_bytes(&self) -> &[u8] ⓘ
Returns the secret’s byte encoding.
Source§impl<N: ArrayLength> SecretKey for RawKey<N>
impl<N: ArrayLength> SecretKey for RawKey<N>
Source§fn try_export_secret(&self) -> Result<SecretKeyBytes<Self::Size>, ExportError>
fn try_export_secret(&self) -> Result<SecretKeyBytes<Self::Size>, ExportError>
Attempts to export the key’s secret data.
impl<N: ArrayLength> ZeroizeOnDrop for RawKey<N>
Auto Trait Implementations§
impl<N> Freeze for RawKey<N>
impl<N> RefUnwindSafe for RawKey<N>
impl<N> Send for RawKey<N>
impl<N> Sync for RawKey<N>
impl<N> Unpin for RawKey<N>
impl<N> UnwindSafe for RawKey<N>
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