pub struct PrivateKey<G: Group>(/* private fields */);Expand description
Wrapper around a Key to enforce that it’s a private one.
Implementations§
Source§impl<G: Group> PrivateKey<G>
impl<G: Group> PrivateKey<G>
Sourcepub fn public_key(&self) -> PublicKey<G>
pub fn public_key(&self) -> PublicKey<G>
Returns public key from private key
Sourcepub fn serialize(&self) -> GenericArray<u8, G::SkLen>
pub fn serialize(&self) -> GenericArray<u8, G::SkLen>
Serializes this private key to a fixed-length byte array.
Sourcepub fn deserialize(input: &[u8]) -> Result<Self, ProtocolError>
pub fn deserialize(input: &[u8]) -> Result<Self, ProtocolError>
Creates a PrivateKey from the given bytes.
Trait Implementations§
Source§impl<G: Group> Clone for PrivateKey<G>
impl<G: Group> Clone for PrivateKey<G>
Source§impl<G: Group> Debug for PrivateKey<G>
impl<G: Group> Debug for PrivateKey<G>
Source§impl<'de, G: Group> Deserialize<'de> for PrivateKey<G>where
G::Sk: Deserialize<'de>,
impl<'de, G: Group> Deserialize<'de> for PrivateKey<G>where
G::Sk: Deserialize<'de>,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<G: Group> Drop for PrivateKey<G>
impl<G: Group> Drop for PrivateKey<G>
impl<G: Group> Eq for PrivateKey<G>
Source§impl<G: Group> Hash for PrivateKey<G>
impl<G: Group> Hash for PrivateKey<G>
Source§impl<G: Group> Ord for PrivateKey<G>
impl<G: Group> Ord for PrivateKey<G>
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl<G: Group> PartialEq for PrivateKey<G>
impl<G: Group> PartialEq for PrivateKey<G>
Source§impl<G: Group> PartialOrd for PrivateKey<G>where
G::Sk: PartialOrd,
impl<G: Group> PartialOrd for PrivateKey<G>where
G::Sk: PartialOrd,
Source§impl<G: Group> PrivateKeySerialization<G> for PrivateKey<G>
impl<G: Group> PrivateKeySerialization<G> for PrivateKey<G>
Source§type Error = Infallible
type Error = Infallible
Custom error type that can be passed down to
ProtocolError::CustomSource§fn serialize_key_pair(
key_pair: &KeyPair<G, Self>,
) -> GenericArray<u8, Self::Len>
fn serialize_key_pair( key_pair: &KeyPair<G, Self>, ) -> GenericArray<u8, Self::Len>
Serialization into bytes
Source§fn deserialize_take_key_pair(
input: &mut &[u8],
) -> Result<KeyPair<G, Self>, ProtocolError>
fn deserialize_take_key_pair( input: &mut &[u8], ) -> Result<KeyPair<G, Self>, ProtocolError>
Deserialization from bytes Read more
Source§impl<G: Group> Serialize for PrivateKey<G>
impl<G: Group> Serialize for PrivateKey<G>
impl<G: Group> ZeroizeOnDrop for PrivateKey<G>
Auto Trait Implementations§
impl<G> Freeze for PrivateKey<G>
impl<G> RefUnwindSafe for PrivateKey<G>
impl<G> Send for PrivateKey<G>
impl<G> Sync for PrivateKey<G>
impl<G> Unpin for PrivateKey<G>
impl<G> UnsafeUnpin for PrivateKey<G>
impl<G> UnwindSafe for PrivateKey<G>
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