diff options
author | Stephen Paul Weber <singpolyma@singpolyma.net> | 2011-08-12 21:03:43 -0500 |
---|---|---|
committer | Stephen Paul Weber <singpolyma@singpolyma.net> | 2011-08-12 21:04:40 -0500 |
commit | 1cc474786194555bec47dd5c061c1bcc5d992952 (patch) | |
tree | 6b4c838a4abad603c208183a17b9df89772cca3c /examples/sign.hs | |
parent | 531dc4a28554ceaaa495aa02374b559721aa6a9a (diff) |
Refactor sign to handle keys
Also, now if you pass in a message with a signature packet we'll just
use that one instead of making a default one.
Return value is now just the new/filled-in signature packet, update
example accordingly.
Diffstat (limited to 'examples/sign.hs')
-rw-r--r-- | examples/sign.hs | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/examples/sign.hs b/examples/sign.hs index 8fc9352..e8bea1a 100644 --- a/examples/sign.hs +++ b/examples/sign.hs | |||
@@ -14,8 +14,10 @@ main = do | |||
14 | time <- getClockTime | 14 | time <- getClockTime |
15 | let TOD t _ = time | 15 | let TOD t _ = time |
16 | keys <- decodeFile (argv !! 0) | 16 | keys <- decodeFile (argv !! 0) |
17 | let dataPacket = OpenPGP.LiteralDataPacket 'u' "t.txt" | ||
18 | (fromIntegral t) (LZ.fromString "This is a message.") | ||
17 | let message = OpenPGP.Message [ | 19 | let message = OpenPGP.Message [ |
18 | OpenPGP.LiteralDataPacket 'u' "t.txt" (fromIntegral t) | 20 | OpenPGP.sign keys (OpenPGP.Message [dataPacket]) |
19 | (LZ.fromString "This is a message.") ] | 21 | OpenPGP.SHA256 [] (fromIntegral t), |
20 | LZ.putStr $ encode $ | 22 | dataPacket] |
21 | OpenPGP.sign keys message OpenPGP.SHA256 [] (fromIntegral t) | 23 | LZ.putStr $ encode message |