diff --git a/README.md b/README.md index cb425c7..020d4e5 100644 --- a/README.md +++ b/README.md @@ -43,9 +43,10 @@ Hagrid has it's own URL scheme to fetch keys, verify user IDs and delete keys. It's meant to be machine readable, but it's not a REST API. The following URLs are handled. -- `GET /by-fingerprint/` retrieves the key with the given - fingerprint. -- `GET /by-keyid/` retrieves the key with the given long key ID. +- `GET /by-fingerprint/` retrieves the key with the given + fingerprint. Hexadecimal digits must be uppercase. +- `GET /by-keyid/` retrieves the key with the given long key + ID. Hexadecimal digits must be uppercase. - `GET /by-email/` retrieves the key with the given user ID. Only exact matches are accepted. - `GET /vks/verify/` verifies a user ID using a token string send by diff --git a/examples/import.rs b/examples/import.rs index 67c2e79..f53d001 100644 --- a/examples/import.rs +++ b/examples/import.rs @@ -160,14 +160,14 @@ impl Filesystem { /// Returns the path to the given KeyID. fn path_to_keyid(&self, keyid: &openpgp::KeyID) -> PathBuf { - let hex = keyid.to_hex().to_lowercase(); + let hex = keyid.to_hex(); self.base_by_keyid.join(&hex[..2]).join(&hex[2..]) } /// Returns the path to the given Fingerprint. fn path_to_fingerprint(&self, fingerprint: &openpgp::Fingerprint) -> PathBuf { - let hex = fingerprint.to_hex().to_lowercase(); + let hex = fingerprint.to_hex(); self.base_by_fingerprint.join(&hex[..2]).join(&hex[2..]) } diff --git a/src/types.rs b/src/types.rs index f7c68b2..07f29f5 100644 --- a/src/types.rs +++ b/src/types.rs @@ -56,7 +56,7 @@ impl TryFrom for Fingerprint { impl ToString for Fingerprint { fn to_string(&self) -> String { - hex::encode(&self.0[..]) + hex::encode_upper(&self.0[..]) } } @@ -133,7 +133,7 @@ impl From for KeyID { impl ToString for KeyID { fn to_string(&self) -> String { - hex::encode(&self.0[..]) + hex::encode_upper(&self.0[..]) } }