pub struct Prover {}
Expand description
This struct represents a Prover who receives signatures or proves with them. Provided are methods for 2PC where some are only known to the prover and a blind signature is created, unblinding signatures, verifying signatures, and creating signature proofs of knowledge with selective disclosure proofs
Implementations§
Source§impl Prover
impl Prover
Sourcepub fn new_link_secret() -> SignatureMessage
pub fn new_link_secret() -> SignatureMessage
Generate a unique message that will be used across multiple signatures.
This link_secret
is the same in all signatures and allows a prover to demonstrate
that signatures were issued to the same identity. This value should be a blinded
message in all signatures and never revealed to anyone.
Sourcepub fn new_blind_signature_context(
verkey: &PublicKey,
messages: &BTreeMap<usize, SignatureMessage>,
nonce: &ProofNonce,
) -> Result<(BlindSignatureContext, SignatureBlinding), BBSError>
pub fn new_blind_signature_context( verkey: &PublicKey, messages: &BTreeMap<usize, SignatureMessage>, nonce: &ProofNonce, ) -> Result<(BlindSignatureContext, SignatureBlinding), BBSError>
Create the structures need to send to an issuer to complete a blinded signature
Sourcepub fn complete_signature(
verkey: &PublicKey,
messages: &[SignatureMessage],
blind_signature: &BlindSignature,
blinding_factor: &SignatureBlinding,
) -> Result<Signature, BBSError>
pub fn complete_signature( verkey: &PublicKey, messages: &[SignatureMessage], blind_signature: &BlindSignature, blinding_factor: &SignatureBlinding, ) -> Result<Signature, BBSError>
Unblinds and verifies a signature received from an issuer
Sourcepub fn commit_signature_pok(
request: &ProofRequest,
proof_messages: &[ProofMessage],
signature: &Signature,
) -> Result<PoKOfSignature, BBSError>
pub fn commit_signature_pok( request: &ProofRequest, proof_messages: &[ProofMessage], signature: &Signature, ) -> Result<PoKOfSignature, BBSError>
Create a new signature proof of knowledge and selective disclosure proof from a verifier’s request
§Arguments
request
- Proof request from verifierproof_messages
- If blinding_factor is Some(Nonce) then it will use that. If None, a blinding factor will be generated at random.
Sourcepub fn create_challenge_hash(
pok_sigs: &[PoKOfSignature],
claims: Option<&[&[u8]]>,
nonce: &ProofNonce,
) -> Result<ProofChallenge, BBSError>
pub fn create_challenge_hash( pok_sigs: &[PoKOfSignature], claims: Option<&[&[u8]]>, nonce: &ProofNonce, ) -> Result<ProofChallenge, BBSError>
Create the challenge hash for a set of proofs
§Arguments
poks
- a vec of PoKOfSignature objectsnonce
- a SignatureNonceclaims
- an optional slice of bytes the prover wishes to include in the challenge
Sourcepub fn generate_signature_pok(
pok_sig: PoKOfSignature,
challenge: &ProofChallenge,
) -> Result<SignatureProof, BBSError>
pub fn generate_signature_pok( pok_sig: PoKOfSignature, challenge: &ProofChallenge, ) -> Result<SignatureProof, BBSError>
Convert the a committed proof of signature knowledge to the proof
Auto Trait Implementations§
impl Freeze for Prover
impl RefUnwindSafe for Prover
impl Send for Prover
impl Sync for Prover
impl Unpin for Prover
impl UnwindSafe for Prover
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more