Changes between Initial Version and Version 1 of archives


Ignore:
Timestamp:
Jun 22, 2010, 1:13:24 PM (14 years ago)
Author:
nerdling (Jeremy Lavergne)
Comment:

adding walkthrough on signing archives

Legend:

Unmodified
Added
Removed
Modified
  • archives

    v1 v1  
     1 = Using Your Own Archives =
     2MacPorts recently added the ability to verify archives when `archivemode` is enabled. Signing archives is basically a requirement now. This page will serve as a guide showing how to do this.
     3
     4 = Create Keys =
     5The first step (also detailed in `[browser:trunk/base/doc/pubkeys.conf.in ${prefix}/etc/macports/pubkeys.conf]`) is to make keys to sign your archives.
     6
     7To distribute archives of your own, you need a key pair generated like so:
     8{{{
     9openssl genrsa -des3 -out privkey.pem 2048
     10openssl rsa -in privkey.pem -pubout -out pubkey.pem
     11}}}
     12Then sign the archives like this:
     13{{{
     14openssl dgst -ripemd160 -sign privkey.pem -out archive.tbz2.rmd160 archive.tbz2
     15}}}
     16
     17Be sure to add this key to your ssh keyring or you'll get asked for the password each time it's used. Another alternative is it save it as an unencrypted key, like so:
     18{{{
     19openssl rsa -in privkey.pem -out privkey.pem.bare
     20}}}
     21
     22 = Sign Packages =
     23If you have lots of archives to sign, this can be done via a for loop in your shell. Here I use bash:
     24{{{
     25for i in *tbz2; do openssl dgst -ripemd160 -sign ~/.ssh/privkey.pem.bare -out $i.rmd160 $i; done
     26}}}
     27Note that this saves the signatures along side the archives, by simply using `.rmd160` as a suffix. This is what MacPorts presently expects.
     28
     29 = Configure MacPorts =
     30Now we need to add your key to MacPorts. This is done in two places:
     31 * save copy of public key
     32 * add path to this copy in pubkeys.conf
     33
     34I saved my key as `/opt/local/etc/macports/snc.pub` for simplicity. To avoid naming collisions I suggest adding all custom keys to just one file.
     35
     36 = Try It =
     37Your archives are now signed and MacPorts should be configured to recognize your signature. Try it out!