pub enum AccountSecretKey {
Ed25519(Ed25519SecretKey),
Secp256k1(Secp256k1SecretKey),
EvmSecp256k1(EvmSecretKey),
}Expand description
The private key of a chain owner.
Variants§
Ed25519(Ed25519SecretKey)
Ed25519 secret key.
Secp256k1(Secp256k1SecretKey)
secp256k1 secret key.
EvmSecp256k1(EvmSecretKey)
EVM secp256k1 secret key.
Implementations§
Source§impl AccountSecretKey
impl AccountSecretKey
Sourcepub fn public(&self) -> AccountPublicKey
pub fn public(&self) -> AccountPublicKey
Returns the public key corresponding to this secret key.
Sourcepub fn sign<'de, T>(&self, value: &T) -> AccountSignaturewhere
T: BcsSignable<'de>,
pub fn sign<'de, T>(&self, value: &T) -> AccountSignaturewhere
T: BcsSignable<'de>,
Creates a signature for the value using provided secret.
Sourcepub fn sign_prehash(&self, value: CryptoHash) -> AccountSignature
pub fn sign_prehash(&self, value: CryptoHash) -> AccountSignature
Creates a signature for the value.
Sourcepub fn generate_from<R: CryptoRng>(rng: &mut R) -> Self
pub fn generate_from<R: CryptoRng>(rng: &mut R) -> Self
Generates a new Ed25519 key pair from the given RNG. Use with care.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for AccountSecretKey
impl<'de> Deserialize<'de> for AccountSecretKey
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
Auto Trait Implementations§
impl Freeze for AccountSecretKey
impl RefUnwindSafe for AccountSecretKey
impl Send for AccountSecretKey
impl Sync for AccountSecretKey
impl Unpin for AccountSecretKey
impl UnwindSafe for AccountSecretKey
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<Choices> CoproductSubsetter<CNil, HNil> for Choices
impl<Choices> CoproductSubsetter<CNil, HNil> for Choices
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<M, I> RuntimeMemory<&mut I> for Mwhere
M: RuntimeMemory<I>,
impl<M, I> RuntimeMemory<&mut I> for Mwhere
M: RuntimeMemory<I>,
Source§fn read<'instance>(
&self,
instance: &'instance &mut I,
location: GuestPointer,
length: u32,
) -> Result<Cow<'instance, [u8]>, RuntimeError>
fn read<'instance>( &self, instance: &'instance &mut I, location: GuestPointer, length: u32, ) -> Result<Cow<'instance, [u8]>, RuntimeError>
Reads length bytes from memory from the provided location.
Source§fn write(
&mut self,
instance: &mut &mut I,
location: GuestPointer,
bytes: &[u8],
) -> Result<(), RuntimeError>
fn write( &mut self, instance: &mut &mut I, location: GuestPointer, bytes: &[u8], ) -> Result<(), RuntimeError>
Writes the bytes to memory at the provided location.