[][src]Struct cryptoballot::Signed

pub struct Signed<T: Signable + Serialize> {
    pub tx: T,
    pub sig: Signature,
}

A generic signed transaction

Fields

tx: Tsig: Signature

Methods

impl<T: Signable + Serialize> Signed<T>[src]

pub fn sign(secret: &SecretKey, transaction: T) -> Result<Self, Error>[src]

Sign a transaction, producing a Signed

pub fn verify_signature(&self) -> Result<(), ValidationError>[src]

Verify the signature on a signed transaction

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

Get the inner unsigned transaction

pub fn id(&self) -> Identifier[src]

Get the transaction ID

pub fn validate<S: Store>(&self, store: &S) -> Result<(), ValidationError>[src]

Verify the signature and validate the transaction

Trait Implementations

impl<T: Signable + Serialize> AsRef<T> for Signed<T>[src]

impl<T: Clone + Signable + Serialize> Clone for Signed<T>[src]

impl<T: Debug + Signable + Serialize> Debug for Signed<T>[src]

impl<T: Signable + Serialize> Deref for Signed<T>[src]

type Target = T

The resulting type after dereferencing.

impl<'de, T: Signable + Serialize> Deserialize<'de> for Signed<T> where
    T: Deserialize<'de>, 
[src]

impl From<Signed<DecryptionTransaction>> for SignedTransaction[src]

impl From<Signed<ElectionTransaction>> for SignedTransaction[src]

impl From<Signed<SecretShareTransaction>> for SignedTransaction[src]

impl From<Signed<VoteTransaction>> for SignedTransaction[src]

impl From<SignedTransaction> for Signed<ElectionTransaction>[src]

impl From<SignedTransaction> for Signed<VoteTransaction>[src]

impl From<SignedTransaction> for Signed<DecryptionTransaction>[src]

impl From<SignedTransaction> for Signed<SecretShareTransaction>[src]

impl<T: Signable + Serialize> Serialize for Signed<T> where
    T: Serialize
[src]

Auto Trait Implementations

impl<T> RefUnwindSafe for Signed<T> where
    T: RefUnwindSafe

impl<T> Send for Signed<T> where
    T: Send

impl<T> Sync for Signed<T> where
    T: Sync

impl<T> Unpin for Signed<T> where
    T: Unpin

impl<T> UnwindSafe for Signed<T> where
    T: UnwindSafe

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> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]

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

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

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToHex for T where
    T: AsRef<[u8]>, 
[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.

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