Skip to content

Commit

Permalink
Use new easyrsa commands instead of openssl
Browse files Browse the repository at this point in the history
  • Loading branch information
nkakouros committed Aug 17, 2023
1 parent 3ca3148 commit a63795b
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions tasks/convert.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,10 @@

- name: Convert private keys to PKCS#8
command: >-
openssl pkcs8 -topk8
-in '{{ easyrsa_pki_dir }}/private/{{ item.name }}.key'
-out '{{ easyrsa_pki_dir }}/private/{{ item.name }}.p8'
{{ '-passin pass:' + item.pass | string if item.pass | default(None) else '' }}
{{ '-passout pass:' + item.pass | string if item.pass | default(None) else
'-nocrypt' }}
easyrsa
{{ '--passin=pass:' + item.pass | string if item.pass | default(None) else '' }}
{{ '--passout=pass:' + item.pass | string if item.pass | default(None) else '' }}
export-p8 {{ item.name }}
args:
creates: "{{ easyrsa_pki_dir }}/private/{{ item.name }}.p8"
loop: "{{ easyrsa_to_pkcs8 }}"
Expand All @@ -33,12 +31,10 @@

- name: Convert private keys to PKCS#1
command: >-
openssl rsa
-in '{{ easyrsa_pki_dir }}/private/{{ item.name }}.key'
-out '{{ easyrsa_pki_dir }}/private/{{ item.name }}.p1'
{{ '-passin pass:' + item.pass | string if item.pass | default(None) else '' }}
{{ '-aes256 -passout pass:' + item.pass | string if item.pass | default(None) else
'' }}
easyrsa
{{ '--passin=pass:' + item.pass | string if item.pass | default(None) else '' }}
{{ '--passout=pass:' + item.pass | string if item.pass | default(None) else '' }}
export-p1 {{ item.name }}
args:
creates: "{{ easyrsa_pki_dir }}/private/{{ item.name }}.p1"
loop: "{{ easyrsa_to_pkcs1 }}"
Expand Down

0 comments on commit a63795b

Please sign in to comment.