[][src]Struct stellar_base::signature::Signature

pub struct Signature { /* fields omitted */ }

A signature.

Implementations

impl Signature[src]

pub fn sign(secret: &SecretKey, data: &[u8]) -> Signature[src]

Sign data using the secret key.

pub fn from_slice(sb: &[u8]) -> Result<Signature>[src]

Return a Signature from bytes.

pub fn len(&self) -> usize[src]

Length in bytes of the signature.

pub fn is_empty(&self) -> bool[src]

Returns true if the signature has no bytes.

pub fn to_vec(&self) -> Vec<u8>[src]

Convert to Vec<u8>.

pub fn buf(&self) -> &[u8][src]

Inner buffer as slice.

pub fn verify(&self, public: &PublicKey, data: &[u8]) -> bool[src]

Verify the signature againt the data and the public key. Return true if the signature is valid, false otherwise.

pub fn to_xdr(&self) -> Result<Signature>[src]

pub fn from_xdr(x: &Signature) -> Result<Signature>[src]

Trait Implementations

impl Clone for Signature[src]

impl Debug for Signature[src]

impl Eq for Signature[src]

impl PartialEq<Signature> for Signature[src]

impl StructuralEq for Signature[src]

impl StructuralPartialEq for Signature[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.