Struct solana_sdk::signer::keypair::Keypair[][src]

pub struct Keypair(_);
Expand description

A vanilla Ed25519 key pair

Implementations

impl Keypair[src]

pub fn generate<R>(csprng: &mut R) -> Self where
    R: CryptoRng + RngCore
[src]

Constructs a new, random Keypair using a caller-proveded RNG

pub fn new() -> Self[src]

Constructs a new, random Keypair using OsRng

pub fn from_bytes(bytes: &[u8]) -> Result<Self, SignatureError>[src]

Recovers a Keypair from a byte array

pub fn to_bytes(&self) -> [u8; 64][src]

Returns this Keypair as a byte array

pub fn from_base58_string(s: &str) -> Self[src]

Recovers a Keypair from a base58-encoded string

pub fn to_base58_string(&self) -> String[src]

Returns this Keypair as a base58-encoded string

pub fn secret(&self) -> &SecretKey[src]

Gets this Keypair’s SecretKey

Trait Implementations

impl Debug for Keypair[src]

fn fmt(&self, f: &mut Formatter<'_>) -> Result[src]

Formats the value using the given formatter. Read more

impl<T> PartialEq<T> for Keypair where
    T: Signer
[src]

fn eq(&self, other: &T) -> bool[src]

This method tests for self and other values to be equal, and is used by ==. Read more

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests for !=.

impl Signer for Keypair[src]

fn pubkey(&self) -> Pubkey[src]

Infallibly gets the implementor’s public key. Returns the all-zeros Pubkey if the implementor has none. Read more

fn try_pubkey(&self) -> Result<Pubkey, SignerError>[src]

Fallibly gets the implementor’s public key

fn sign_message(&self, message: &[u8]) -> Signature[src]

Infallibly produces an Ed25519 signature over the provided message bytes. Returns the all-zeros Signature if signing is not possible. Read more

fn try_sign_message(&self, message: &[u8]) -> Result<Signature, SignerError>[src]

Fallibly produces an Ed25519 signature over the provided message bytes.

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[src]

pub default fn example() -> T[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

pub fn vzip(self) -> V