xref: /freebsd/crypto/openssl/demos/certs/apps/mkxcerts.sh (revision e0c4386e7e71d93b0edc0c8fa156263fc4a8b0b6)
1*e0c4386eSCy Schubert
2*e0c4386eSCy Schubert# Create certificates using various algorithms to test multi-certificate
3*e0c4386eSCy Schubert# functionality.
4*e0c4386eSCy Schubert
5*e0c4386eSCy SchubertOPENSSL=../../../apps/openssl
6*e0c4386eSCy SchubertCN="OpenSSL Test RSA SHA-1 cert" $OPENSSL req \
7*e0c4386eSCy Schubert	-config apps.cnf -extensions usr_cert -x509 -nodes \
8*e0c4386eSCy Schubert	-keyout tsha1.pem -out tsha1.pem -new -days 3650 -sha1
9*e0c4386eSCy SchubertCN="OpenSSL Test RSA SHA-256 cert" $OPENSSL req \
10*e0c4386eSCy Schubert	-config apps.cnf -extensions usr_cert -x509 -nodes \
11*e0c4386eSCy Schubert	-keyout tsha256.pem -out tsha256.pem -new -days 3650 -sha256
12*e0c4386eSCy SchubertCN="OpenSSL Test RSA SHA-512 cert" $OPENSSL req \
13*e0c4386eSCy Schubert	-config apps.cnf -extensions usr_cert -x509 -nodes \
14*e0c4386eSCy Schubert	-keyout tsha512.pem -out tsha512.pem -new -days 3650 -sha512
15*e0c4386eSCy Schubert
16*e0c4386eSCy Schubert# Create EC parameters
17*e0c4386eSCy Schubert
18*e0c4386eSCy Schubert$OPENSSL ecparam -name P-256 -out ecp256.pem
19*e0c4386eSCy Schubert$OPENSSL ecparam -name P-384 -out ecp384.pem
20*e0c4386eSCy Schubert
21*e0c4386eSCy SchubertCN="OpenSSL Test P-256 SHA-256 cert" $OPENSSL req \
22*e0c4386eSCy Schubert	-config apps.cnf -extensions ec_cert -x509 -nodes \
23*e0c4386eSCy Schubert	-nodes -keyout tecp256.pem -out tecp256.pem -newkey ec:ecp256.pem \
24*e0c4386eSCy Schubert	-days 3650 -sha256
25*e0c4386eSCy Schubert
26*e0c4386eSCy SchubertCN="OpenSSL Test P-384 SHA-384 cert" $OPENSSL req \
27*e0c4386eSCy Schubert	-config apps.cnf -extensions ec_cert -x509 -nodes \
28*e0c4386eSCy Schubert	-nodes -keyout tecp384.pem -out tecp384.pem -newkey ec:ecp384.pem \
29*e0c4386eSCy Schubert	-days 3650 -sha384
30