pub struct P384PrivateKey { /* private fields */ }Expand description
Represents a P-384 private scalar.
Implementations§
Source§impl P384PrivateKey
impl P384PrivateKey
Sourcepub fn from_bytes(bytes: [u8; 48]) -> Result<Self>
pub fn from_bytes(bytes: [u8; 48]) -> Result<Self>
Sourcepub fn to_bytes(&self) -> Result<[u8; 48]>
pub fn to_bytes(&self) -> Result<[u8; 48]>
Serializes the private scalar as canonical 48-byte big-endian octets.
§Arguments
self: Private key scalar to encode.
§Returns
48-byte scalar encoding used by SEC1/PKCS#8 wrappers.
§Errors
Returns Error::InvalidLength when internal scalar encoding cannot be represented in 48 bytes.
§Panics
This function does not panic.
Sourcepub fn public_key(&self) -> Result<P384PublicKey>
pub fn public_key(&self) -> Result<P384PublicKey>
Sourcepub fn diffie_hellman(&self, peer: &P384PublicKey) -> Result<[u8; 48]>
pub fn diffie_hellman(&self, peer: &P384PublicKey) -> Result<[u8; 48]>
Sourcepub fn sign_sha384_auto(
&self,
message: &[u8],
drbg: &mut HmacDrbgSha256,
) -> Result<([u8; 48], [u8; 48])>
pub fn sign_sha384_auto( &self, message: &[u8], drbg: &mut HmacDrbgSha256, ) -> Result<([u8; 48], [u8; 48])>
Sourcepub fn sign_digest_auto(
&self,
digest: &[u8; 48],
drbg: &mut HmacDrbgSha256,
) -> Result<([u8; 48], [u8; 48])>
pub fn sign_digest_auto( &self, digest: &[u8; 48], drbg: &mut HmacDrbgSha256, ) -> Result<([u8; 48], [u8; 48])>
Trait Implementations§
Source§impl Clone for P384PrivateKey
impl Clone for P384PrivateKey
Source§fn clone(&self) -> P384PrivateKey
fn clone(&self) -> P384PrivateKey
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 P384PrivateKey
impl Debug for P384PrivateKey
Source§impl Drop for P384PrivateKey
impl Drop for P384PrivateKey
Source§impl PartialEq for P384PrivateKey
impl PartialEq for P384PrivateKey
Source§fn eq(&self, other: &P384PrivateKey) -> bool
fn eq(&self, other: &P384PrivateKey) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Eq for P384PrivateKey
impl StructuralPartialEq for P384PrivateKey
Auto Trait Implementations§
impl Freeze for P384PrivateKey
impl RefUnwindSafe for P384PrivateKey
impl Send for P384PrivateKey
impl Sync for P384PrivateKey
impl Unpin for P384PrivateKey
impl UnsafeUnpin for P384PrivateKey
impl UnwindSafe for P384PrivateKey
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