Refactor with more test coverage

Refactor of some of the key file functions to be more generic
and ensure that all types of keys and output formats are covered.

More unit tests to cover added functionalities.

Updated tlsdemo to match current interface.
Comments for filter and PEMBlock
Merge pull request #28 from jlhawn/refactor_with_coverage

Refactor with more test coverage
Add json signature with JWS and pretty format options

Adds signature and verification with and without a x509 chain
Fix sign bytes using different protected header
Fix parse pretty signature altering input content
Add missing signature error type
Merge pull request #27 from dmcgowan/json_signature

Add json attached signature, signing and verification
Add license, contributing guide, and basic documentation
Merge pull request #30 from dmcgowan/open_source_requirements

Add license, contributing guide, and basic documentation
Fix filter hosts invalid cast

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
Merge pull request #31 from dmcgowan/fix_interface_cast

Fix filter hosts invalid cast
Add helper functions to load certificates and pools

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
Merge pull request #29 from dmcgowan/certificate_helpers

Add helper functions to load certificates and pools
Move certificate generation for tests into testutil package

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
Merge pull request #32 from dmcgowan/testutil

Move certificate generation for tests into testutil package
Add trust graph implementation in sub package

Includes full set of unit tests for the graph and verification of statements

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
Create statement from json streams

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
Merge pull request #34 from dmcgowan/trust_graph

Trust graph
switch hosts between []string and []interface{}

Instead of casting the hosts value to []interface{} in FilterByHosts (which
doesnt work in PEM format because hosts are saved as []string), this patch
checks the type of hosts field (either []string or []interface{}) and behaves
accordingly.

Without the patch, running `go run gencert.go` in tlsdemo will panic
because filtered hosts are empty after casting.

Docker-DCO-1.1-Signed-off-by: Daniel, Dao Quang Minh <dqminh89@gmail.com> (github: dqminh)