xref: /openssl/demos/certs/apps/mkxcerts.sh (revision bcd92754)
1#!/bin/sh
2
3# Create certificates using various algorithms to test multi-certificate
4# functionality.
5
6opensslcmd() {
7    LD_LIBRARY_PATH=../../.. ../../../apps/openssl $@
8}
9
10opensslcmd version
11
12CN="OpenSSL Test RSA SHA-1 cert" opensslcmd req \
13	-config apps.cnf -extensions usr_cert -x509 -nodes \
14	-keyout tsha1.pem -out tsha1.pem -new -days 3650 -sha1
15CN="OpenSSL Test RSA SHA-256 cert" opensslcmd req \
16	-config apps.cnf -extensions usr_cert -x509 -nodes \
17	-keyout tsha256.pem -out tsha256.pem -new -days 3650 -sha256
18CN="OpenSSL Test RSA SHA-512 cert" opensslcmd req \
19	-config apps.cnf -extensions usr_cert -x509 -nodes \
20	-keyout tsha512.pem -out tsha512.pem -new -days 3650 -sha512
21
22# Create EC parameters
23
24opensslcmd ecparam -name P-256 -out ecp256.pem
25opensslcmd ecparam -name P-384 -out ecp384.pem
26
27CN="OpenSSL Test P-256 SHA-256 cert" opensslcmd req \
28	-config apps.cnf -extensions ec_cert -x509 -nodes \
29	-nodes -keyout tecp256.pem -out tecp256.pem -newkey ec:ecp256.pem \
30	-days 3650 -sha256
31
32CN="OpenSSL Test P-384 SHA-384 cert" opensslcmd req \
33	-config apps.cnf -extensions ec_cert -x509 -nodes \
34	-nodes -keyout tecp384.pem -out tecp384.pem -newkey ec:ecp384.pem \
35	-days 3650 -sha384
36