File: create_certificate.sh

package info (click to toggle)
uhub 0.4.1-3
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 1,420 kB
  • ctags: 2,241
  • sloc: ansic: 18,124; xml: 575; perl: 568; sh: 368; makefile: 24
file content (16 lines) | stat: -rwxr-xr-x 391 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/bin/sh

OPENSSL=/usr/bin/openssl
NAME=certificate

if [ ! -x ${OPENSSL} ]; then
	echo "Cannot locate the openssl utility: ${OPENSSL}"
	exit 1
fi

${OPENSSL} genrsa -out ${NAME}.key 1024 &&
${OPENSSL} req -new -x509 -nodes -sha1 -days 365 -key ${NAME}.key > ${NAME}.crt &&
cat ${NAME}.key ${NAME}.crt > ${NAME}.pem && rm -f ${NAME}.key ${NAME}.crt

echo "Created certificate ${NAME}.pem"