summaryrefslogtreecommitdiffstats
path: root/openpgp/src
AgeCommit message (Collapse)Author
2020-01-18openpgp: Add a conversion from KeyHandle to String.Neal H. Walfield
- Add a function to convert a KeyHandle to a String like there are functions to convert a Fingerprint and a KeyID to a String.
2020-01-17openpgp: Allow the caller to determine a signature's creation time.Neal H. Walfield
- Add Signer::creation_time so that a user of a Signer object can determine the signature's creation time.
2020-01-17openpgp: Improve the MessageLayer documentation.Justus Winter
- Fixes #411.
2020-01-17openpgp: Make MessageStructureIntoIter private.Justus Winter
2020-01-16openpgp: Return Result<()> from Signature::verify*.Justus Winter
2020-01-16openpgp: Remove variant VerificationResult::BadChecksum.Justus Winter
- This is better expressed as an error.
2020-01-16openpgp: Rework Decryptor::verify_signatures like Verifier.Justus Winter
2020-01-16openpgp: Improve documentation.Justus Winter
2020-01-16openpgp: Move the high-level methods to packet::Signature.Justus Winter
- Signature4 is only a storage format. The high-level functionality should be implemented on the version enum.
2020-01-16openpgp: Consolidate public key verification code.Justus Winter
2020-01-16openpgp: Consolidate public key encryption code.Justus Winter
2020-01-16openpgp: Return more useful errors.Neal H. Walfield
- If the streaming verifier doesn't find a key, because it was rejected by the policy, don't return `VerificationResult::MissingKey`, which is misleading, return `VerificationResult::Error` with an explanation of what happened.
2020-01-16openpgp: Improve example.Neal H. Walfield
2020-01-16openpgp: Improve documentation.Neal H. Walfield
2020-01-15openpgp: Add application example for Timestamp::round_down.Justus Winter
2020-01-15openpgp: Implement addition and subtraction of durations.Justus Winter
2020-01-15openpgp: When verifying a sig, make sure the certificate is good.Neal H. Walfield
- The streaming verifier needs to check not only that the key is alive and non-revoked, but also that the certificate is alive and non-revoked.
2020-01-14openpgp: Add methods to KeyAmalgamation to query the Cert.Neal H. Walfield
- Given a `KeyAmalgamation`, it is often necessary to determine the certificate's revocation status, or whether it is alive. - It is possible to get the `Cert` using `KeyAmalgamation::cert`, and to query it directly, but then the referece time needs to be provided. - To make it harder for the user to pass the wrong reference time, and to simplify the code, add methods to query the certificate using the KeyAmalgamation's reference time.
2020-01-14openpgp: Simplify code.Neal H. Walfield
- Just use `.into()`.
2020-01-14openpgp: Improve example.Neal H. Walfield
2020-01-14openpgp: Improve documentation for Verifier.Neal H. Walfield
2020-01-14openpgp: When verifying a signature, try all issuers.Neal H. Walfield
- When verifying a signature using the streaming verifier, try all issuers.
2020-01-14openpgp: Use ValidKeyIter::key_handles.Neal H. Walfield
- Use `ValidKeyIter::key_handles` instead of reproducing it inline.
2020-01-14openpgp: Refine lifetimes.Neal H. Walfield
- The lifetime of the KeyHandle iterator passed to `KeyIter::hey_handles` and `ValidKeyIter::hey_handles` does not need to outlive the `KeyIter` or `ValidKeyIter`. - Give it a different lifetime.
2020-01-14openpgp: Don't use revoked keys to verify signatures.Neal H. Walfield
- In the stream verifier, don't use revoked keys to verify signatures.
2020-01-14openpgp: Rework stream verification logic.Neal H. Walfield
- Select keys only when verifying the signatures: the relevant keys depend on the timestamp in the signature, and different signatures may have different time stamps. - If the signature doens't have a Signature Creation Time stamp, return that the signature is invalid.
2020-01-14openpgp: Remove unneeded fields from VerificationResult::NotAlive.Neal H. Walfield
- VerificationResult::NotAlive means that the signature is not alive. This has nothing to do with a specific key. Indeed, there might not even be a key available, but we can still detect this error condition. - As such, remove the cert and key fields from VerificationResult::NotAlive.
2020-01-14openpgp: Add conversions from &KeyHandle to KeyID and Fingerprint.Neal H. Walfield
2020-01-14openpgp: Add KeyAmalgamation::cert.Neal H. Walfield
- Add a method to KeyAmalgamation to return the key's certificate.
2020-01-13openpgp: Add Error variant to VerificationResult.Neal H. Walfield
- Add an Error variant to VerificationResult.
2020-01-13openpgp: Add functions to filter keys by key handles.Neal H. Walfield
- Add KeyIter::key_handle, KeyIter::key_handles, ValidKeyIter::key_handle, and ValidKeyIter::key_handles to filter keys by key handles.
2020-01-13openpgp: Add a function to return a Key's KeyHandle.Neal H. Walfield
- This is a shorter way of writing `key.fingerprint().into()`. - Also, that doesn't always work, because the type sometimes can't be inferred.
2020-01-13openpgp: Add conversions from &KeyID and &Fingerprint to KeyHandleNeal H. Walfield
- Like we have functions to convert a slice of bytes to a KeyID or a Fingerprint, and a &Fingerprint to a KeyID, add functions to convert a &KeyID or a &Fingerprint to a KeyHandle.
2020-01-13openpgp: Change KeyHandle's PartialOrd and PartialEq implementations.Neal H. Walfield
- The current PartialOrd and PartialEq implementations for KeyHandles considers KeyIDs and Fingerprints to not be equal. Since most users of this interface expect key identifiers to be interchangeable, this means that they have to pull KeyHandles apart when comparing them, like this: match (a, b) { (KeyHandle::Fingerprint(a), KeyHandle::Fingerprint(b)) => a == b, (KeyHandle::Fingerprint(a), KeyHandle::KeyID(b)) => a.keyid() == b, ... } This is unergonomic, and easy to forget to do. - The obvious fix would be to change the PartialOrd and PartialEq implementations to do this for the user. Unfortunately, this is not possible, because they must be transitive and two fingerprints (a and b) maybe different but have the same keyid. That is, the following is possible: a == keyid, b == keyid, but a != b That makes this comparison function non-transitive and inappropriate for the PartialOrd and PartialEq traits. - Nevertheless, we can implement PartialOrd and PartialEq and return None when a keyid and a fingerprint match. (A consequence of this is that KeyHandle can no longer implement Eq or Ord.) This prevents users of this interface from naively comparing KeyHandles. - Using this interface, we provide the desired, non-transitive, comparison function via a method (KeyHandle::aliases). - This change means that a `KeyHandle` can no longer be used as a Key in a HashMap. In these cases, we instead use a vector. - Fixes #412.
2020-01-10openpgp: Prefer consuming MessageStructure's to referencing them.Neal H. Walfield
2020-01-10openpgp: Add MessageStructure::into_iter.Neal H. Walfield
- Add a consuming iterator to MessageStructure. - This requires introducing the MessageStructureIntoIter type.
2020-01-10openpgp: Pass MessageStructure by value, not reference.Neal H. Walfield
- Instead of passing MessageStructure to VerificationHelper::check by reference, pass it by value. - After calling VerificationHelper::check, it is dropped. Passing it by value allows the caller to avoid some cloning.
2020-01-08openpgp: Add convenience functions for masking timestamps.Justus Winter
- Timestamps can be used to identify people attending a common event, like a key signing party. By reducing the resolution of the time stamps, we can alleviate this problem. - Fixes #216.
2020-01-08openpgp: Add a creation time setting to the certificate builder.Justus Winter
- See #216.
2020-01-08openpgp: Remove creation time argument from *::bind.Justus Winter
- This can already be achieved by customizing the signature builder, and by default the signature builder uses the current time.
2020-01-08openpgp: Prevent matching on currently empty struct Common.Justus Winter
2020-01-08openpgp: Do not derive PartialEq, Eq, Hash for Common.Justus Winter
2020-01-08openpgp: Explicitly implement PartialEq, Hash for packets.Justus Winter
- We explicitly exclude the common fields. - See #92.
2020-01-08openpgp: Improve PartialEq for OnePassSig3.Justus Winter
- Previously, we compared the serialized forms. This, however, involves making heap allocations. For me, that breaks the expectation that equality should be free of side-effects, and fast. Compare the fields instead.
2020-01-08openpgp: Include a reference time in KeyAmalgamation.Neal H. Walfield
- Including the reference time in the KeyAmalgamation structure rather than having the user supply it to the individual methods (like `KeyAmalgamation::alive`) helps ensure that the key is used consistent. For instance, this makes it harder to mistakenly query key's liveness at time t, but then use the current time to determine the key's capabilities.
2020-01-07Fix broken links in the documentation.Justus Winter
2020-01-07openpgp: Improve documentation.Justus Winter
2020-01-07openpgp: Include the signing key's amalgamation in results.Justus Winter
- Only the amalgamation allows proper checking of a key's properties, the binding signature alone isn't sufficient. - Fixes #408.
2020-01-07openpgp: Document that names may change.Justus Winter
2020-01-07openpgp: Do not Deref to Common for the container types.Justus Winter
- This was only implemented for the container types because previously, the container logic was implemented in Common. That is no longer the case and explicit forwarders for the Container type are added.