• 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 root certificate is not self-signed (or
7self-issued for that matter)."""
8
9import sys
10sys.path += ['../..']
11
12import gencerts
13
14shadow_root = gencerts.create_self_signed_root_certificate('ShadowRoot')
15
16# Non-self-signed root certificate.
17root = gencerts.create_intermediate_certificate('Root', shadow_root)
18
19# Intermediate certificate.
20intermediate = gencerts.create_intermediate_certificate('Intermediate', root)
21
22# Target certificate.
23target = gencerts.create_end_entity_certificate('Target', intermediate)
24
25chain = [target, intermediate, root]
26gencerts.write_chain(__doc__, chain, 'chain.pem')
27