• Home
  • Raw
  • Download

Lines Matching +full:- +full:- +full:prefix

22 # SPDX-License-Identifier: curl
27 if [ -f /usr/local/ssl/bin/openssl ] ; then
31 USAGE="echo Usage is genserv.sh <prefix> <caprefix>"
34 set -e
41 # The -sha256 option was introduced in OpenSSL 1.0.1
42 DIGESTALGO=-sha256
48 PREFIX=$1
49 if [ ".$PREFIX" = . ] ; then
50 echo No configuration prefix
53 if [ ! -f $PREFIX-sv.prm ] ; then
54 echo No configuration file $PREFIX-sv.prm
61 echo No CA prefix
64 if [ ! -f $CAPREFIX-ca.cacert ] ; then
65 echo No CA certificate file $CAPREFIX-ca.caert
68 if [ ! -f $CAPREFIX-ca.key ] ; then
81 GETSERIAL="\$t = time ;\$d = \$t . substr(\$t+$$ ,-4,4)-1;print \$d"
82 SERIAL=`/usr/bin/env perl -e "$GETSERIAL"`
85 echo SERIAL=$SERIAL PREFIX=$PREFIX CAPREFIX=$CAPREFIX DURATION=$DURATION KEYSIZE=$KEYSIZE
88 echo "openssl dhparam -2 -out $PREFIX-sv.dhp $KEYSIZE"
89 $OPENSSL dhparam -2 -out $PREFIX-sv.dhp $KEYSIZE
93 …echo "openssl req -config $PREFIX-sv.prm -newkey rsa:$KEYSIZE -keyout $PREFIX-sv.key -out $PREFIX-
94 …$OPENSSL req -config $PREFIX-sv.prm -newkey rsa:$KEYSIZE -keyout $PREFIX-sv.key -out $PREFIX-sv.cs…
97 echo "openssl rsa -in $PREFIX-sv.key -out $PREFIX-sv.key"
98 $OPENSSL rsa -in $PREFIX-sv.key -out $PREFIX-sv.key -passin pass:secret
101 echo "openssl rsa -in $PREFIX-sv.key -pubout -outform DER -out $PREFIX-sv.pub.der"
102 $OPENSSL rsa -in $PREFIX-sv.key -pubout -outform DER -out $PREFIX-sv.pub.der
104 echo "openssl rsa -in $PREFIX-sv.key -pubout -outform PEM -out $PREFIX-sv.pub.pem"
105 $OPENSSL rsa -in $PREFIX-sv.key -pubout -outform PEM -out $PREFIX-sv.pub.pem
107-set_serial $SERIAL -extfile $PREFIX-sv.prm -days $DURATION -CA $CAPREFIX-ca.cacert -CAkey $CAPRE…
109-set_serial $SERIAL -extfile $PREFIX-sv.prm -days $DURATION -CA $CAPREFIX-ca.cacert -CAkey $CAPRE…
113 …ENSSL pkcs12 -export -des3 -out $PREFIX-sv.p12 -caname $CAPREFIX -name $PREFIX -inkey $PREFIX-sv.k…
115 …ENSSL pkcs12 -export -des3 -out $PREFIX-sv.p12 -caname $CAPREFIX -name $PREFIX -inkey $PREFIX-sv.k…
118 echo "openssl x509 -noout -text -hash -in $PREFIX-sv.selfcert -nameopt multiline"
119 $OPENSSL x509 -noout -text -hash -in $PREFIX-sv.crt -nameopt multiline
122 touch $CAPREFIX-ca.db
123 echo 01 > $CAPREFIX-ca.cnt
124 echo "openssl ca -config $CAPREFIX-ca.cnf -revoke $PREFIX-sv.crt"
125 $OPENSSL ca -config $CAPREFIX-ca.cnf -revoke $PREFIX-sv.crt
128 echo "openssl ca -config $CAPREFIX-ca.cnf -gencrl -out $PREFIX-sv.crl"
129 $OPENSSL ca -config $CAPREFIX-ca.cnf -gencrl -out $PREFIX-sv.crl
131 echo "openssl x509 -in $PREFIX-sv.crt -outform der -out $PREFIX-sv.der "
132 $OPENSSL x509 -in $PREFIX-sv.crt -outform der -out $PREFIX-sv.der
135 touch $PREFIX-sv.dhp
136 cat $PREFIX-sv.prm $PREFIX-sv.key $PREFIX-sv.crt $PREFIX-sv.dhp >$PREFIX-sv.pem
137 chmod o-r $PREFIX-sv.prm
139 $OPENSSL x509 -in $PREFIX-sv.pem -pubkey -noout | \
140 $OPENSSL pkey -pubin -outform der | $OPENSSL dgst -sha256 -binary | \
141 $OPENSSL enc -base64 >$PREFIX-sv.pubkey-pinned
143 echo "$PREFIX-sv.pem done"