-
Notifications
You must be signed in to change notification settings - Fork 0
/
private
29 lines (29 loc) · 1.04 KB
/
private
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/bash
########################################################################
#Script Name : CRYPTOCA
#Description : Create a CA to sign and issue certificates.
#Args : Interactive
#Author : Dari Garcia (manofftoday)
#GitHub : https://github.com/manofftoday
#File : private
#Description : Private key functions
########################################################################
function private_key_ca(){
clear
openssl genrsa -aes256 -out $DIR_CA/private/${CA_NAME}.key.pem 4096
chmod 400 $DIR_CA/private/${CA_NAME}.key.pem
echo "$CA_NAME private key created"
}
function private_cert(){
clear
echo "Creating certificate issued by $CA_NAME"
read -p "Enter the certificate URL: " SRVURL
echo "Would you like to use aes256 to generate the certificate?[y/n]"
read a
if [ "$a" = "y" ]
then
openssl genrsa -aes256 -out $DIR_CA/private/${SRVURL}.key.pem 2048
fi
openssl genrsa -out $DIR_CA/private/${SRVURL}.key.pem 2048
chmod 400 $DIR_CA/private/${SRVURL}.key.pem
}