Skip to content

Commit bcd21fb

Browse files
committed
#54 Generate and export key pair without password prompt
1 parent d21d4f6 commit bcd21fb

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

backend/config/crypto/keys.bash

+8-2
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ function remove() {
1919
}
2020

2121
function generate() {
22+
echo "Generation key pair..."
2223
keytool \
2324
-genkeypair \
2425
-alias "$ALIAS" \
@@ -31,8 +32,13 @@ function generate() {
3132
-storeType PKCS12 \
3233
-storepass "$PASSWORD"
3334

34-
openssl pkcs12 -in "$KEYSTORE" -nocerts -out "$ALIAS-private.pem"
35-
openssl pkcs12 -in "$KEYSTORE" -nokeys -out "$ALIAS-public.pem"
35+
echo "Exporting a private key..."
36+
openssl pkcs12 -in "$KEYSTORE" -nocerts -out "$ALIAS-private.pem" \
37+
-passin pass:"$PASSWORD" -passout pass:"$PASSWORD"
38+
39+
echo "Exporting a public key..."
40+
openssl pkcs12 -in "$KEYSTORE" -nokeys -out "$ALIAS-public.pem" \
41+
-passin pass:"$PASSWORD" -passout pass:"$PASSWORD"
3642

3743
copy "$KEYSTORE"
3844
copy "$ALIAS-private.pem"

0 commit comments

Comments
 (0)