| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright 2015 The Chromium Authors. All rights reserved. | 2 # Copyright 2015 The Chromium Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 | 5 |
| 6 import base64 | 6 import base64 |
| 7 import copy | 7 import copy |
| 8 import os | 8 import os |
| 9 import random | 9 import random |
| 10 import subprocess | 10 import subprocess |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 s = 'x400Address = IMPLICIT:3,SEQUENCE:x400AddressSequence%i\n' % i | 130 s = 'x400Address = IMPLICIT:3,SEQUENCE:x400AddressSequence%i\n' % i |
| 131 s += '[x400AddressSequence%i]\n' % i | 131 s += '[x400AddressSequence%i]\n' % i |
| 132 s += 'builtinstandardattributes = SEQUENCE:BuiltInStandardAttributes%i\n' % i | 132 s += 'builtinstandardattributes = SEQUENCE:BuiltInStandardAttributes%i\n' % i |
| 133 s += '[BuiltInStandardAttributes%i]\n' % i | 133 s += '[BuiltInStandardAttributes%i]\n' % i |
| 134 s += 'countryname = EXPLICIT:1A,PRINTABLESTRING:US\n' | 134 s += 'countryname = EXPLICIT:1A,PRINTABLESTRING:US\n' |
| 135 return s | 135 return s |
| 136 | 136 |
| 137 | 137 |
| 138 def directory_name(name): | 138 def directory_name(name): |
| 139 return str(name).replace( | 139 return str(name).replace( |
| 140 'asn1 = SEQUENCE', 'directoryName = IMPLICIT:4,SEQUENCE') | 140 'asn1 = SEQUENCE', 'directoryName = EXPLICIT:4,SEQUENCE') |
| 141 | 141 |
| 142 | 142 |
| 143 def edi_party_name(): | 143 def edi_party_name(): |
| 144 i = random.randint(0, sys.maxint) | 144 i = random.randint(0, sys.maxint) |
| 145 s = 'ediPartyName = IMPLICIT:5,SEQUENCE:ediPartyNameSequence%i\n' % i | 145 s = 'ediPartyName = IMPLICIT:5,SEQUENCE:ediPartyNameSequence%i\n' % i |
| 146 s += '[ediPartyNameSequence%i]\n' % i | 146 s += '[ediPartyNameSequence%i]\n' % i |
| 147 s += 'partyName = IMPLICIT:1,UTF8:foo\n' | 147 s += 'partyName = IMPLICIT:1,UTF8:foo\n' |
| 148 return s | 148 return s |
| 149 | 149 |
| 150 | 150 |
| (...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 524 dns_name("permitted.example.com"), minimum=1, maximum=2)) | 524 dns_name("permitted.example.com"), minimum=1, maximum=2)) |
| 525 generate(c, "dnsname-with_min_1_and_max.pem") | 525 generate(c, "dnsname-with_min_1_and_max.pem") |
| 526 | 526 |
| 527 c = NameConstraintsGenerator() | 527 c = NameConstraintsGenerator() |
| 528 c.add_permitted(with_min_max(dns_name("permitted.example.com"), maximum=2)) | 528 c.add_permitted(with_min_max(dns_name("permitted.example.com"), maximum=2)) |
| 529 generate(c, "dnsname-with_max.pem") | 529 generate(c, "dnsname-with_max.pem") |
| 530 | 530 |
| 531 | 531 |
| 532 if __name__ == '__main__': | 532 if __name__ == '__main__': |
| 533 main() | 533 main() |
| OLD | NEW |