File tree Expand file tree Collapse file tree 2 files changed +34
-0
lines changed Expand file tree Collapse file tree 2 files changed +34
-0
lines changed Original file line number Diff line number Diff line change
1
+ include openssl
2
+ openssl::certificate::x509 { 'foo.example.com' :
3
+ ensure => present ,
4
+ country => ' CH' ,
5
+ organization => ' Example.com' ,
6
+ commonname => ' foo.example.com' ,
7
+ base_dir => ' /tmp' ,
8
+ owner => ' nobody' ,
9
+ password => ' mahje1Qu' ,
10
+ # This is just to speed up CI - use 2048 or more in production
11
+ key_size => 1024,
12
+ }
13
+ -> openssl::export::pkcs12 { ' export.pkcs12' :
14
+ ensure => ' present' ,
15
+ basedir => ' /tmp' ,
16
+ pkey => ' /tmp/foo.example.com.key' ,
17
+ cert => ' /tmp/foo.example.com.crt' ,
18
+ in_pass => ' mahje1Qu' ,
19
+ out_pass => ' mahje1Qu' ,
20
+ }
Original file line number Diff line number Diff line change
1
+ # frozen_string_literal: true
2
+
3
+ require 'spec_helper_acceptance'
4
+
5
+ describe 'pkcs12 example' do
6
+ it_behaves_like 'the example' , 'export_pkcs12_from_key.pp' do
7
+ it { expect ( file ( '/tmp/foo.example.com.crt' ) ) . to be_file . and ( have_attributes ( owner : 'nobody' , group : 'root' ) ) }
8
+ it { expect ( file ( '/tmp/foo.example.com.key' ) ) . to be_file . and ( have_attributes ( owner : 'nobody' , group : 'root' ) ) }
9
+ it { expect ( file ( '/tmp/export.pkcs12.p12' ) ) . to be_file . and ( have_attributes ( owner : 'root' , group : 'root' ) ) }
10
+ end
11
+ describe file ( '/tmp/export.pkcs12.p12' ) do
12
+ its ( :size ) { is_expected . to be > 0 }
13
+ end
14
+ end
You can’t perform that action at this time.
0 commit comments