Struct monero::util::key::PublicKey

source ·
pub struct PublicKey {
    pub point: CompressedEdwardsY,
}
Expand description

A public key, a valid edward point on the curve.

Fields§

§point: CompressedEdwardsY

The actual Ed25519 point.

Implementations§

source§

impl PublicKey

source

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

Serialize a public key as bytes.

source

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

Serialize a public key to bytes.

source

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

Deserialize a public key from a slice.

source

pub fn from_private_key(privkey: &PrivateKey) -> PublicKey

Generate a public key from the private key.

Trait Implementations§

source§

impl<'a, 'b> Add<&'b PublicKey> for &'a PublicKey

§

type Output = PublicKey

The resulting type after applying the + operator.
source§

fn add(self, other: &'b PublicKey) -> Self::Output

Performs the + operation. Read more
source§

impl<'b> Add<&'b PublicKey> for PublicKey

§

type Output = PublicKey

The resulting type after applying the + operator.
source§

fn add(self, other: &'b PublicKey) -> Self::Output

Performs the + operation. Read more
source§

impl<'a> Add<PublicKey> for &'a PublicKey

§

type Output = PublicKey

The resulting type after applying the + operator.
source§

fn add(self, other: PublicKey) -> Self::Output

Performs the + operation. Read more
source§

impl Add for PublicKey

§

type Output = PublicKey

The resulting type after applying the + operator.
source§

fn add(self, other: PublicKey) -> Self::Output

Performs the + operation. Read more
source§

impl Clone for PublicKey

source§

fn clone(&self) -> PublicKey

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for PublicKey

source§

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

Formats the value using the given formatter. Read more
source§

impl Decodable for PublicKey

source§

fn consensus_decode<R: Read + ?Sized>(r: &mut R) -> Result<PublicKey, Error>

Decode an object with a well-defined format.
source§

impl<'de> Deserialize<'de> for PublicKey

source§

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 Display for PublicKey

source§

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

Formats the value using the given formatter. Read more
source§

impl Encodable for PublicKey

source§

fn consensus_encode<W: Write + ?Sized>(&self, w: &mut W) -> Result<usize, Error>

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

impl FromStr for PublicKey

§

type Err = Error

The associated error which can be returned from parsing.
source§

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

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

impl Hash for PublicKey

source§

fn hash<H: Hasher>(&self, state: &mut H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl Hashable for PublicKey

source§

fn hash(&self) -> Hash

Return its own hash.
source§

fn hash_to_scalar(&self) -> PrivateKey

Apply hash() on itself and return the interpreted scalar returned by the hash result.
source§

impl Index<RangeFull> for PublicKey

§

type Output = [u8]

The returned type after indexing.
source§

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

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

impl<'b> Mul<&'b PrivateKey> for PublicKey

§

type Output = PublicKey

The resulting type after applying the * operator.
source§

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

Performs the * operation. Read more
source§

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

§

type Output = PublicKey

The resulting type after applying the * operator.
source§

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

Performs the * operation. Read more
source§

impl<'b> Mul<&'b PublicKey> for PrivateKey

§

type Output = PublicKey

The resulting type after applying the * operator.
source§

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

Performs the * operation. Read more
source§

impl PartialEq for PublicKey

source§

fn eq(&self, other: &PublicKey) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Serialize for PublicKey

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl<'a, 'b> Sub<&'b PublicKey> for &'a PublicKey

§

type Output = PublicKey

The resulting type after applying the - operator.
source§

fn sub(self, other: &'b PublicKey) -> Self::Output

Performs the - operation. Read more
source§

impl<'b> Sub<&'b PublicKey> for PublicKey

§

type Output = PublicKey

The resulting type after applying the - operator.
source§

fn sub(self, other: &'b PublicKey) -> Self::Output

Performs the - operation. Read more
source§

impl<'a> Sub<PublicKey> for &'a PublicKey

§

type Output = PublicKey

The resulting type after applying the - operator.
source§

fn sub(self, other: PublicKey) -> Self::Output

Performs the - operation. Read more
source§

impl Sub for PublicKey

§

type Output = PublicKey

The resulting type after applying the - operator.
source§

fn sub(self, other: PublicKey) -> Self::Output

Performs the - operation. Read more
source§

impl TryFrom<&[u8]> for PublicKey

§

type Error = Error

The type returned in the event of a conversion error.
source§

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

Performs the conversion.
source§

impl TryFrom<[u8; 32]> for PublicKey

§

type Error = Error

The type returned in the event of a conversion error.
source§

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

Performs the conversion.
source§

impl Copy for PublicKey

source§

impl Eq for PublicKey

source§

impl StructuralPartialEq for PublicKey

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

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

impl<T> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

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

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

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

Performs the conversion.
source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V

source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,