pub struct PublicKey(_);Expand description
The public key wrapper for anon/confidential transfer, for WASM compatability.
Implementations§
source§impl PublicKey
impl PublicKey
sourcepub fn default_secp256k1() -> Self
pub fn default_secp256k1() -> Self
Default secp256k1 public key
sourcepub fn default_ed25519() -> Self
pub fn default_ed25519() -> Self
Default ed25519 public key
sourcepub fn inner(&self) -> &PublicKeyInner
pub fn inner(&self) -> &PublicKeyInner
Get the reference of the inner type
sourcepub fn to_eth_address(&self) -> Result<PublicKey>
pub fn to_eth_address(&self) -> Result<PublicKey>
Convert the secp256k1 keypair to ETH address
sourcepub fn to_secp256k1(&self) -> Result<SECP256K1G1>
pub fn to_secp256k1(&self) -> Result<SECP256K1G1>
Change to algebra secp256k1 Point
sourcepub fn to_ed25519(&self) -> Result<Ed25519Point>
pub fn to_ed25519(&self) -> Result<Ed25519Point>
Change to algebra Ristretto Point
sourcepub fn to_bls_scalars(&self) -> Result<[BLSScalar; 3]>
pub fn to_bls_scalars(&self) -> Result<[BLSScalar; 3]>
Return the BLS12-381 scalar representation of the public key.
sourcepub fn random_scalar_with_compressed_point<R: CryptoRng + RngCore>(
&self,
prng: &mut R
) -> (KeyType, Vec<u8>, Vec<u8>)
pub fn random_scalar_with_compressed_point<R: CryptoRng + RngCore>(
&self,
prng: &mut R
) -> (KeyType, Vec<u8>, Vec<u8>)
random a scalar and the compressed point.
sourcepub fn as_compressed_point(&self) -> Result<Vec<u8>>
pub fn as_compressed_point(&self) -> Result<Vec<u8>>
Convert into the point format.
Trait Implementations§
source§impl<'de> Deserialize<'de> for PublicKey
impl<'de> Deserialize<'de> for PublicKey
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 FromWasmAbi for PublicKey
impl FromWasmAbi for PublicKey
source§impl IntoWasmAbi for PublicKey
impl IntoWasmAbi for PublicKey
source§impl NoahFromToBytes for PublicKey
impl NoahFromToBytes for PublicKey
source§impl OptionFromWasmAbi for PublicKey
impl OptionFromWasmAbi for PublicKey
source§impl OptionIntoWasmAbi for PublicKey
impl OptionIntoWasmAbi for PublicKey
source§impl Ord for PublicKey
impl Ord for PublicKey
source§impl PartialEq<PublicKey> for PublicKey
impl PartialEq<PublicKey> for PublicKey
source§impl PartialOrd<PublicKey> for PublicKey
impl PartialOrd<PublicKey> for PublicKey
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self and other) and is used by the <=
operator. Read moresource§impl RefFromWasmAbi for PublicKey
impl RefFromWasmAbi for PublicKey
source§impl RefMutFromWasmAbi for PublicKey
impl RefMutFromWasmAbi for PublicKey
impl Copy for PublicKey
impl Eq for PublicKey
Auto Trait Implementations§
impl RefUnwindSafe for PublicKey
impl Send for PublicKey
impl Sync for PublicKey
impl Unpin for PublicKey
impl UnwindSafe for PublicKey
Blanket Implementations§
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
source§impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
§type Abi = <T as IntoWasmAbi>::Abi
type Abi = <T as IntoWasmAbi>::Abi
Same as
IntoWasmAbi::Abisource§fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
Same as
IntoWasmAbi::into_abi, except that it may throw and never
return in the case of Err.