pub struct KeyPair { /* private fields */ }
Expand description
The secret and public key pair of the account.
Implementations§
Source§impl KeyPair
impl KeyPair
Sourcepub fn from_secret_seed(data: &str) -> Result<KeyPair>
pub fn from_secret_seed(data: &str) -> Result<KeyPair>
Create the key pair from the secret seed, e.g. SDAKFNYEIAORZKKCYRILFQKLLOCNPL5SWJ3YY5NM3ZH6GJSZGXHZEPQS
.
Sourcepub fn from_network(network: &Network) -> Result<KeyPair>
pub fn from_network(network: &Network) -> Result<KeyPair>
Create a key pair from the network
passphrase.
Sourcepub fn from_seed_bytes(data: &[u8]) -> Result<KeyPair>
pub fn from_seed_bytes(data: &[u8]) -> Result<KeyPair>
Crete a key pair from raw bytes.
Sourcepub fn public_key(&self) -> &PublicKey
pub fn public_key(&self) -> &PublicKey
Return the public key.
Sourcepub fn secret_key(&self) -> &SecretKey
pub fn secret_key(&self) -> &SecretKey
Return the secret key.
Sourcepub fn sign_decorated(&self, message: &[u8]) -> DecoratedSignature
pub fn sign_decorated(&self, message: &[u8]) -> DecoratedSignature
Sign the message
together with the signature hint.
Sourcepub fn verify(&self, message: &[u8], signature: &Signature) -> bool
pub fn verify(&self, message: &[u8], signature: &Signature) -> bool
Verify the signature
against the message
.
Sourcepub fn signature_hint(&self) -> SignatureHint
pub fn signature_hint(&self) -> SignatureHint
Return the signature hint, that is the last 4 bytes of the public key.
Trait Implementations§
impl Eq for KeyPair
impl StructuralPartialEq for KeyPair
Auto Trait Implementations§
impl Freeze for KeyPair
impl RefUnwindSafe for KeyPair
impl Send for KeyPair
impl Sync for KeyPair
impl Unpin for KeyPair
impl UnwindSafe for KeyPair
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more