OLD | NEW |
1 #!/bin/bash | 1 #!/bin/bash |
2 | 2 |
3 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 3 # Copyright (c) 2012 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 certificates for the unittests in | 7 # This script generates certificates for the unittests in |
8 # net/base/client_cert_store_unittest.cc. The output files are versioned in | 8 # net/base/client_cert_store_unittest.cc. The output files are versioned in |
9 # net/data/ssl/certificates (client_1.pem, client_2.pem). | 9 # net/data/ssl/certificates (client_1.pem, client_2.pem). |
10 | 10 |
(...skipping 23 matching lines...) Expand all Loading... |
34 -out out/root_$id.csr \ | 34 -out out/root_$id.csr \ |
35 -config client_authentication.cnf | 35 -config client_authentication.cnf |
36 | 36 |
37 # Sign the root cert. | 37 # Sign the root cert. |
38 ID=$id \ | 38 ID=$id \ |
39 DISTINGUISHED_NAME=ca_dn \ | 39 DISTINGUISHED_NAME=ca_dn \ |
40 try openssl x509 \ | 40 try openssl x509 \ |
41 -req -days 3650 \ | 41 -req -days 3650 \ |
42 -in out/root_$id.csr \ | 42 -in out/root_$id.csr \ |
43 -signkey out/root_$id.key \ | 43 -signkey out/root_$id.key \ |
| 44 -text \ |
44 -out out/root_$id.pem | 45 -out out/root_$id.pem |
45 -config client_authentication.cnf | 46 -config client_authentication.cnf |
46 | 47 |
47 # Generate a private key for the client. | 48 # Generate a private key for the client. |
48 try openssl genrsa -out out/client_$id.key 2048 | 49 try openssl genrsa -out out/client_$id.key 2048 |
49 | 50 |
50 # Create a certificate signing request for the client cert. | 51 # Create a certificate signing request for the client cert. |
51 ID=$id \ | 52 ID=$id \ |
52 DISTINGUISHED_NAME=client_dn \ | 53 DISTINGUISHED_NAME=client_dn \ |
53 try openssl req \ | 54 try openssl req \ |
(...skipping 14 matching lines...) Expand all Loading... |
68 -keyfile out/root_$id.key \ | 69 -keyfile out/root_$id.key \ |
69 -out out/client_$id.pem \ | 70 -out out/client_$id.pem \ |
70 -config client_authentication.cnf | 71 -config client_authentication.cnf |
71 | 72 |
72 # Package the client cert and private key into a pkcs12 file. | 73 # Package the client cert and private key into a pkcs12 file. |
73 try openssl pkcs12 \ | 74 try openssl pkcs12 \ |
74 -inkey out/client_$id.key \ | 75 -inkey out/client_$id.key \ |
75 -in out/client_$id.pem \ | 76 -in out/client_$id.pem \ |
76 -out out/client_$id.p12 \ | 77 -out out/client_$id.p12 \ |
77 -export \ | 78 -export \ |
78 -passout pass: | 79 -passout pass:chrome |
79 done | 80 done |
OLD | NEW |