No description, website, or topics provided.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

A trivial Cabal package signing utility for use with Hackage

Signing packages

As a package author: first, generate your package distribution:

chris@midnight:~/Projects/me/fay$ cabal sdist
Distribution quality warnings:
'ghc-options: -O2' is rarely needed. Check that it is giving a real benefit
and not just imposing longer compile times on your users.
Building source dist for fay-
Preprocessing library fay-
Preprocessing executable 'fay-tests' for fay-
Preprocessing executable 'fay-docs' for fay-
Preprocessing executable 'fay' for fay-
Source tarball created: dist/fay-

If you don't have GPG setup, it's easy. A trivial setup for newbies can be something like:

$ gpg --gk # Generate a pub/priv key pair.

(On Ubuntu/Debian you can probably install with sudo apt-get install pgp.)

Next, sign your distribution:

chris@midnight:~/Projects/me/fay$ cabal-sign sign dist/fay-
You need a passphrase to unlock the secret key for
user: "Chris Done <>"
2048-bit RSA key, ID A2C5C589, created 2013-01-30

Now upload the signed version to Hackage:

chris@midnight:~/Projects/me/fay$ cabal upload dist/fay-

Verifying packages

As a user: Download the package:

chris@midnight:~$ wget

Verify it:

chris@midnight:~$ cabal-sign verify fay-
gpg: Signature made Thu 31 Jan 2013 10:15:37 PM CET using RSA key ID A2C5C589
gpg: Good signature from "Chris Done <>"

Sharing your key

You can share your key using the export feature:

$ gpg --export >

And share it with people who want to trust your packages. Put it on your web site, in your garden, tattoo it on your foot.

Importing someone's key

This is also easy:

$ gpg --import

Now you can start verifying that packages are indeed from Mary.

Other approaches

There're actually a bunch of nice key servers provided by Ubuntu and supported with fancy GUIs and such, which might mitigate pain: