• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 has a policies extension marked as
7critical, and contains an unknown policy qualifer (1.2.3.4)."""
8
9import sys
10sys.path += ['../..']
11
12import gencerts
13
14# Self-signed root certificate.
15root = gencerts.create_self_signed_root_certificate('Root')
16
17# Intermediate that has a critical policies extension containing an unknown
18# policy qualifer.
19intermediate = gencerts.create_intermediate_certificate('Intermediate', root)
20intermediate.get_extensions().add_property(
21    '2.5.29.32', ('critical,DER:30:13:30:11:06:02:2a:03:30:0b:30:09:06:03:'
22                  '2a:03:04:0c:02:68:69'))
23
24# Target certificate.
25target = gencerts.create_end_entity_certificate('Target', intermediate)
26
27chain = [target, intermediate, root]
28gencerts.write_chain(__doc__, chain, 'chain.pem')
29