3 # Copyright 2015 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 CA and leaf cert which can be used for the
11 "$@" ||
(e
=$?
; echo "$@" > /dev
/stderr
; exit $e)
17 try
/bin
/sh
-c "echo 01 > out/2048-sha256-root-serial"
18 touch out
/2048-sha256-root-index.txt
21 try openssl genrsa
-out out
/2048-sha256-root.key
2048
23 # Generate the root certificate.
26 -key out
/2048-sha256-root.key \
27 -out out
/2048-sha256-root.req \
32 -in out
/2048-sha256-root.req \
33 -signkey out
/2048-sha256-root.key \
36 -text > out
/2048-sha256-root.pem
38 # Generate the leaf certificate request.
41 -keyout out
/leaf_cert.key \
42 -out out
/leaf_cert.req \
45 # Convert the key to pkcs8.
50 -in out
/leaf_cert.key \
51 -out out
/leaf_cert.pkcs8 \
54 # Generate the leaf certificate to be valid for three days.
58 -extensions user_cert \
59 -in out
/leaf_cert.req \
60 -out out
/leaf_cert.pem \