add new export extract_pem_encoded_public_key and tests

* Provided a means to get the x509 PEM-encoded
  public key from a valid certificate.  Used by EC erchef
  to correctly provide public key  when GETing a user.
Merge pull request #14 from opscode/mp/user-endpoint

add function to get the public key (PEM-encoded) from a  x509 PEM-encoded certificate.
Add chef_keygen_cache for RSA key generation and caching

chef_keygen_cache provides an in-vm cache of key pairs to avoid
in-request latency of on-demand key generation. The cache falls back
to in-line generation if the cache is exhausted, but does the
generation in the calling process so that in-line generation is not
serialized through the server.

RSA key pair generation is achieved by shelling out to openssl and
requires that openssl be present on the PATH.
Parallelize key creation in chef_keygen_cache

This patch introduces a new app config:

     `{chef_authn, keygen_cache_workers, WorkerCount}`

that controls the number of concurrent keygen workers that will be
used to fill the cache to its max level. The default worker count is
set to half of the number of logical processors available on the
system.

The value returned when a worker times out changed from 'timeout' to
'keygen_timeout' to distinguish it from gen_server system timeouts.

keygen constants moved to chef_keygen.hrl
Cleanups and removal of unnecessary code:

* Remove inline key generation from chef_keygen_cache

Inline key generation attempts to avoid returning an error to
requesting consumers but without limiting the number of in-flight key
generation requests. A stampede situation could starve the entire
system.

Removing inline key generation means that consumers will immediately
receive an error if the key cache is empty. But key generation will
always be bounded and some requests will be satisfied.

* Ensure consistent timeout behavior for chef_keygen_cache:get_key_pair

In the event that the chef_keygen_cache gen_server gets overloaded, we
ensure get_key_pair calls timeout as expected.

Removed case clause for keygen_timeout since the server only returns
values from its cache and never caches timeout values.

* Delay start until keygen_start_size keys are available

New app config `{chef_authn, keygen_start_size, Int}` can be used to
control how many keys should be available when the cache is
initialized. The cache's startup will block until the specified number
of keys are created.

Also included is a bit of reorganization of the tests with a new make
target `make slow_tests`. To get test coverage for timeout and worker
crash cases and observe replenishment of cache takes a bit of time and
relies on speed of system. These tests may need tuning to pass on
other hardware.

* Remove throttled worker spawn feature

Controlling the number of keygen workers provides enough tuning
flexibility especially with the ability to block until a set size is
achieved.

The throttling design results in continuous timeout message overhead
when set to zero.

Refactoring will remove the need for a scheduled timeout value
entirely.

* Move async_refill call from msg receive to DOWN handling

We'll always receive a DOWN from spawned workers so better to trigger
the refill from there than from the receive of the key or timeout.

*

Remove keygen_cache_pause feature
Add DEFAULT_START_SIZE macro for consistency
Also remove unused TIMEOUT_PAD

* Consolidate async_refill call into handle_worker_down helper
Improve logging and job management

* Track start_size in keygen_cache state

This makes config handling a bit easier. Sets us up to log progress
during startup.

* Track max workers separately from avail_workers in keygen_cache state

This makes the bookkeeping more robust especially when the server
config is tuned live.

* Improve startup logging for chef_keygen_cache

Log progress for pre fill step. Log message when pre-fill is complete
with starting cache count.
Improve openssl command execution

* Add openssl command from config
* Capture execution status from openssl command
Code to scale back number of ssl jobs under load.
Add generated edown docs
Merge branch 'ma/keygen'
Add status_for_json to provide a status message that is freindly to json encoding.
Merge pull request #17 from opscode/ma/keygen_status_fix

Add status_for_json to provide a status message that is friendly to json encoding
Updated to fix deprecations with 17