/[smecontribs]/rpms/openssl3/contribs10/renew-dummy-cert
ViewVC logotype

Contents of /rpms/openssl3/contribs10/renew-dummy-cert

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.1 - (show annotations) (download)
Wed Jan 31 17:24:58 2024 UTC (9 months, 3 weeks ago) by jpp
Branch: MAIN
CVS Tags: openssl3-3_0_7-5_el7_sme_1, HEAD
Error occurred while calculating annotation data.
Initial import

1 #!/bin/bash
2
3 if [ $# -eq 0 ]; then
4 echo $"Usage: `basename $0` filename" 1>&2
5 exit 1
6 fi
7
8 PEM=$1
9 REQ=`/bin/mktemp /tmp/openssl.XXXXXX`
10 KEY=`/bin/mktemp /tmp/openssl.XXXXXX`
11 CRT=`/bin/mktemp /tmp/openssl.XXXXXX`
12 NEW=${PEM}_
13
14 trap "rm -f $REQ $KEY $CRT $NEW" SIGINT
15
16 if [ ! -f $PEM ]; then
17 echo "$PEM: file not found" 1>&2
18 exit 1
19 fi
20
21 umask 077
22
23 OWNER=`ls -l $PEM | awk '{ printf "%s.%s", $3, $4; }'`
24
25 openssl rsa -inform pem -in $PEM -out $KEY
26 openssl x509 -x509toreq -in $PEM -signkey $KEY -out $REQ
27 openssl x509 -req -in $REQ -signkey $KEY -days 365 \
28 -extfile /etc/pki/tls/openssl.cnf -extensions v3_ca -out $CRT
29
30 (cat $KEY ; echo "" ; cat $CRT) > $NEW
31
32 chown $OWNER $NEW
33
34 mv -f $NEW $PEM
35
36 rm -f $REQ $KEY $CRT
37
38 exit 0
39

admin@koozali.org
ViewVC Help
Powered by ViewVC 1.2.1 RSS 2.0 feed