Struct monero::util::key::PrivateKey[][src]

pub struct PrivateKey {
    pub scalar: Scalar,
}

A private key, a valid curve25519 scalar.

Fields

scalar: Scalar

The actual curve25519 scalar.

Implementations

impl PrivateKey[src]

pub fn as_bytes(&self) -> &[u8][src]

Serialize the private key as bytes.

pub fn to_bytes(&self) -> [u8; 32][src]

Serialize the private key to bytes.

pub fn from_slice(data: &[u8]) -> Result<PrivateKey, Error>[src]

Deserialize a private key from a slice.

pub fn from_scalar(scalar: Scalar) -> PrivateKey[src]

Create a secret key from a raw curve25519 scalar.

Trait Implementations

impl<'a, 'b> Add<&'b PrivateKey> for &'a PrivateKey[src]

type Output = PrivateKey

The resulting type after applying the + operator.

impl<'b> Add<&'b PrivateKey> for PrivateKey[src]

type Output = PrivateKey

The resulting type after applying the + operator.

impl<'a> Add<PrivateKey> for &'a PrivateKey[src]

type Output = PrivateKey

The resulting type after applying the + operator.

impl Add<PrivateKey> for PrivateKey[src]

type Output = PrivateKey

The resulting type after applying the + operator.

impl Clone for PrivateKey[src]

impl Copy for PrivateKey[src]

impl Debug for PrivateKey[src]

impl Decodable for PrivateKey[src]

impl Display for PrivateKey[src]

impl Encodable for PrivateKey[src]

impl Eq for PrivateKey[src]

impl FromStr for PrivateKey[src]

type Err = Error

The associated error which can be returned from parsing.

impl Index<RangeFull> for PrivateKey[src]

type Output = [u8]

The returned type after indexing.

impl<'b> Mul<&'b PrivateKey> for PublicKey[src]

type Output = PublicKey

The resulting type after applying the * operator.

impl<'b> Mul<&'b PublicKey> for PrivateKey[src]

type Output = PublicKey

The resulting type after applying the * operator.

impl<'a, 'b> Mul<&'b PublicKey> for &'a PrivateKey[src]

type Output = PublicKey

The resulting type after applying the * operator.

impl Mul<PrivateKey> for PrivateKey[src]

type Output = PrivateKey

The resulting type after applying the * operator.

impl Mul<u8> for PrivateKey[src]

type Output = PrivateKey

The resulting type after applying the * operator.

impl PartialEq<PrivateKey> for PrivateKey[src]

impl StrictDecode for PrivateKey[src]

This is supported on crate feature strict_encoding_support only.

impl StrictEncode for PrivateKey[src]

This is supported on crate feature strict_encoding_support only.

impl StructuralEq for PrivateKey[src]

impl StructuralPartialEq for PrivateKey[src]

impl TryFrom<&'_ [u8]> for PrivateKey[src]

type Error = Error

The type returned in the event of a conversion error.

impl TryFrom<[u8; 32]> for PrivateKey[src]

type Error = Error

The type returned in the event of a conversion error.

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.