pub struct Keypair(_);Expand description
A vanilla Ed25519 key pair
Implementations
impl Keypair
impl Keypair
pub fn generate<R>(csprng: &mut R) -> Keypairwhere
R: CryptoRng + RngCore,
pub fn generate<R>(csprng: &mut R) -> Keypairwhere
R: CryptoRng + RngCore,
Constructs a new, random Keypair using a caller-proveded RNG
pub fn from_bytes(bytes: &[u8]) -> Result<Keypair, Error>
pub fn from_bytes(bytes: &[u8]) -> Result<Keypair, Error>
Recovers a Keypair from a byte array
pub fn from_base58_string(s: &str) -> Keypair
pub fn from_base58_string(s: &str) -> Keypair
Recovers a Keypair from a base58-encoded string
pub fn to_base58_string(&self) -> String
pub fn to_base58_string(&self) -> String
Returns this Keypair as a base58-encoded string
pub fn secret(&self) -> &SecretKey
pub fn secret(&self) -> &SecretKey
Gets this Keypair’s SecretKey
Trait Implementations
impl FromWasmAbi for Keypair
impl FromWasmAbi for Keypair
impl IntoWasmAbi for Keypair
impl IntoWasmAbi for Keypair
impl OptionFromWasmAbi for Keypair
impl OptionFromWasmAbi for Keypair
impl OptionIntoWasmAbi for Keypair
impl OptionIntoWasmAbi for Keypair
fn none() -> <Keypair as IntoWasmAbi>::Abi
fn none() -> <Keypair as IntoWasmAbi>::Abi
Returns an ABI instance indicating “none”, which JS will interpret as
the
None branch of this option. Read moreimpl RefFromWasmAbi for Keypair
impl RefFromWasmAbi for Keypair
type Anchor = Ref<'static, Keypair>
type Anchor = Ref<'static, 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. Read moreunsafe 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
impl RefMutFromWasmAbi for Keypair
impl RefMutFromWasmAbi for Keypair
unsafe fn ref_mut_from_abi(
js: <Keypair as RefMutFromWasmAbi>::Abi
) -> <Keypair as RefMutFromWasmAbi>::Anchor
unsafe fn ref_mut_from_abi(
js: <Keypair as RefMutFromWasmAbi>::Abi
) -> <Keypair as RefMutFromWasmAbi>::Anchor
Same as
RefFromWasmAbi::ref_from_abiimpl Signer for Keypair
impl Signer for Keypair
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. Read morefn try_pubkey(&self) -> Result<Pubkey, SignerError>
fn try_pubkey(&self) -> Result<Pubkey, SignerError>
Fallibly gets the implementor’s public key
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. Read morefn 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.fn is_interactive(&self) -> bool
fn is_interactive(&self) -> bool
Whether the impelmentation requires user interaction to sign
Auto Trait Implementations
impl RefUnwindSafe for Keypair
impl Send for Keypair
impl Sync for Keypair
impl Unpin for Keypair
impl UnwindSafe for Keypair
Blanket Implementations
impl<T> AbiExample for T
impl<T> AbiExample for T
default fn example() -> T
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<T> Pointable for T
impl<T> Pointable for T
sourceimpl<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::Abisourcefn 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. Read more