svn cleanup
[anytun.git] / openvpn / easy-rsa / build-key-pass
blob03ab30466a0b095479855f3031241aecb912f85a
1 #!/bin/sh
4 # Similar to build-key, but protect the private key
5 # with a password.
8 if test $# -ne 1; then
9 echo "usage: build-key-pass <name>";
10 exit 1
13 if test $KEY_DIR; then
14 cd $KEY_DIR && \
15 openssl req -days 3650 -new -keyout $1.key -out $1.csr -config $KEY_CONFIG && \
16 openssl ca -days 3650 -out $1.crt -in $1.csr -config $KEY_CONFIG && \
17 chmod 0600 $1.key
18 else
19 echo you must define KEY_DIR