| OLD | NEW |
| 1 #!/bin/sh | 1 #!/bin/sh |
| 2 | 2 |
| 3 # Copyright (c) 2011 The Chromium Authors. All rights reserved. | 3 # Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
| 5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
| 6 | 6 |
| 7 # This script generates a set of test (end-entity, intermediate, root) | 7 # This script generates a set of test (end-entity, intermediate, root) |
| 8 # certificates with (weak, strong), (RSA, DSA, ECDSA) key pairs. | 8 # certificates with (weak, strong), (RSA, DSA, ECDSA) key pairs. |
| 9 | 9 |
| 10 key_types="768-rsa 1024-rsa 2048-rsa prime256v1-ecdsa" | 10 key_types="768-rsa 1024-rsa 2048-rsa prime256v1-ecdsa" |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 | 45 |
| 46 CA_COMMON_NAME="2048 RSA Test Root CA" \ | 46 CA_COMMON_NAME="2048 RSA Test Root CA" \ |
| 47 CA_DIR=out \ | 47 CA_DIR=out \ |
| 48 CA_NAME=req_env_dn \ | 48 CA_NAME=req_env_dn \ |
| 49 KEY_SIZE=2048 \ | 49 KEY_SIZE=2048 \ |
| 50 ALGO=rsa \ | 50 ALGO=rsa \ |
| 51 CERT_TYPE=root \ | 51 CERT_TYPE=root \ |
| 52 try openssl req \ | 52 try openssl req \ |
| 53 -new \ | 53 -new \ |
| 54 -key out/2048-rsa-root.key \ | 54 -key out/2048-rsa-root.key \ |
| 55 -extensions ca_cert \ | 55 -extensions ca_cert \ |
| 56 -out out/2048-rsa-root.csr \ | 56 -out out/2048-rsa-root.csr \ |
| 57 -config ca.cnf | 57 -config ca.cnf |
| 58 | 58 |
| 59 CA_COMMON_NAME="2048 RSA Test Root CA" \ | 59 CA_COMMON_NAME="2048 RSA Test Root CA" \ |
| 60 CA_DIR=out \ | 60 CA_DIR=out \ |
| 61 CA_NAME=req_env_dn \ | 61 CA_NAME=req_env_dn \ |
| 62 try openssl x509 \ | 62 try openssl x509 \ |
| 63 -req -days 3650 \ | 63 -req -days 3650 \ |
| 64 -in out/2048-rsa-root.csr \ | 64 -in out/2048-rsa-root.csr \ |
| 65 -extensions ca_cert \ | 65 -extensions ca_cert \ |
| 66 -signkey out/2048-rsa-root.key \ | 66 -signkey out/2048-rsa-root.key \ |
| 67 -out out/2048-rsa-root.pem | 67 -out out/2048-rsa-root.pem |
| 68 | 68 |
| 69 # Generate private keys of all types and strengths for intermediate CAs and | 69 # Generate private keys of all types and strengths for intermediate CAs and |
| 70 # end-entities. | 70 # end-entities. |
| 71 for key_type in $key_types | 71 for key_type in $key_types |
| 72 do | 72 do |
| 73 key_size=$(echo "$key_type" | sed -E 's/-.+//') | 73 key_size=$(echo "$key_type" | sed -E 's/-.+//') |
| 74 algo=$(echo "$key_type" | sed -E 's/.+-//') | 74 algo=$(echo "$key_type" | sed -E 's/.+-//') |
| 75 | 75 |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 ALGO=$signer_algo \ | 159 ALGO=$signer_algo \ |
| 160 CERT_TYPE=intermediate \ | 160 CERT_TYPE=intermediate \ |
| 161 try openssl ca \ | 161 try openssl ca \ |
| 162 -batch \ | 162 -batch \ |
| 163 -in out/$key_type-ee-by-$signer_key_type-intermediate.csr \ | 163 -in out/$key_type-ee-by-$signer_key_type-intermediate.csr \ |
| 164 -out out/$key_type-ee-by-$signer_key_type-intermediate.pem \ | 164 -out out/$key_type-ee-by-$signer_key_type-intermediate.pem \ |
| 165 -config ca.cnf | 165 -config ca.cnf |
| 166 done | 166 done |
| 167 done | 167 done |
| 168 | 168 |
| OLD | NEW |