summaryrefslogtreecommitdiffstats
path: root/openpgp/src/keyhandle.rs
AgeCommit message (Collapse)Author
2021-11-21a missed negation flips the meaning of the documentation for ↵Alexander Kjäll
KeyHandle::is_invalid
2021-08-27Convert markdown to intra-doc links.Nora Widdecke
- Apply cargo intraconv.
2021-04-09Lint: Use matches! macro.Nora Widdecke
- https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro
2021-03-02openpgp: Fix documentation.Justus Winter
2021-03-02openpgp: Add methods for hexadecimal representation with spaces.Justus Winter
- These are explicitly intended for manual comparison of key ids and fingerprints. - See #422.
2021-01-21openpgp: Typos.Justus Winter
2020-12-22openpgp: Add KeyHandle::is_invalid.Neal H. Walfield
- Add a convenience function to determine if a KeyHandle contains an invalid identifier.
2020-12-22openpgp: Implement KeyHandle::to_hex.Neal H. Walfield
- We implement Fingerprint::to_hex and KeyID::to_hex. Also implement it for KeyHandle.
2020-12-22openpgp: Implement str::FromStr for KeyHandle.Neal H. Walfield
- We implement str::FromStr for Fingerprint and KeyID. Also implement it for KeyHandle.
2020-12-11openpgp: Standardize fn main() in doctests.Azul
- Avoid the additional `fn f()`.
2020-12-11openpgp: Replace `.unwrap()` in doctests with `?`Azul
- See #480.
2020-12-08openpgp: Use parens for assert_send_and_sync!.Azul
2020-12-08openpgp: Ensure public types are Send and Sync.Azul
- See #627.
2020-11-30openpgp: Improve documentation of Fingerprint, KeyID, and KeyHandle.Nora Widdecke
- Fixes #465.
2020-11-24openpgp: Assert that KeyHandle is Send + Sync.Justus Winter
- See #615.
2020-10-14Replace most 'extern crate' directives with 'use'.Justus Winter
- See #480.
2020-09-25openpgp: Either derive both Eq and Hash, or impl both.Justus Winter
- crypto::mpi::SecretKeyMaterial is the sole exception to this rule, because we are trying to compare them in constant time. Add a hint for clippy that this is okay. - KeyHandle no longer implements Eq, so there is no point in implementing Hash. Simply remove it. - Implement Hash for SubpacketLength by hashing the serialized form. Manually implement Eq for consistency. - Fixes #567.
2020-04-06openpgp: Rename as_slice to as_bytes.Nora Widdecke
- KeyID::as_slice and KeyID::from_bytes mirror each other. This should be reflected in the functions' names. Also, as_bytes is more descriptive. - Same for Fingerprint::as_slice and Fingerprint::as_bytes. - KeyHandle::as_slice renamed for consistency.
2020-04-02openpgp: Drop Fingerprint::from_hex in favor of FromStr.Justus Winter
- See #462.
2020-04-02openpgp: Drop KeyID::from_hex in favor of FromStr.Justus Winter
- See #462.
2020-03-31openpgp: Improve summary line of modules and types.Justus Winter
- Avoid repeating the type name. - Avoid self referential, trivial descriptions. - Avoid the terms OpenPGP and Sequoia. - Fix mistakes from the Message -> PacketPile rework.
2020-03-20openpgp: Remove `to_hex` in KeyHandle, KeyID and Fingerprint.Wiktor Kwapisiewicz
- Replace all usages of `to_hex` with formatting string with :X specifier. - Fixes #456.
2020-03-20openpgp: Allow formatting KeyHandle with x and X.Wiktor Kwapisiewicz
2020-03-09Switch from failure to anyhow.Justus Winter
- Use the anyhow crate instead of failure to implement the dynamic side of our error handling. anyhow::Error derefs to dyn std::error::Error, allowing better interoperability with other stdlib-based error handling libraries. - Fixes #444.
2020-02-06openpgp: Implement KeyHandle::to_hex.Justus Winter
2020-01-20openpgp: Don't implement From<KeyHandle> for String explicitly.Neal H. Walfield
- `From<T> for String` is implemented implicitly if `Display` is implemented, which is the case for KeyHandle.
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-14openpgp: Add conversions from &KeyHandle to KeyID and Fingerprint.Neal H. Walfield
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.
2019-12-11openpgp: Derive Debug for KeyHandle.Justus Winter
2019-11-27openpgp: Rename ID to KeyHandle.Justus Winter