puppetlabs-stdlib/spec
Matt Bostock 97320ab421 Add a function to validate an x509 RSA key pair
Add a function to validate an x509 RSA certificate and key pair, as
commonly used for TLS certificates.

The rationale behind this is that we store our TLS certificates and
private keys in Hiera YAML files, and poor indentation or formatting in
the YAML file could cause a valid certificate to be considered invalid.

Will cause the Puppet run to fail if:

- an invalid certificate is detected
- an invalid RSA key is detected
- the certificate does not match the key, i.e. the certificate
  has not been signed by the supplied key

The test certificates I've used in the spec tests were generated using
the Go standard library:

    $ go run $GOROOT/src/crypto/tls/generate_cert.go -host localhost

Example output:

    ==> cache-1.router: Error: Not a valid RSA key: Neither PUB key nor PRIV key:: nested asn1 error at /var/govuk/puppet/modules/nginx/manifests/config/ssl.pp:30 on node cache-1.router.dev.gov.uk
2016-01-08 11:09:45 +00:00
..
acceptance Added acceptance test and updated readme 2015-09-28 16:18:56 +01:00
fixtures (MODULES-2478) Support root_home fact on AIX through "lsuser" command 2015-08-28 15:21:13 +01:00
functions Add a function to validate an x509 RSA key pair 2016-01-08 11:09:45 +00:00
monkey_patches Add the missing shebangs and fix the wrong ones for rpmlint to stop complaining loudly 2014-05-07 11:49:25 +02:00
unit (FM-3773) Fix root_home fact on AIX 5.x 2015-11-19 15:44:52 -08:00
puppetlabs_spec_helper_clone.rb Convert tests to use plain rspec-puppet 2015-06-01 18:02:22 +01:00
spec.opts Copied function test scaffolding from puppet. 2011-06-29 12:25:43 +01:00
spec_helper.rb Remove unused puppet_spec code 2015-06-01 18:02:22 +01:00
spec_helper_acceptance.rb Update is_a acceptance tests to only run on puppet4 2015-09-21 14:12:25 -07:00