diff options
Diffstat (limited to 'Data/OpenPGP/Util/Fingerprint.hs')
-rw-r--r-- | Data/OpenPGP/Util/Fingerprint.hs | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/Data/OpenPGP/Util/Fingerprint.hs b/Data/OpenPGP/Util/Fingerprint.hs index cda25f6..955748d 100644 --- a/Data/OpenPGP/Util/Fingerprint.hs +++ b/Data/OpenPGP/Util/Fingerprint.hs | |||
@@ -2,6 +2,7 @@ | |||
2 | module Data.OpenPGP.Util.Fingerprint (fingerprint,fingerprintv,Fingerprint(..),hex) where | 2 | module Data.OpenPGP.Util.Fingerprint (fingerprint,fingerprintv,Fingerprint(..),hex) where |
3 | 3 | ||
4 | import qualified Data.OpenPGP as OpenPGP | 4 | import qualified Data.OpenPGP as OpenPGP |
5 | import Data.OpenPGP.Internal | ||
5 | import qualified Data.ByteString as BS | 6 | import qualified Data.ByteString as BS |
6 | import qualified Data.ByteString.Lazy as LZ | 7 | import qualified Data.ByteString.Lazy as LZ |
7 | import Data.Char (toUpper) | 8 | import Data.Char (toUpper) |
@@ -28,15 +29,6 @@ instance Show Fingerprint where | |||
28 | 29 | ||
29 | hex :: Fingerprint -> String | 30 | hex :: Fingerprint -> String |
30 | hex (Fingerprint bs) = hexify bs | 31 | hex (Fingerprint bs) = hexify bs |
31 | where | ||
32 | hexify = map toUpper . hexString . BS.unpack | ||
33 | |||
34 | hexString :: [Word8] -> String | ||
35 | hexString = foldr (pad `oo` showHex) "" | ||
36 | where | ||
37 | pad s | odd $ length s = '0':s | ||
38 | | otherwise = s | ||
39 | |||
40 | 32 | ||
41 | -- | Generate a key fingerprint from a PublicKeyPacket or SecretKeyPacket | 33 | -- | Generate a key fingerprint from a PublicKeyPacket or SecretKeyPacket |
42 | -- <http://tools.ietf.org/html/rfc4880#section-12.2> | 34 | -- <http://tools.ietf.org/html/rfc4880#section-12.2> |