~vcs-imports-ii/znc/master

« back to all changes in this revision

Viewing changes to CreatePem.sh

  • Committer: prozacx
  • Date: 2004-08-24 00:08:51 UTC
  • Revision ID: git-v1:538d3ece4e737807e7d5a11849aab177b87c1571
Initial revision


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@2 726aef4b-f618-498e-8847-2d620e286838

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh
 
2
 
 
3
if [ "$1" = "" ]; then
 
4
        echo CreatePem.sh file.pem
 
5
        exit 1
 
6
fi
 
7
 
 
8
log () {
 
9
        echo [`date`] $*
 
10
}
 
11
 
 
12
log Creating Random File for key seed
 
13
dd if=/dev/urandom of=blah-1234.txt bs=1024k count=10 >/dev/null 2>&1
 
14
 
 
15
openssl genrsa -rand blah-1234.txt -out ${1}.key
 
16
openssl req -new -key ${1}.key -out ${1}.csr
 
17
openssl x509 -req -days 365 -in ${1}.csr -signkey ${1}.key -out ${1}.crt
 
18
 
 
19
log Cleaning up
 
20
rm -f blah-1234.txt ${1}.csr
 
21
log done
 
22
 
 
23
cat ${1}.key > $1
 
24
cat ${1}.crt >> $1
 
25
 
 
26
rm ${1}.key ${1}.crt
 
27
 
 
28
echo "Created $1"