1#!/usr/bin/env python 2# Copyright 2015 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 6"""Certificate chain where the intermediate contains an unknown non-critical 7extension.""" 8 9import sys 10sys.path += ['../..'] 11 12import gencerts 13 14# Self-signed root certificate. 15root = gencerts.create_self_signed_root_certificate('Root') 16intermediate = gencerts.create_intermediate_certificate('Intermediate', root) 17 18# Intermediate that has an unknown non-critical extension. 19intermediate.get_extensions().add_property('1.2.3.4', 'DER:01:02:03:04') 20 21# Target certificate. 22target = gencerts.create_end_entity_certificate('Target', intermediate) 23 24chain = [target, intermediate, root] 25gencerts.write_chain(__doc__, chain, 'chain.pem') 26