Type Alias EphemeralPublic
pub type EphemeralPublic = CryptoBytes<sp_core::::ed25519::Public::{constant#0}, (PublicTag, Ed25519Tag)>;
Expand description
A public key.
Aliased Type§
struct EphemeralPublic(pub [u8; 32], _);
Fields§
§0: [u8; 32]
Implementations
§impl<T> CryptoBytes<32, T>
impl<T> CryptoBytes<32, T>
pub fn from_h256(x: H256) -> CryptoBytes<32, T>
pub fn from_h256(x: H256) -> CryptoBytes<32, T>
A new instance from an H256.
Trait Implementations
§impl<const N: usize, T> ByteArray for CryptoBytes<N, T>
impl<const N: usize, T> ByteArray for CryptoBytes<N, T>
§fn from_slice(data: &[u8]) -> Result<Self, ()>
fn from_slice(data: &[u8]) -> Result<Self, ()>
A new instance from the given slice that should be
Self::LEN
bytes long.§fn to_raw_vec(&self) -> Vec<u8> ⓘ
fn to_raw_vec(&self) -> Vec<u8> ⓘ
Return a
Vec<u8>
filled with raw data.§impl CryptoType for CryptoBytes<sp_core::::ed25519::Public::{constant#0}, (PublicTag, Ed25519Tag)>
impl CryptoType for CryptoBytes<sp_core::::ed25519::Public::{constant#0}, (PublicTag, Ed25519Tag)>
§impl<const N: usize, SubTag> Debug for CryptoBytes<N, (PublicTag, SubTag)>where
CryptoBytes<N, (PublicTag, SubTag)>: CryptoType,
impl<const N: usize, SubTag> Debug for CryptoBytes<N, (PublicTag, SubTag)>where
CryptoBytes<N, (PublicTag, SubTag)>: CryptoType,
§impl<const N: usize, T> Decode for CryptoBytes<N, T>where
PhantomData<fn() -> T>: Decode,
impl<const N: usize, T> Decode for CryptoBytes<N, T>where
PhantomData<fn() -> T>: Decode,
§fn decode<__CodecInputEdqy>(
__codec_input_edqy: &mut __CodecInputEdqy,
) -> Result<CryptoBytes<N, T>, Error>where
__CodecInputEdqy: Input,
fn decode<__CodecInputEdqy>(
__codec_input_edqy: &mut __CodecInputEdqy,
) -> Result<CryptoBytes<N, T>, Error>where
__CodecInputEdqy: Input,
Attempt to deserialise the value from input.
§fn decode_into<__CodecInputEdqy>(
__codec_input_edqy: &mut __CodecInputEdqy,
dst_: &mut MaybeUninit<CryptoBytes<N, T>>,
) -> Result<DecodeFinished, Error>where
__CodecInputEdqy: Input,
fn decode_into<__CodecInputEdqy>(
__codec_input_edqy: &mut __CodecInputEdqy,
dst_: &mut MaybeUninit<CryptoBytes<N, T>>,
) -> Result<DecodeFinished, Error>where
__CodecInputEdqy: Input,
Attempt to deserialize the value from input into a pre-allocated piece of memory. Read more
§fn skip<I>(input: &mut I) -> Result<(), Error>where
I: Input,
fn skip<I>(input: &mut I) -> Result<(), Error>where
I: Input,
Attempt to skip the encoded value from input. Read more
§fn encoded_fixed_size() -> Option<usize>
fn encoded_fixed_size() -> Option<usize>
Returns the fixed encoded size of the type. Read more
§impl<const N: usize, SubTag> Derive for CryptoBytes<N, (PublicTag, SubTag)>where
CryptoBytes<N, (PublicTag, SubTag)>: CryptoType,
impl<const N: usize, SubTag> Derive for CryptoBytes<N, (PublicTag, SubTag)>where
CryptoBytes<N, (PublicTag, SubTag)>: CryptoType,
§impl<'de, const N: usize, SubTag> Deserialize<'de> for CryptoBytes<N, (PublicTag, SubTag)>where
CryptoBytes<N, (PublicTag, SubTag)>: CryptoType,
impl<'de, const N: usize, SubTag> Deserialize<'de> for CryptoBytes<N, (PublicTag, SubTag)>where
CryptoBytes<N, (PublicTag, SubTag)>: CryptoType,
§fn deserialize<D>(
deserializer: D,
) -> Result<CryptoBytes<N, (PublicTag, SubTag)>, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D,
) -> Result<CryptoBytes<N, (PublicTag, SubTag)>, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
§impl<const N: usize, SubTag> Display for CryptoBytes<N, (PublicTag, SubTag)>where
CryptoBytes<N, (PublicTag, SubTag)>: CryptoType,
impl<const N: usize, SubTag> Display for CryptoBytes<N, (PublicTag, SubTag)>where
CryptoBytes<N, (PublicTag, SubTag)>: CryptoType,
§impl<const N: usize, T> Encode for CryptoBytes<N, T>where
PhantomData<fn() -> T>: Encode,
impl<const N: usize, T> Encode for CryptoBytes<N, T>where
PhantomData<fn() -> T>: Encode,
§fn encode_to<__CodecOutputEdqy>(
&self,
__codec_dest_edqy: &mut __CodecOutputEdqy,
)where
__CodecOutputEdqy: Output + ?Sized,
fn encode_to<__CodecOutputEdqy>(
&self,
__codec_dest_edqy: &mut __CodecOutputEdqy,
)where
__CodecOutputEdqy: Output + ?Sized,
Convert self to a slice and append it to the destination.
§fn using_encoded<R, F>(&self, f: F) -> R
fn using_encoded<R, F>(&self, f: F) -> R
Convert self to a slice and then invoke the given closure with it.
§fn encoded_size(&self) -> usize
fn encoded_size(&self) -> usize
Calculates the encoded size. Read more
§impl From<Public> for CryptoBytes<sp_core::::ed25519::Public::{constant#0}, (PublicTag, Ed25519Tag)>
impl From<Public> for CryptoBytes<sp_core::::ed25519::Public::{constant#0}, (PublicTag, Ed25519Tag)>
§impl<const N: usize, T> FromEntropy for CryptoBytes<N, T>
impl<const N: usize, T> FromEntropy for CryptoBytes<N, T>
§fn from_entropy(input: &mut impl Input) -> Result<CryptoBytes<N, T>, Error>
fn from_entropy(input: &mut impl Input) -> Result<CryptoBytes<N, T>, Error>
Create a random value of
Self
given a stream of random bytes on input
. May only fail if
input
has an error.§impl<const N: usize, SubTag> FromStr for CryptoBytes<N, (PublicTag, SubTag)>where
CryptoBytes<N, (PublicTag, SubTag)>: CryptoType,
impl<const N: usize, SubTag> FromStr for CryptoBytes<N, (PublicTag, SubTag)>where
CryptoBytes<N, (PublicTag, SubTag)>: CryptoType,
§impl IdentifyAccount for CryptoBytes<sp_core::::ed25519::Public::{constant#0}, (PublicTag, Ed25519Tag)>
impl IdentifyAccount for CryptoBytes<sp_core::::ed25519::Public::{constant#0}, (PublicTag, Ed25519Tag)>
§type AccountId = CryptoBytes<sp_core::::ed25519::Public::{constant#0}, (PublicTag, Ed25519Tag)>
type AccountId = CryptoBytes<sp_core::::ed25519::Public::{constant#0}, (PublicTag, Ed25519Tag)>
The account ID that this can be transformed into.
§fn into_account(
self,
) -> CryptoBytes<sp_core::::ed25519::Public::{constant#0}, (PublicTag, Ed25519Tag)>
fn into_account( self, ) -> CryptoBytes<sp_core::::ed25519::Public::{constant#0}, (PublicTag, Ed25519Tag)>
Transform into an account.
§impl<const N: usize, T> MaxEncodedLen for CryptoBytes<N, T>where
PhantomData<fn() -> T>: MaxEncodedLen,
impl<const N: usize, T> MaxEncodedLen for CryptoBytes<N, T>where
PhantomData<fn() -> T>: MaxEncodedLen,
§fn max_encoded_len() -> usize
fn max_encoded_len() -> usize
Upper bound, in bytes, of the maximum encoded size of this item.
§impl<const N: usize, T> Ord for CryptoBytes<N, T>
impl<const N: usize, T> Ord for CryptoBytes<N, T>
1.21.0 · 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
§impl<const N: usize, T> PartialOrd for CryptoBytes<N, T>
impl<const N: usize, T> PartialOrd for CryptoBytes<N, T>
§impl<const N: usize, T> PassByInner for CryptoBytes<N, T>
impl<const N: usize, T> PassByInner for CryptoBytes<N, T>
§fn into_inner(self) -> <CryptoBytes<N, T> as PassByInner>::Inner
fn into_inner(self) -> <CryptoBytes<N, T> as PassByInner>::Inner
Consumes
self
and returns the inner type.§fn inner(&self) -> &<CryptoBytes<N, T> as PassByInner>::Inner
fn inner(&self) -> &<CryptoBytes<N, T> as PassByInner>::Inner
Returns the reference to the inner type.
§fn from_inner(
inner: <CryptoBytes<N, T> as PassByInner>::Inner,
) -> CryptoBytes<N, T>
fn from_inner( inner: <CryptoBytes<N, T> as PassByInner>::Inner, ) -> CryptoBytes<N, T>
Construct
Self
from the given inner
.§impl RuntimePublic for CryptoBytes<sp_core::::ed25519::Public::{constant#0}, (PublicTag, Ed25519Tag)>
impl RuntimePublic for CryptoBytes<sp_core::::ed25519::Public::{constant#0}, (PublicTag, Ed25519Tag)>
§type Signature = CryptoBytes<sp_core::::ed25519::Signature::{constant#0}, (SignatureTag, Ed25519Tag)>
type Signature = CryptoBytes<sp_core::::ed25519::Signature::{constant#0}, (SignatureTag, Ed25519Tag)>
The signature that will be generated when signing with the corresponding private key.
§fn all(
key_type: KeyTypeId,
) -> Vec<CryptoBytes<sp_core::::ed25519::Public::{constant#0}, (PublicTag, Ed25519Tag)>>
fn all( key_type: KeyTypeId, ) -> Vec<CryptoBytes<sp_core::::ed25519::Public::{constant#0}, (PublicTag, Ed25519Tag)>>
Returns all public keys for the given key type in the keystore.
§fn generate_pair(
key_type: KeyTypeId,
seed: Option<Vec<u8>>,
) -> CryptoBytes<sp_core::::ed25519::Public::{constant#0}, (PublicTag, Ed25519Tag)>
fn generate_pair( key_type: KeyTypeId, seed: Option<Vec<u8>>, ) -> CryptoBytes<sp_core::::ed25519::Public::{constant#0}, (PublicTag, Ed25519Tag)>
Generate a public/private pair for the given key type with an optional
seed
and
store it in the keystore. Read more§fn sign<M>(
&self,
key_type: KeyTypeId,
msg: &M,
) -> Option<<CryptoBytes<sp_core::::ed25519::Public::{constant#0}, (PublicTag, Ed25519Tag)> as RuntimePublic>::Signature>
fn sign<M>( &self, key_type: KeyTypeId, msg: &M, ) -> Option<<CryptoBytes<sp_core::::ed25519::Public::{constant#0}, (PublicTag, Ed25519Tag)> as RuntimePublic>::Signature>
Sign the given message with the corresponding private key of this public key. Read more
§fn verify<M>(
&self,
msg: &M,
signature: &<CryptoBytes<sp_core::::ed25519::Public::{constant#0}, (PublicTag, Ed25519Tag)> as RuntimePublic>::Signature,
) -> bool
fn verify<M>( &self, msg: &M, signature: &<CryptoBytes<sp_core::::ed25519::Public::{constant#0}, (PublicTag, Ed25519Tag)> as RuntimePublic>::Signature, ) -> bool
Verify that the given signature matches the given message using this public key.
§fn to_raw_vec(&self) -> Vec<u8> ⓘ
fn to_raw_vec(&self) -> Vec<u8> ⓘ
Returns
Self
as raw vec.§impl<const N: usize, SubTag> Serialize for CryptoBytes<N, (PublicTag, SubTag)>where
CryptoBytes<N, (PublicTag, SubTag)>: CryptoType,
impl<const N: usize, SubTag> Serialize for CryptoBytes<N, (PublicTag, SubTag)>where
CryptoBytes<N, (PublicTag, SubTag)>: CryptoType,
§fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
Serialize this value into the given Serde serializer. Read more
§impl TryFrom<MultiSigner> for CryptoBytes<sp_core::::ed25519::Public::{constant#0}, (PublicTag, Ed25519Tag)>
impl TryFrom<MultiSigner> for CryptoBytes<sp_core::::ed25519::Public::{constant#0}, (PublicTag, Ed25519Tag)>
§impl<const N: usize, T> UncheckedFrom<[u8; N]> for CryptoBytes<N, T>
impl<const N: usize, T> UncheckedFrom<[u8; N]> for CryptoBytes<N, T>
§fn unchecked_from(data: [u8; N]) -> CryptoBytes<N, T>
fn unchecked_from(data: [u8; N]) -> CryptoBytes<N, T>
Convert from an instance of
T
to Self. This is not guaranteed to be
whatever counts as a valid instance of T
and it’s up to the caller to
ensure that it makes sense.§impl<T> UncheckedFrom<H256> for CryptoBytes<32, T>
impl<T> UncheckedFrom<H256> for CryptoBytes<32, T>
§fn unchecked_from(x: H256) -> CryptoBytes<32, T>
fn unchecked_from(x: H256) -> CryptoBytes<32, T>
Convert from an instance of
T
to Self. This is not guaranteed to be
whatever counts as a valid instance of T
and it’s up to the caller to
ensure that it makes sense.