Struct solana_sdk::signer::keypair::Keypair
source · pub struct Keypair(_);
Expand description
A vanilla Ed25519 key pair
Implementations§
source§impl Keypair
impl Keypair
sourcepub fn generate<R>(csprng: &mut R) -> Selfwhere
R: CryptoRng + RngCore,
pub fn generate<R>(csprng: &mut R) -> Selfwhere R: CryptoRng + RngCore,
Constructs a new, random Keypair
using a caller-provided 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§
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§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
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> Pointable for T
impl<T> Pointable for T
source§impl<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::Abi
source§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
.