pub struct Keypair(/* private fields */);Expand description
A vanilla Ed25519 key pair
Implementations§
Source§impl Keypair
impl Keypair
Sourcepub fn generate<R>(csprng: &mut R) -> Keypair
pub fn generate<R>(csprng: &mut R) -> Keypair
Constructs a new, random Keypair using a caller-proveded RNG
Sourcepub fn from_base58_string(s: &str) -> Keypair
pub fn from_base58_string(s: &str) -> Keypair
Recovers a Keypair from a base58-encoded string
Sourcepub fn to_base58_string(&self) -> String
pub fn to_base58_string(&self) -> String
Returns this Keypair as a base58-encoded string
Trait Implementations§
Source§impl FromWasmAbi for Keypair
impl FromWasmAbi for Keypair
Source§impl IntoWasmAbi for Keypair
impl IntoWasmAbi for Keypair
Source§impl LongRefFromWasmAbi for Keypair
impl LongRefFromWasmAbi for Keypair
Source§impl OptionFromWasmAbi for Keypair
impl OptionFromWasmAbi for Keypair
Source§impl OptionIntoWasmAbi for Keypair
impl OptionIntoWasmAbi for Keypair
Source§impl RefFromWasmAbi for Keypair
impl RefFromWasmAbi for Keypair
Source§type Anchor = RcRef<Keypair>
type Anchor = RcRef<Keypair>
The type that holds the reference to
Self for the duration of the
invocation of the function that has an &Self parameter. This is
required to ensure that the lifetimes don’t persist beyond one function
call, and so that they remain anonymous.Source§unsafe fn ref_from_abi(
js: <Keypair as RefFromWasmAbi>::Abi,
) -> <Keypair as RefFromWasmAbi>::Anchor
unsafe fn ref_from_abi( js: <Keypair as RefFromWasmAbi>::Abi, ) -> <Keypair as RefFromWasmAbi>::Anchor
Source§impl RefMutFromWasmAbi for Keypair
impl RefMutFromWasmAbi for Keypair
Source§impl Signer for Keypair
impl Signer for Keypair
Source§fn pubkey(&self) -> Pubkey
fn pubkey(&self) -> Pubkey
Infallibly gets the implementor’s public key. Returns the all-zeros
Pubkey if the implementor has none.Source§fn try_pubkey(&self) -> Result<Pubkey, SignerError>
fn try_pubkey(&self) -> Result<Pubkey, SignerError>
Fallibly gets the implementor’s public key
Source§fn sign_message(&self, message: &[u8]) -> Signature
fn sign_message(&self, message: &[u8]) -> Signature
Infallibly produces an Ed25519 signature over the provided
message
bytes. Returns the all-zeros Signature if signing is not possible.Source§fn try_sign_message(&self, message: &[u8]) -> Result<Signature, SignerError>
fn try_sign_message(&self, message: &[u8]) -> Result<Signature, SignerError>
Fallibly produces an Ed25519 signature over the provided
message bytes.Source§fn is_interactive(&self) -> bool
fn is_interactive(&self) -> bool
Whether the impelmentation requires user interaction to sign
Source§impl TryFromJsValue for Keypair
impl TryFromJsValue for Keypair
Source§impl VectorFromWasmAbi for Keypair
impl VectorFromWasmAbi for Keypair
type Abi = <Box<[JsValue]> as FromWasmAbi>::Abi
unsafe fn vector_from_abi( js: <Keypair as VectorFromWasmAbi>::Abi, ) -> Box<[Keypair]>
Source§impl VectorIntoWasmAbi for Keypair
impl VectorIntoWasmAbi for Keypair
type Abi = <Box<[JsValue]> as IntoWasmAbi>::Abi
fn vector_into_abi( vector: Box<[Keypair]>, ) -> <Keypair as VectorIntoWasmAbi>::Abi
Auto Trait Implementations§
impl Freeze for Keypair
impl RefUnwindSafe for Keypair
impl Send for Keypair
impl Sync for Keypair
impl Unpin for Keypair
impl UnwindSafe for Keypair
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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<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<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
Source§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.