From e7667b8d91edb100a696fb6e6ac72ba31fb79ed2 Mon Sep 17 00:00:00 2001 From: Justus Winter Date: Fri, 24 Jul 2020 12:00:26 +0200 Subject: openpgp: Clarify what happens when verifying detached signatures. - See #471. --- openpgp/src/parse/stream.rs | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/openpgp/src/parse/stream.rs b/openpgp/src/parse/stream.rs index c1d5269d..980ef37f 100644 --- a/openpgp/src/parse/stream.rs +++ b/openpgp/src/parse/stream.rs @@ -742,6 +742,13 @@ pub trait VerificationHelper { /// [`Verifier::message_processed`]: struct.Verifier.html#method.message_processed /// [`Decryptor::message_processed`]: struct.Decryptor.html#method.message_processed /// + /// When verifying a detached signature using the + /// [`DetachedVerifier`], this method will be called with a + /// [`MessageStructure`] containing exactly one layer, a signature + /// group. + /// + /// [`DetachedVerifier`]: struct.DetachedVerifier.html + /// /// # Examples /// /// This example demonstrates how to verify that the message is an @@ -1276,9 +1283,14 @@ impl<'a, H: VerificationHelper> io::Read for Verifier<'a, H> { /// [`Parse`]: ../trait.Parse.html /// /// See [`GoodChecksum`] for what it means for a signature to be -/// considered valid. +/// considered valid. When the signature(s) are processed, +/// [`VerificationHelper::check`] will be called with a +/// [`MessageStructure`] containing exactly one layer, a signature +/// group. /// /// [`GoodChecksum`]: struct.GoodChecksum.html +/// [`VerificationHelper::check`]: trait.VerificationHelper.html#tymethod.check +/// [`MessageStructure`]: struct.MessageStructure.html /// /// # Examples /// @@ -1432,8 +1444,13 @@ impl<'a> DetachedVerifierBuilder<'a> { /// Signature verifications are done under the given `policy` and /// relative to time `time`, or the current time, if `time` is /// `None`. `helper` is the [`VerificationHelper`] to use. + /// [`VerificationHelper::check`] will be called with a + /// [`MessageStructure`] containing exactly one layer, a signature + /// group. /// /// [`VerificationHelper`]: trait.VerificationHelper.html + /// [`VerificationHelper::check`]: trait.VerificationHelper.html#tymethod.check + /// [`MessageStructure`]: struct.MessageStructure.html /// /// # Examples /// -- cgit v1.2.3