rustls-example/certs/ica/bootstrap.sh

16 lines
457 B
Bash
Raw Normal View History

2024-08-05 16:52:19 +09:00
#!/bin/bash
echo "Create $1 ICA"
openssl genpkey -algorithm EC -out $1.key -pkeyopt ec_paramgen_curve:P-384 -pkeyopt ec_param_enc:named_curve
openssl req -new -config ica.conf -key $1.key -out $1.csr
openssl x509 -req -days 730 -in $1.csr -out $1.crt -extfile ../rootca/rootca.conf -extensions v3_intermediate_ca \
-CAkey $2 -CA $3 -CAcreateserial
openssl ec -in $1.key -pubout -out $1.pub
openssl x509 -in $1.crt -text -pubkey -noout
cat $1.pub