pub struct Keypair(_);
Expand description
A vanilla Ed25519 key pair
Implementations
sourceimpl Keypair
impl Keypair
sourcepub fn generate<R>(csprng: &mut R) -> Self where
R: CryptoRng + RngCore,
pub fn generate<R>(csprng: &mut R) -> Self where
R: CryptoRng + RngCore,
Constructs a new, random Keypair
using a caller-proveded RNG
sourcepub fn from_bytes(bytes: &[u8]) -> Result<Self, SignatureError>
pub fn from_bytes(bytes: &[u8]) -> Result<Self, SignatureError>
Recovers a Keypair
from a byte array
sourcepub fn from_base58_string(s: &str) -> Self
pub fn from_base58_string(s: &str) -> Self
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
sourceimpl FromWasmAbi for Keypair
impl FromWasmAbi for Keypair
sourceimpl IntoWasmAbi for Keypair
impl IntoWasmAbi for Keypair
sourceimpl OptionFromWasmAbi for Keypair
impl OptionFromWasmAbi for Keypair
sourceimpl OptionIntoWasmAbi for Keypair
impl OptionIntoWasmAbi for Keypair
sourceimpl 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 more
sourceunsafe fn ref_from_abi(js: Self::Abi) -> Self::Anchor
unsafe fn ref_from_abi(js: Self::Abi) -> Self::Anchor
Recover a Self::Anchor
from Self::Abi
. Read more
sourceimpl RefMutFromWasmAbi for Keypair
impl RefMutFromWasmAbi for Keypair
sourceimpl Signer for Keypair
impl Signer for Keypair
sourcefn 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 more
sourcefn try_pubkey(&self) -> Result<Pubkey, SignerError>
fn try_pubkey(&self) -> Result<Pubkey, SignerError>
Fallibly gets the implementor’s public key
sourcefn 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 more
sourcefn 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.
sourcefn 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
sourceimpl<T> AbiExample for T
impl<T> AbiExample for T
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
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
impl<T> Pointable for T
impl<T> Pointable for T
sourceimpl<T> ReturnWasmAbi for T where
T: IntoWasmAbi,
impl<T> ReturnWasmAbi for T where
T: IntoWasmAbi,
type Abi = <T as IntoWasmAbi>::Abi
type Abi = <T as IntoWasmAbi>::Abi
Same as IntoWasmAbi::Abi
sourcefn 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