summaryrefslogtreecommitdiffstats
path: root/tests/pytests/certs/tt-certgen-expired.sh
blob: 23a6978299e308e570097105ef404bcde76b6784 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# !/bin/bash
# SPDX-License-Identifier: GPL-3.0-or-later

if [ ! -d ./demoCA ]; then
  mkdir ./demoCA
fi
if [ ! -d ./demoCA/newcerts ]; then
  mkdir ./demoCA/newcerts
fi
touch ./demoCA/index.txt
touch ./demoCA/index.txt.attr
if [ ! -f ./demoCA/serial ]; then
  echo 01 > ./demoCA/serial
fi

openssl genrsa -out tt-expired.key.pem 2048
openssl req -config tt.conf -new -key tt-expired.key.pem -out tt-expired.csr.pem
openssl ca -config tt.conf -selfsign -keyfile tt-expired.key.pem -out tt-expired.cert.pem -in tt-expired.csr.pem -startdate 19700101000000Z -enddate 19700101000000Z