2017-03-21 21:17:50 +00:00
|
|
|
|
|
|
|
if os.windows?
|
2019-05-18 00:43:58 +00:00
|
|
|
$stderr.puts "\033[1;33mTODO: Not running #{__FILE__} because we are not on Linux.\033[0m"
|
2017-03-21 21:17:50 +00:00
|
|
|
return
|
|
|
|
end
|
|
|
|
|
|
|
|
describe x509_certificate('/tmp/mycert.pem') do
|
|
|
|
it { should be_certificate }
|
|
|
|
it { should be_valid }
|
|
|
|
its('signature_algorithm') { should eq 'sha256WithRSAEncryption' }
|
|
|
|
its('validity_in_days') { should_not be < 100 }
|
|
|
|
its('validity_in_days') { should be >= 100 }
|
2019-02-14 05:51:21 +00:00
|
|
|
its('subject_dn') { should eq '/C=US/O=Foo Bar/OU=Lab/CN=www.f00bar.com' }
|
2017-03-21 21:17:50 +00:00
|
|
|
its('subject.C') { should eq 'US' }
|
2019-02-14 05:51:21 +00:00
|
|
|
its('issuer_dn') { should eq '/C=US/O=Foo Bar/OU=Lab/CN=www.f00bar.com' }
|
2017-03-21 21:17:50 +00:00
|
|
|
its('key_length') { should be >= 2048 }
|
|
|
|
end
|
|
|
|
|
|
|
|
describe key_rsa('/tmp/server.key') do
|
|
|
|
it { should be_private }
|
|
|
|
it { should be_public }
|
|
|
|
its('key_length') { should eq 2048 }
|
|
|
|
end
|