[−][src]Struct cryptoballot::ElectionTransaction
Transaction 1: Election
Fields
id: Identifier
Election Authority Public Key
The election authority's public key should be posted in a trusted and well-known location.
If using sawtooth, before you can post an Election transation,
you must register an Election Authority's public key via sawset
.
encryption_public: EciesPublicKey
Election public key for encrypting votes. It is an uncompressed secp256k1::PublicKey
.
This public key is used to encrypt all votes using ECIES encryption. This keeps all the votes secret until the trustees post SecretShare transaction to allow decryption of the voters after the election is over.
After generating the keypair, the secret should be distributed to the trustees using Shamir Secret Sharing and then destroyed.
Future plans include moving to Distributed key generation, so no one entity ever has the secret key, even temporarily.
ballots: Vec<Uuid>
List of ballots that can be cast in this election
trustees: Vec<Trustee>
List of trustees that have been given a secret key share
trustees_threshold: u8
Minimum number of trustees needed to reconstruct the secret key and decrypt votes.
authenticators: Vec<Authenticator>
Authenticators who can authenticate voters
authenticators_threshold: u8
Mininum number of authenticators that might provide a signature for a voter for that voter to post a Vote transaction.
Methods
impl ElectionTransaction
[src]
pub fn new(authority_public: PublicKey) -> (Self, SecretKey)
[src]
Create a new ElectionTransaction
The returned SecretKey should be distributed to the trustees using Shamir Secret Sharing
pub fn get_ballot(&self, ballot_id: Uuid) -> Option<()>
[src]
Get a ballot with the given ID
pub fn get_authenticator(&self, authn_id: Uuid) -> Option<&Authenticator>
[src]
Get an authenticator with the given ID
pub fn get_trustee(&self, trustee_id: Uuid) -> Option<&Trustee>
[src]
Get a trustee with the given ID
Trait Implementations
impl AsRef<ElectionTransaction> for SignedTransaction
[src]
fn as_ref(&self) -> &ElectionTransaction
[src]
impl Clone for ElectionTransaction
[src]
fn clone(&self) -> ElectionTransaction
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for ElectionTransaction
[src]
impl<'de> Deserialize<'de> for ElectionTransaction
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl Serialize for ElectionTransaction
[src]
Auto Trait Implementations
impl RefUnwindSafe for ElectionTransaction
impl Send for ElectionTransaction
impl Sync for ElectionTransaction
impl Unpin for ElectionTransaction
impl UnwindSafe for ElectionTransaction
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,
[src]
T: Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,