Skip to content

Commit 0481ca7

Browse files
authored
Merge pull request #49 from deworn/add_more_ssl_specs
Added workflows for certificates and keys
2 parents 8741b47 + 453d2d8 commit 0481ca7

10 files changed

Lines changed: 179 additions & 0 deletions
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
name: Add password to private RSA key using AES256
3+
command: "openssl rsa -aes256 -in {{in_key}} -out {{out_pass_key}}"
4+
tags:
5+
- ssl
6+
- openssl
7+
description: "Add password to private RSA key using AES256."
8+
arguments:
9+
- name: in_key
10+
description: "Input RSA key without password."
11+
default_value: in.key
12+
- name: "out_pass_key"
13+
description: "Output RSA key protected with password."
14+
default_value: "out.key"
15+
author: Petr Stepan (Deworn)
16+
author_url: "https://github.com/deworn"
17+
shells: []

specs/ssl/check_web_certs.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
name: Check website certificate
3+
command: "openssl s_client -connect {{url}}:443 -showcerts"
4+
tags:
5+
- ssl
6+
- openssl
7+
description: "Check certificate of specific web site or URL."
8+
arguments:
9+
- name: url
10+
description: "URL to check."
11+
default_value: ""
12+
author: Petr Stepan (Deworn)
13+
author_url: "https://github.com/deworn"
14+
shells: []

specs/ssl/convert_der_to_pem.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
name: Convert certificate from DER to PEM
3+
command: "openssl x509 -inform der -outform pem -in {{in_der_cert}} -out {{out_pem_cert}}"
4+
tags:
5+
- ssl
6+
- openssl
7+
description: "Convert certificate in DER binary encoding to PEM format (base64)"
8+
arguments:
9+
- name: in_der_cert
10+
description: "Input certificate file in DER encoding. Files usually have .der or .cer extensions."
11+
default_value: in_cert.der
12+
- name: out_pem_cert
13+
description: "Output certificate file which will be in PEM format. Files usually have .pem, .crt, or .cer extensions."
14+
default_value: out_cert.pem
15+
author: Petr Stepan (Deworn)
16+
author_url: "https://github.com/deworn"
17+
shells: []

