Skip to content

Commit

Permalink
Don't store example keys and certs in repository.
Browse files Browse the repository at this point in the history
  • Loading branch information
SergioBenitez committed Jul 7, 2021
1 parent 581b63d commit 7182391
Show file tree
Hide file tree
Showing 12 changed files with 17 additions and 240 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
*.rlib
*.dll

# Keys
*.pem
*.p12

# Executables
*.exe

Expand Down
33 changes: 0 additions & 33 deletions examples/tls/private/ca_cert.pem

This file was deleted.

51 changes: 0 additions & 51 deletions examples/tls/private/ca_key.pem

This file was deleted.

20 changes: 0 additions & 20 deletions examples/tls/private/ecdsa_nistp256_sha256_cert.pem

This file was deleted.

5 changes: 0 additions & 5 deletions examples/tls/private/ecdsa_nistp256_sha256_key_pkcs8.pem

This file was deleted.

21 changes: 0 additions & 21 deletions examples/tls/private/ecdsa_nistp384_sha384_cert.pem

This file was deleted.

6 changes: 0 additions & 6 deletions examples/tls/private/ecdsa_nistp384_sha384_key_pkcs8.pem

This file was deleted.

20 changes: 0 additions & 20 deletions examples/tls/private/ed25519_cert.pem

This file was deleted.

3 changes: 0 additions & 3 deletions examples/tls/private/ed25519_key.pem

This file was deleted.

13 changes: 13 additions & 0 deletions examples/tls/private/gen_certs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ function gen_rsa_sha256() {
-CA ca_cert.pem -CAkey ca_key.pem -CAcreateserial \
-in server.csr -out rsa_sha256_cert.pem

openssl pkcs12 -export -password pass:rocket \
-in rsa_sha256_cert.pem -inkey rsa_sha256_key.pem -out rsa_sha256.p12

rm ca_cert.srl server.csr
}

Expand All @@ -55,10 +58,14 @@ function gen_ed25519() {
openssl genpkey -algorithm ED25519 > ed25519_key.pem

openssl req -new -key ed25519_key.pem -subj "${SUBJECT}" -out server.csr

openssl x509 -req -extfile <(printf "subjectAltName=${ALT}") -days 3650 \
-CA ca_cert.pem -CAkey ca_key.pem -CAcreateserial \
-in server.csr -out ed25519_cert.pem

openssl pkcs12 -export -password pass:rocket \
-in ed25519_cert.pem -inkey ed25519_key.pem -out ed25519.p12

rm ca_cert.srl server.csr
}

Expand All @@ -78,6 +85,9 @@ function gen_ecdsa_nistp256_sha256() {
-CA ca_cert.pem -CAkey ca_key.pem -CAcreateserial \
-in server.csr -out ecdsa_nistp256_sha256_cert.pem

openssl pkcs12 -export -password pass:rocket -in ecdsa_nistp256_sha256_cert.pem \
-inkey ecdsa_nistp256_sha256_key_pkcs8.pem -out ecdsa_nistp256_sha256.p12

rm ca_cert.srl server.csr ecdsa_nistp256_sha256_key.pem
}

Expand All @@ -97,6 +107,9 @@ function gen_ecdsa_nistp384_sha384() {
-CA ca_cert.pem -CAkey ca_key.pem -CAcreateserial \
-in server.csr -out ecdsa_nistp384_sha384_cert.pem

openssl pkcs12 -export -password pass:rocket -in ecdsa_nistp384_sha384_cert.pem \
-inkey ecdsa_nistp384_sha384_key_pkcs8.pem -out ecdsa_nistp384_sha384.p12

rm ca_cert.srl server.csr ecdsa_nistp384_sha384_key.pem
}

Expand Down
30 changes: 0 additions & 30 deletions examples/tls/private/rsa_sha256_cert.pem

This file was deleted.

51 changes: 0 additions & 51 deletions examples/tls/private/rsa_sha256_key.pem

This file was deleted.

0 comments on commit 7182391

Please sign in to comment.