| OLD | NEW |
| (Empty) |
| 1 #!/usr/bin/python | |
| 2 # Copyright (c) 2017 The Chromium Authors. All rights reserved. | |
| 3 # Use of this source code is governed by a BSD-style license that can be | |
| 4 # found in the LICENSE file. | |
| 5 | |
| 6 """Certificate chain with 1 intermediate, a trusted root, and a target | |
| 7 certificate for serverAuth that has only keyEncipherment.""" | |
| 8 | |
| 9 import sys | |
| 10 sys.path += ['..'] | |
| 11 | |
| 12 import common | |
| 13 | |
| 14 # Self-signed root certificate (used as trust anchor). | |
| 15 root = common.create_self_signed_root_certificate('Root') | |
| 16 | |
| 17 # Intermediate certificate. | |
| 18 intermediate = common.create_intermediate_certificate('Intermediate', root) | |
| 19 | |
| 20 # Target certificate. | |
| 21 target = common.create_end_entity_certificate('Target', intermediate) | |
| 22 target.set_key(common.get_or_generate_ec_key( | |
| 23 'secp384r1', common.create_key_path(target.name))) | |
| 24 target.get_extensions().set_property('extendedKeyUsage', 'serverAuth') | |
| 25 target.get_extensions().set_property('keyUsage', 'critical,keyEncipherment') | |
| 26 | |
| 27 chain = [target, intermediate, root] | |
| 28 common.write_chain(__doc__, chain, 'chain.pem') | |
| OLD | NEW |