summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJustus Winter <justus@sequoia-pgp.org>2020-03-31 11:02:25 +0200
committerJustus Winter <justus@sequoia-pgp.org>2020-03-31 11:53:06 +0200
commit5e5e16bf2fbc64c8347abe93fa33dc573b254a76 (patch)
treeb087f2a385433869b387c1ad26b95cf93c4e2e07
parentebf143bfa906769ff096f1a60f8d98b688c681dd (diff)
openpgp: Move definition of struct Fingerprint.
-rw-r--r--openpgp/src/fingerprint.rs18
-rw-r--r--openpgp/src/lib.rs18
2 files changed, 18 insertions, 18 deletions
diff --git a/openpgp/src/fingerprint.rs b/openpgp/src/fingerprint.rs
index edbc0774..ca015155 100644
--- a/openpgp/src/fingerprint.rs
+++ b/openpgp/src/fingerprint.rs
@@ -1,8 +1,24 @@
use std::fmt;
-use crate::Fingerprint;
use crate::Result;
+/// Holds a fingerprint.
+///
+/// A fingerprint uniquely identifies a public key. For more details
+/// about how a fingerprint is generated, see [Section 12.2 of RFC
+/// 4880].
+///
+/// [Section 12.2 of RFC 4880]: https://tools.ietf.org/html/rfc4880#section-12.2
+#[derive(PartialEq, Eq, PartialOrd, Ord, Clone, Hash)]
+pub enum Fingerprint {
+ /// 20 byte SHA-1 hash.
+ V4([u8;20]),
+ /// Used for holding fingerprints that we don't understand. For
+ /// instance, we don't grok v3 fingerprints. And, it is possible
+ /// that the Issuer subpacket contains the wrong number of bytes.
+ Invalid(Box<[u8]>)
+}
+
impl fmt::Display for Fingerprint {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.convert_to_string(true))
diff --git a/openpgp/src/lib.rs b/openpgp/src/lib.rs
index 8a993d26..44e749d3 100644
--- a/openpgp/src/lib.rs
+++ b/openpgp/src/lib.rs
@@ -164,6 +164,7 @@ use crate::types::{
};
mod fingerprint;
+pub use fingerprint::Fingerprint;
mod keyid;
pub use keyid::KeyID;
mod keyhandle;
@@ -446,20 +447,3 @@ pub struct Message {
/// A message is just a validated packet pile.
pile: PacketPile,
}
-
-/// Holds a fingerprint.
-///
-/// A fingerprint uniquely identifies a public key. For more details
-/// about how a fingerprint is generated, see [Section 12.2 of RFC
-/// 4880].
-///
-/// [Section 12.2 of RFC 4880]: https://tools.ietf.org/html/rfc4880#section-12.2
-#[derive(PartialEq, Eq, PartialOrd, Ord, Clone, Hash)]
-pub enum Fingerprint {
- /// 20 byte SHA-1 hash.
- V4([u8;20]),
- /// Used for holding fingerprints that we don't understand. For
- /// instance, we don't grok v3 fingerprints. And, it is possible
- /// that the Issuer subpacket contains the wrong number of bytes.
- Invalid(Box<[u8]>)
-}