• 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"""Certificate chain where the intermediate has a valid signature, however uses
6MD5 in the signature algorithm."""
7
8import sys
9sys.path += ['../..']
10
11import gencerts
12
13# Self-signed root certificate.
14root = gencerts.create_self_signed_root_certificate('Root')
15
16# Intermediate.
17intermediate = gencerts.create_intermediate_certificate('Intermediate', root)
18intermediate.set_signature_hash('sha1')
19
20# Target certificate.
21target = gencerts.create_end_entity_certificate('Target', intermediate)
22
23chain = [target, intermediate, root]
24gencerts.write_chain(__doc__, chain, 'chain.pem')
25