3 # Copyright 2013 The Chromium Authors. All rights reserved.
4 # Use of this source code is governed by a BSD-style license that can be
5 # found in the LICENSE file.
7 # This script generates a set of test (end-entity, intermediate, root)
8 # certificates that can be used to test fetching of an intermediate via AIA.
18 # Create the serial number files.
19 try
/bin
/sh
-c "echo 01 > out/aia-test-root-serial"
20 try
/bin
/sh
-c "echo 01 > out/aia-test-intermediate-serial"
22 # Create the signers' DB files.
23 touch out
/aia-test-root-index.txt
24 touch out
/aia-test-intermediate-index.txt
27 try openssl genrsa
-out out
/aia-test-root.key
2048
28 try openssl genrsa
-out out
/aia-test-intermediate.key
2048
29 try openssl genrsa
-out out
/aia-test-cert.key
2048
31 # Generate the root certificate
32 CA_COMMON_NAME
="AIA Test Root CA" \
34 CA_NAME
=aia-test-root \
37 -key out
/aia-test-root.key \
38 -out out
/aia-test-root.csr \
41 CA_COMMON_NAME
="AIA Test Root CA" \
43 CA_NAME
=aia-test-root \
46 -in out
/aia-test-root.csr \
47 -out out
/aia-test-root.pem \
48 -signkey out
/aia-test-root.key \
49 -extfile aia-test.cnf \
53 # Generate the intermediate
54 CA_COMMON_NAME
="AIA Test Intermediate CA" \
56 CA_NAME
=aia-test-root \
59 -key out
/aia-test-intermediate.key \
60 -out out
/aia-test-intermediate.csr \
63 CA_COMMON_NAME
="AIA Test Intermediate CA" \
65 CA_NAME
=aia-test-root \
68 -in out
/aia-test-intermediate.csr \
69 -out out
/aia-test-intermediate.pem \
70 -config aia-test.cnf \
74 CA_COMMON_NAME
="aia-host.invalid" \
76 CA_NAME
=aia-test-intermediate \
79 -key out
/aia-test-cert.key \
80 -out out
/aia-test-cert.csr \
83 CA_COMMON_NAME
="AIA Test Intermediate CA" \
85 CA_NAME
=aia-test-intermediate \
86 AIA_URL
=http
://aia-test.invalid \
89 -in out
/aia-test-cert.csr \
90 -out out
/aia-test-cert.pem \
91 -config aia-test.cnf \
94 # Copy to the file names that are actually checked in.
95 try
cp out
/aia-test-cert.pem ..
/certificates
/aia-cert.pem
98 -in out
/aia-test-intermediate.pem \
99 -out ..
/certificates
/aia-intermediate.der
100 try
cp out
/aia-test-root.pem ..
/certificates
/aia-root.pem