Add a tool for extracting the public key from a signing key
If you have a Ristretto signing key then this gives you a tool for easily finding the public key.
Here's an example:
$ ./result/bin/PaymentServer-get-public-key <ristretto.signing-key
ogzbCbwIl8qYQkpH1pWoAcJnSpv+UGCHveuEMr471Ew=
Merge request reports
Activity
1 - | Extract a public key from Ristretto-flavored PrivacyPass signing key read from stdin. 2 module Main 3 ( main 4 ) where 5 6 import Prelude hiding 7 ( putStrLn 8 , getLine 9 ) 10 11 import Data.Text.IO 12 ( putStrLn 13 , getLine 14 ) More or less.
getLine
to read the private key from stdin as aData.Text.Text
and thenputStrLn
to write theData.Text.Text
that represents the public key to stdout.There's probably an entirely different way to manage it but as far as I can tell sticking entirely to
Data.Text.IO
functions is reasonable.import Prelude hiding ( putStrLn , getLine )
has the opposite meaning. It means "add everything from Prelude to this namespace (this is the default if you don't do anything) except putStrLn and getLine". So this is (more or less) necessary to avoid having the next import make these two names ambiguous.
The
Prelude
import could be dropped but then these two names have to be referred to qualified (egData.Text.IO.getLine
) to avoid the ambiguity.