[][src]Struct stellar_base::KeyPair

pub struct KeyPair { /* fields omitted */ }

The secret and public key pair of the account.

Implementations

impl KeyPair[src]

pub fn from_secret_seed(data: &str) -> Result<KeyPair>[src]

Create the key pair from the secret seed, e.g. SDAKFNYEIAORZKKCYRILFQKLLOCNPL5SWJ3YY5NM3ZH6GJSZGXHZEPQS.

pub fn random() -> Result<KeyPair>[src]

Create a random key pair.

pub fn from_network(network: &Network) -> Result<KeyPair>[src]

Create a key pair from the network passphrase.

pub fn from_seed_bytes(data: &[u8]) -> Result<KeyPair>[src]

Crete a key pair from raw bytes.

pub fn public_key(&self) -> &PublicKey[src]

Return the public key.

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

Return the secret key.

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

Sign the message.

pub fn sign_decorated(&self, message: &[u8]) -> DecoratedSignature[src]

Sign the message together with the signature hint.

pub fn verify(&self, message: &[u8], signature: &Signature) -> bool[src]

Verify the signature against the message.

pub fn signature_hint(&self) -> SignatureHint[src]

Return the signature hint, that is the last 4 bytes of the public key.

Trait Implementations

impl Clone for KeyPair[src]

impl Debug for KeyPair[src]

impl Eq for KeyPair[src]

impl FromStr for KeyPair[src]

type Err = Error

The associated error which can be returned from parsing.

impl PartialEq<KeyPair> for KeyPair[src]

impl StructuralEq for KeyPair[src]

impl StructuralPartialEq for KeyPair[src]

Auto Trait Implementations

Blanket Implementations

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

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

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

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

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

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.

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.