diff options
Diffstat (limited to 'Data/OpenPGP')
-rw-r--r-- | Data/OpenPGP/Util.hs | 2 | ||||
-rw-r--r-- | Data/OpenPGP/Util/Fingerprint.hs | 7 |
2 files changed, 7 insertions, 2 deletions
diff --git a/Data/OpenPGP/Util.hs b/Data/OpenPGP/Util.hs index 1f9277d..1781d6d 100644 --- a/Data/OpenPGP/Util.hs +++ b/Data/OpenPGP/Util.hs | |||
@@ -1,5 +1,7 @@ | |||
1 | module Data.OpenPGP.Util | 1 | module Data.OpenPGP.Util |
2 | ( fingerprint | 2 | ( fingerprint |
3 | , Fingerprint(..) | ||
4 | , hex | ||
3 | , decryptSecretKey | 5 | , decryptSecretKey |
4 | , encryptSecretKey | 6 | , encryptSecretKey |
5 | , verify | 7 | , verify |
diff --git a/Data/OpenPGP/Util/Fingerprint.hs b/Data/OpenPGP/Util/Fingerprint.hs index b2e3904..c1d8fef 100644 --- a/Data/OpenPGP/Util/Fingerprint.hs +++ b/Data/OpenPGP/Util/Fingerprint.hs | |||
@@ -1,5 +1,5 @@ | |||
1 | {-# LANGUAGE CPP #-} | 1 | {-# LANGUAGE CPP #-} |
2 | module Data.OpenPGP.Util.Fingerprint (fingerprint,Fingerprint(..)) where | 2 | module Data.OpenPGP.Util.Fingerprint (fingerprint,Fingerprint(..),hex) where |
3 | 3 | ||
4 | import qualified Data.OpenPGP as OpenPGP | 4 | import qualified Data.OpenPGP as OpenPGP |
5 | import qualified Data.ByteString as BS | 5 | import qualified Data.ByteString as BS |
@@ -23,7 +23,10 @@ oo = (.) . (.) | |||
23 | newtype Fingerprint = Fingerprint BS.ByteString | 23 | newtype Fingerprint = Fingerprint BS.ByteString |
24 | 24 | ||
25 | instance Show Fingerprint where | 25 | instance Show Fingerprint where |
26 | show (Fingerprint bs) = hexify bs | 26 | show fp = hex fp |
27 | |||
28 | hex :: Fingerprint -> String | ||
29 | hex (Fingerprint bs) = hexify bs | ||
27 | where | 30 | where |
28 | hexify = map toUpper . hexString . BS.unpack | 31 | hexify = map toUpper . hexString . BS.unpack |
29 | 32 | ||