*: Use sha-512 digest format

Per appc/spec#8, we should be using sha-512 hashes for speed
cas: tweaks and added tests

Mostly addressed comments in https://github.com/coreos/rocket/pull/209
- errors should start with lowercase
- split out consts for hash prefixes/lengths
- added tests for ResolveKey
- added test to check for unexpected goroutines
- revert to panicking if we get unexpected input to blockTransform
cas: drop unused afterTest func
gitignore: include .DS_Store for osx users

https://www.aorensoftware.com/blog/2011/12/24/death-to-ds_store/
Merge pull request #301 from gdi2290/patch-1

gitignore: include .DS_Store for osx users
*: switch cas using first half of sha512

This changes the CAS to use only the first half of a SHA512 when
creating the keys to store images on disk. Similarly, rkt stage1 uses
only the first half of the sum when creating the directories for each
app image.

This is exposed slightly to stage0/run because it attempts to verify the
hash of the image. This should be revisited+cleaned up.
Merge pull request #290 from jonboulle/rckclmbr-sha512

*: sha256 -> sha512
add support for managing opengpg keys and ACI signature validation

This patch adds support for managing trusted opengpg keys in a keystore backed
by the local filesystem. Trusted keys are stored in following directories by
default:

* /etc/rkt/trustedkeys/root.d
* /etc/rkt/trustedkeys/prefix.d
* /usr/lib/rkt/trustedkeys/root.d
* /usr/lib/rkt/trustedkeys/prefix.d

Each trusted key is stored using the key fingerprint as the name and the key
in OpenPGP ASCII Armor format as the contents.

OS vendors can store system-wide trusted keys in the trusted keys directories
under /usr, which can be overridden by creating an empty file under /etc with a
matching name (fingerprint).

This patch also adds support for validating ACI signatures against trusted keys
found in the local keystore.

Fixes #215
Merge pull request #221 from kelseyhightower/trusted-keys

add support for managing opengpg keys and ACI signature validation
pkg: add prototype flocking package

Add a simple package to facilitate placing an flock on directories. This
will be use to coordinate state between running containers and rkt
status/gc tools.
pkg/lock: cleanups, blocking vs. nonblocking calls, FD extraction
rkt gc: implement gc

Container directories deemed inactive by exclusive lock acquisition are
atomically renamed to /var/lib/rkt/garbage, the directory's ctime gets
updated as part of the rename.

The /var/lib/rkt/garbage directory is then scanned for directories having a
ctime older than --grace-period (defaults to 30m).  Qualifying directories
are deleted under another exclusive lock.

All lock acquisitions are non-blocking with failures being ignored.

Functions like gc status will have the grace period window for retrieving
statuses from inactive containers in either the containers or garbage
dirs, and should access the status files under the protection of a shared
lock.

Examples:

 Container "a983198b-79e3-432e-ad31-f105e96aa003" has recently exited:
   $ bin/rkt gc
   Moving container "a983198b-79e3-432e-ad31-f105e96aa003" to garbage
   $

 Immediate subsequent gc finds nothing to do:
   $ bin/rkt gc
   $

 Immediate subsequent gc force-discard by setting grace period to 0:
   $ bin/rkt gc --grace-period=0
   Garbage collecting container "a983198b-79e3-432e-ad31-f105e96aa003"
   $
pkg/lock: simplify DirLock interface

This moves to a very basic DirLock interface (which represents only an
active lock), and functions to create the respective lock types
(TryExclusiveLock, TrySharedLock, ...) instead of methods.
pkg/lock: add DirLock tests
stage0: propagate lock err directly
Merge pull request #302 from jonboulle/jon-gc

rkt: gc command
Update dir_test.go
Merge pull request #306 from gprggr/dir_test

pkg/lock: fix err check in test
Update tar.go

If os.OpenFile(...) returns err != nil, f will be nil. So f.Close() would cause a "nil pointer dereference".
Merge pull request #308 from gprggr/tar

pkg/tar: fixing possible nil pointer dereference