| 1 | # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. |
| 2 | # SPDX-License-Identifier: Apache-2.0 |
| 3 | |
| 4 | # This script will generate all of the certs used for examples and tests in |
| 5 | # the rust bindings crates. |
| 6 | |
| 7 | # Used for TLS 1.2 connections. |
| 8 | echo "generating rsa key and cert" |
| 9 | openssl req -x509 -newkey rsa:4096 -keyout key_rsa.pem -out cert_rsa.pem -sha256 -days 36500 -nodes -subj "/C=US/ST=AZ/L=Tempe/O=Maas/OU=BioComputing/CN=localhost" |
| 10 | |
| 11 | |
| 12 | # Used for TLS 1.3 connections. |
| 13 | echo "generating ec key and cert" |
| 14 | openssl req -x509 -newkey ec -pkeyopt ec_paramgen_curve:P-256 -keyout key.pem -out cert.pem -sha256 -days 36500 -nodes -subj "/C=US/ST=AZ/L=Tempe/O=Amazon/OU=AmazonWebServices/CN=localhost" |
| 15 | |
| 16 | |
| 17 | # Used for testing IPv6. Includes the localhost IPv6 address as a SAN. |
| 18 | echo "generating localhost IPv6 key and cert" |
| 19 | openssl req -x509 \ |
| 20 | -newkey rsa:2048 \ |
| 21 | -keyout key_localhost_ipv6.pem \ |
| 22 | -out cert_localhost_ipv6.pem \ |
| 23 | -sha256 \ |
| 24 | -days 36500 \ |
| 25 | -nodes \ |
| 26 | -subj "/C=US/ST=MA/L=Boston/O=Amazon/OU=AmazonWebServices/CN=localhost" \ |
| 27 | -addext "subjectAltName = IP:0:0:0:0:0:0:0:1" |