specs/ssl/convert_pem_to_der.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
name: Convert certificate from PEM to DER
3+
command: "openssl x509 -inform pem -outform der -in {{in_pem_cert}} -out {{out_der_cert}}"
4+
tags:
5+
- ssl
6+
- openssl
7+
description: "Convert certificate in PEM format (base64) to DER binary encoding"
8+
arguments:
9+
- name: in_pem_cert
10+
description: "Input certificate file in PEM format. Files usually have .pem, .crt, or .cer extensions."
11+
default_value: in_cert.pem
12+
- name: out_der_cert
13+
description: "Output certificate file which will be DER encoded. Files usually have .der or .cer extensions."
14+
default_value: out_cert.der
15+
author: Petr Stepan (Deworn)
16+
author_url: "https://github.com/deworn"
17+
shells: []
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
name: Convert certificate from PEM to PKCS#12
3+
command: "openssl pkcs12 -export -out {{out_pkcs12_cert}} -in {{in_pem_cert}} -inkey {{in_pem_private_key}} -certfile {{in_pem_cacert}}"
4+
tags:
5+
- ssl
6+
- openssl
7+
description: "Convert certificate in PKCS#12 container format (private key included) to PEM format (base64)"
8+
arguments:
9+
- name: in_pem_cert
10+
description: "Input certificate file in PEM format. Files usually have .pem, .crt, or .cer extensions."
11+
default_value: in_cert.pem
12+
- name: in_pem_private_key
13+
description: "Input private key file (in PEM format) which fits in_pem_cert. Files usually have .key extension."
14+
default_value: in_private.key
15+
- name: in_pem_cacert
16+
description: "Input certificate file (or file bundle) of Certification Authority (in PEM format) which signed in_pem_cert file. Files usually have .pem, .crt, or .cer extensions."
17+
default_value: cacert.pem
18+
- name: out_pkcs12_cert
19+
description: "Output file which will be in PKCS#12 container format with private key. Files usually have .pfx or .p12 extensions."
20+
default_value: out_cert.pfx
21+
author: Petr Stepan (Deworn)
22+
author_url: "https://github.com/deworn"
23+
shells: []
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
name: Convert certificate from PKCS#12 to PEM
3+
command: "openssl pkcs12 -in {{in_pkcs12_cert}} -out {{out_pem_cert}} -nodes"
4+
tags:
5+
- ssl
6+
- openssl
7+
description: "Convert certificate in PKCS#12 container format (private key included) to PEM format (base64)"
8+
arguments:
9+
- name: in_pkcs12_cert
10+
description: "Input certificate file in PKCS#12 container format. Files usually have .pfx or .p12 extensions."
11+
default_value: in_cert.pfx
12+
- name: out_pem_cert
13+
description: "Output certificate file which will be in PEM format. Files usually have .pem, .crt, or .cer extensions."
14+
default_value: out_cert.pem
15+
author: Petr Stepan (Deworn)
16+
author_url: "https://github.com/deworn"
17+
shells: []
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
name: Export public key from private RSA key
3+
command: "openssl rsa -in {{in_key}} -pubout -out {{out_pub_key}}"
4+
tags:
5+
- ssl
6+
- openssl
7+
description: "Export public part of the key from private RSA key."
8+
arguments:
9+
- name: in_key
10+
description: "Input private RSA key."
11+
default_value: in.key
12+
- name: out_pub_key
13+
description: "Output key which contains only public part."
14+
default_value: out.key
15+
author: Petr Stepan (Deworn)
16+
author_url: "https://github.com/deworn"
17+
shells: []
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
name: Generate a CSR from configuration/template
3+
command: "openssl req -new -config {{conf_file}} -out {{csr_file}} -verbose"
4+
tags:
5+
- ssl
6+
- openssl
7+
description: "Generates a Certificate Signing Request (CSR) from configuration (template) file. This CSR is needs to be signed by Certification Authority."
8+
arguments:
9+
- name: conf_file
10+
description: "Configuration file containing all details for CSR."
11+
default_value: csr_template.conf
12+
- name: csr_file
13+
description: "Output CSR file which needs to be signed by Certification Authority."
14+
default_value: client.csr
15+
author: Petr Stepan (Deworn)
16+
author_url: "https://github.com/deworn"
17+
shells: []

specs/ssl/generate_key.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
name: Generate RSA key
3+
command: 'ssh-keygen -t {{key_type}} -b {{key_size}} -o -a 100 -C "{{key_comment}}" -f "{{key_file_name}}"'
4+
tags:
5+
- ssl
6+
- openssl
7+
description: "Generate new RSA key with 100 KDF rounds."
8+
arguments:
9+
- name: key_type
10+
description: "Type of the new key. Options are: rsa, dsa, ed25519, ed25519-sk, ecdsa, ecdsa-sk"
11+
default_value: "rsa"
12+
- name: key_size
13+
description: "Size of new key in bits. DSA example: 1024. RSA example: 2048, 3072, 4096. ECDSA examples: 256, 384, 512. EXDSA-SK, ED25519 and ED25519-SK have fixed length (flag will be ignored)."
14+
default_value: "2048"
15+
- name: key_comment
16+
description: "Comment displayed at the end of the key. Optional."
17+
default_value: ""
18+
- name: key_file_name
19+
description: "Filename of the new key."
20+
default_value: ""
21+
author: Petr Stepan (Deworn)
22+
author_url: "https://github.com/deworn"
23+
shells: []
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
name: Remove password from private RSA key
3+
command: "openssl rsa -in {{in_pass_key}} -out {{out_key}}"
4+
tags:
5+
- ssl
6+
- openssl
7+
description: "Remove password from private RSA key."
8+
arguments:
9+
- name: in_pass_key
10+
description: "Input RSA key protected with password."
11+
default_value: in.key
12+
- name: out_key
13+
description: "Output RSA key without password."
14+
default_value: out.key
15+
author: Petr Stepan (Deworn)
16+
author_url: "https://github.com/deworn"
17+
shells: []

0 commit comments

Comments
 (0)