Last active
August 6, 2020 13:43
-
-
Save Haruroid/03f3606a82eb491bb22251924b98b383 to your computer and use it in GitHub Desktop.
instant script for building CA of client authentication
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
openssl genrsa -des3 -out ca.key 4096 | |
openssl req -new -x509 -days 3650 -key ca.key -out ca.crt -subj "/C=CN/ST=Shenzhen/L=ComeCity/O=CA/OU=common/CN=/emailAddress=" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ $# != 1 ]; then | |
echo "newuser.sh [user]" | |
exit 1 | |
fi | |
openssl genrsa -out $1.key 4096 | |
openssl req -new -key $1.key -out $1.csr -subj "/C=CN/ST=Shenzhen/L=ComeCity/O=Client/OU=common/CN=/emailAddress=" | |
openssl x509 -req -days 3650 -in $1.csr -CA ca.crt -CAkey ca.key -set_serial 01 -out $1.crt | |
openssl pkcs12 -export -out $1.pfx -inkey $1.key -in $1.crt -certfile ca.crt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment