Skip to content

Commit 58363ef

Browse files
committed
Test PKCS12 container with OpenSSL command line binary
1 parent bda0310 commit 58363ef

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

spec/acceptance/pkcs12_spec.rb

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,5 +33,20 @@
3333
describe file('/tmp/export4.pkcs12.p12') do
3434
its(:size) { is_expected.to be > 0 }
3535
end
36+
37+
if fact('openssl_version').split('.').first.to_i > 1
38+
describe command('openssl pkcs12 -info -in /tmp/export3.pkcs12.p12 -passin pass: -passout pass:') do
39+
its(:stdout) { is_expected.to contain('-----BEGIN CERTIFICATE-----') }
40+
its(:stdout) { is_expected.to contain('-----BEGIN ENCRYPTED PRIVATE KEY-----') }
41+
its(:exit_status) { is_expected.to eq 0 }
42+
end
43+
44+
describe command('openssl pkcs12 -info -in /tmp/export.pkcs12.p12 -passin pass:mahje1Qu -passout pass:') do
45+
its(:stdout) { is_expected.to contain('-----BEGIN CERTIFICATE-----') }
46+
its(:stdout) { is_expected.to contain('-----BEGIN ENCRYPTED PRIVATE KEY-----') }
47+
its(:exit_status) { is_expected.to eq 0 }
48+
end
49+
end
50+
3651
# rubocop:enable RSpec/RepeatedExampleGroupBody
3752
end

0 commit comments

Comments
 (0)