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

pub struct PrivateKey {
    pub scalar: Scalar,
}
Expand description

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.

fn add(self, other: &'b PrivateKey) -> Self::Output[src]

Performs the + operation. Read more

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

type Output = PrivateKey

The resulting type after applying the + operator.

fn add(self, other: &'b PrivateKey) -> Self::Output[src]

Performs the + operation. Read more

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

type Output = PrivateKey

The resulting type after applying the + operator.

fn add(self, other: PrivateKey) -> Self::Output[src]

Performs the + operation. Read more

impl Add<PrivateKey> for PrivateKey[src]

type Output = PrivateKey

The resulting type after applying the + operator.

fn add(self, other: PrivateKey) -> Self::Output[src]

Performs the + operation. Read more

impl Clone for PrivateKey[src]

fn clone(&self) -> PrivateKey[src]

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Debug for PrivateKey[src]

fn fmt(&self, f: &mut Formatter<'_>) -> Result[src]

Formats the value using the given formatter. Read more

impl Decodable for PrivateKey[src]

fn consensus_decode<D: Read>(d: &mut D) -> Result<PrivateKey, Error>[src]

Decode an object with a well-defined format.

impl Display for PrivateKey[src]

fn fmt(&self, f: &mut Formatter<'_>) -> Result[src]

Formats the value using the given formatter. Read more

impl Encodable for PrivateKey[src]

fn consensus_encode<S: Write>(&self, s: &mut S) -> Result<usize, Error>[src]

Encode an object with a well-defined format, should only ever error if the underlying Encoder errors. Read more

impl FromStr for PrivateKey[src]

type Err = Error

The associated error which can be returned from parsing.

fn from_str(s: &str) -> Result<Self, Self::Err>[src]

Parses a string s to return a value of this type. Read more

impl Index<RangeFull> for PrivateKey[src]

type Output = [u8]

The returned type after indexing.

fn index(&self, _: RangeFull) -> &[u8][src]

Performs the indexing (container[index]) operation. Read more

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

type Output = PublicKey

The resulting type after applying the * operator.

fn mul(self, other: &'b PrivateKey) -> Self::Output[src]

Performs the * operation. Read more

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

type Output = PublicKey

The resulting type after applying the * operator.

fn mul(self, other: &'b PublicKey) -> Self::Output[src]

Performs the * operation. Read more

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

type Output = PublicKey

The resulting type after applying the * operator.

fn mul(self, other: &'b PublicKey) -> Self::Output[src]

Performs the * operation. Read more

impl Mul<PrivateKey> for PrivateKey[src]

type Output = PrivateKey

The resulting type after applying the * operator.

fn mul(self, other: PrivateKey) -> Self::Output[src]

Performs the * operation. Read more

impl Mul<u8> for PrivateKey[src]

type Output = PrivateKey

The resulting type after applying the * operator.

fn mul(self, other: u8) -> Self::Output[src]

Performs the * operation. Read more

impl PartialEq<PrivateKey> for PrivateKey[src]

fn eq(&self, other: &PrivateKey) -> bool[src]

This method tests for self and other values to be equal, and is used by ==. Read more

fn ne(&self, other: &PrivateKey) -> bool[src]

This method tests for !=.

impl StrictDecode for PrivateKey[src]

This is supported on crate feature strict_encoding_support only.

fn strict_decode<D: Read>(d: D) -> Result<Self, Error>[src]

Decode with the given [std::io::Reader] instance; must either construct an instance or return implementation-specific error type. Read more

fn strict_deserialize(data: impl AsRef<[u8]>) -> Result<Self, Error>[src]

Tries to deserialize byte array into the current type using [strict_decode()] Read more

impl StrictEncode for PrivateKey[src]

This is supported on crate feature strict_encoding_support only.

fn strict_encode<E: Write>(&self, e: E) -> Result<usize, Error>[src]

Encode with the given [std::io::Writer] instance; must return result with either amount of bytes encoded – or implementation-specific error type. Read more

fn strict_serialize(&self) -> Result<Vec<u8, Global>, Error>[src]

Serializes data as a byte array using [strict_encode()] function

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

type Error = Error

The type returned in the event of a conversion error.

fn try_from(value: &[u8]) -> Result<Self, Self::Error>[src]

Performs the conversion.

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

type Error = Error

The type returned in the event of a conversion error.

fn try_from(value: [u8; 32]) -> Result<Self, Self::Error>[src]

Performs the conversion.

impl Copy for PrivateKey[src]

impl Eq for PrivateKey[src]

impl StructuralEq for PrivateKey[src]

impl StructuralPartialEq for PrivateKey[src]

Auto Trait Implementations

Blanket Implementations

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

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

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

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

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

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

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

pub fn from(t: T) -> T[src]

Performs the conversion.

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

pub fn into(self) -> U[src]

Performs the conversion.

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.

pub fn to_owned(&self) -> T[src]

Creates owned data from borrowed data, usually by cloning. Read more

pub fn clone_into(&self, target: &mut T)[src]

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

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

pub default fn to_string(&self) -> String[src]

Converts the given value to a String. Read more

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.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

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.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.