Skip to content

Commit

Permalink
Test PKCS12 container with OpenSSL command line binary
Browse files Browse the repository at this point in the history
  • Loading branch information
marcusdots committed Feb 10, 2025
1 parent 084efb7 commit 5097fc7
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions spec/acceptance/pkcs12_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,20 @@
describe file('/tmp/export4.pkcs12.p12') do
its(:size) { is_expected.to be > 0 }
end

if fact('openssl_version').split('.').first.to_i > 1
describe command('openssl pkcs12 -info -in /tmp/export3.pkcs12.p12 -passin pass: -passout pass:') do
its(:stdout) { is_expected.to contain('-----BEGIN CERTIFICATE-----') }
its(:stdout) { is_expected.to contain('-----BEGIN ENCRYPTED PRIVATE KEY-----') }
its(:exit_status) { is_expected.to eq 0 }
end

describe command('openssl pkcs12 -info -in /tmp/export.pkcs12.p12 -passin pass:mahje1Qu -passout pass:') do
its(:stdout) { is_expected.to contain('-----BEGIN CERTIFICATE-----') }
its(:stdout) { is_expected.to contain('-----BEGIN ENCRYPTED PRIVATE KEY-----') }
its(:exit_status) { is_expected.to eq 0 }
end
end

# rubocop:enable RSpec/RepeatedExampleGroupBody
end

0 comments on commit 5097fc7

Please sign in to comment.