pub enum VerificationStrategy {
CreativeIntegrity,
AuthoritativeIntegrity,
GreedyVerification,
ExhaustiveVerification,
MultipleAttestation(Vec<SignatureRole>),
MultipleAttestationGreedy(Vec<SignatureRole>),
}Expand description
This enumerates the verifications strategies described in the signing spec.
Variants§
CreativeIntegrity
CreativeIntegrity verifies that (a) the key that signs as Creator is a known key, and that the signature is valid.
AuthoritativeIntegrity
AuthoritativeIntegrity verifies that at least one of the Creator or Approver keys is known and the signature is valid.
GreedyVerification
Verify that the Creator key is known and that all signatures are valid.
This is subject to a DOS attack if a signer can generate intentionally bad signatures.
ExhaustiveVerification
Verify that every key on the invoice is known, and that every signature is valid.
MultipleAttestation(Vec<SignatureRole>)
Verifies that all signatures of the given roles are valid and signed by known keys.
MultipleAttestationGreedy(Vec<SignatureRole>)
Verifies that all signatures of the given roles are valid and signed by known keys. Will also validate unknown signers similar to GreedyVerification
Unknown signers will also be validated. Be aware that doing so may make the validation subject to a special form of DOS attack in which someone can generate a known-bad signature.
Implementations§
Source§impl VerificationStrategy
A strategy for verifying an invoice.
impl VerificationStrategy
A strategy for verifying an invoice.
Sourcepub fn verify<I>(
&self,
invoice: I,
keyring: &KeyRing,
) -> Result<VerifiedInvoice<I>, SignatureError>
pub fn verify<I>( &self, invoice: I, keyring: &KeyRing, ) -> Result<VerifiedInvoice<I>, SignatureError>
Verify that every signature on this invoice is correct.
The verification strategy will determine how this verification is performed.
Depending on the selected strategy, the [[signature]] blocks will be evaluated
for the following:
- Is the key in the keyring?
- Can the signature be verified?
Note that the purpose of the keyring is to ensure that we know about the entity that claims to have signed the invoice.
If no signatures are on the invoice, this will succeed.
A strategy will determine success or failure based on whether the signature is verified, whether the keys are known, whether the requisite number/roles are satisfied, and so on.
Trait Implementations§
Source§impl Clone for VerificationStrategy
impl Clone for VerificationStrategy
Source§fn clone(&self) -> VerificationStrategy
fn clone(&self) -> VerificationStrategy
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for VerificationStrategy
impl Debug for VerificationStrategy
Source§impl Default for VerificationStrategy
impl Default for VerificationStrategy
Source§impl<'de> Deserialize<'de> for VerificationStrategy
Manual implementation of deserialize due to TOML not supporting “newtype” enum variants. This
deserializes using the same parsing rules as FromStr
impl<'de> Deserialize<'de> for VerificationStrategy
Manual implementation of deserialize due to TOML not supporting “newtype” enum variants. This
deserializes using the same parsing rules as FromStr
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Source§impl FromStr for VerificationStrategy
This implementation will parse the strategy from a string. MultipleAttestation strategies should
be of the format MultipleAttestation[Creator, Approver]
impl FromStr for VerificationStrategy
This implementation will parse the strategy from a string. MultipleAttestation strategies should
be of the format MultipleAttestation[Creator, Approver]
Auto Trait Implementations§
impl Freeze for VerificationStrategy
impl RefUnwindSafe for VerificationStrategy
impl Send for VerificationStrategy
impl Sync for VerificationStrategy
impl Unpin for VerificationStrategy
impl UnwindSafe for VerificationStrategy
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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