1#!/usr/bin/env python3 2# Copyright 2023 The Chromium Authors 3# Use of this source code is governed by a BSD-style license that can be 4# found in the LICENSE file. 5"""Single certificate chain for serverAuth which is self-issued but which 6does not contain the signer cert.""" 7 8import sys 9sys.path += ['../..'] 10 11import gencerts 12 13# Self-signed root certificate with same name as target. 14root = gencerts.create_self_signed_root_certificate('Target') 15 16# Target certificate. 17target = gencerts.create_end_entity_certificate('Target', root) 18target.get_extensions().set_property('extendedKeyUsage', 'serverAuth') 19 20chain = [target] 21gencerts.write_chain(__doc__, chain, 'chain.pem') 22