2016-04-29 01:30:53 -04:00
|
|
|
############################################################################
|
2018-02-23 03:53:12 -05:00
|
|
|
# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
|
2016-04-29 01:30:53 -04:00
|
|
|
#
|
2016-06-27 00:56:38 -04:00
|
|
|
# This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
|
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
|
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
2018-02-23 03:53:12 -05:00
|
|
|
#
|
|
|
|
|
# See the COPYRIGHT file distributed with this work for additional
|
|
|
|
|
# information regarding copyright ownership.
|
2016-04-29 01:30:53 -04:00
|
|
|
############################################################################
|
|
|
|
|
|
2016-04-28 03:12:33 -04:00
|
|
|
import sys
|
|
|
|
|
sys.path.insert(0, '../../../python')
|
|
|
|
|
from isc import *
|
|
|
|
|
|
|
|
|
|
pp = policy.dnssec_policy()
|
|
|
|
|
# print the unmodified default and a generated zone policy
|
2016-05-24 23:37:07 -04:00
|
|
|
print(pp.named_policy['default'])
|
|
|
|
|
print(pp.named_policy['global'])
|
|
|
|
|
print(pp.policy('example.com'))
|
2016-04-28 03:12:33 -04:00
|
|
|
|
|
|
|
|
if len(sys.argv) > 0:
|
|
|
|
|
for policy_file in sys.argv[1:]:
|
|
|
|
|
pp.load(policy_file)
|
|
|
|
|
|
|
|
|
|
# now print the modified default and generated zone policies
|
2016-05-24 23:37:07 -04:00
|
|
|
print(pp.named_policy['default'])
|
|
|
|
|
print(pp.policy('example.com'))
|
|
|
|
|
print(pp.policy('example.org'))
|
|
|
|
|
print(pp.policy('example.net'))
|
2016-04-28 03:12:33 -04:00
|
|
|
|
|
|
|
|
# print algorithm policies
|
2016-05-24 23:37:07 -04:00
|
|
|
print(pp.alg_policy['RSASHA1'])
|
2018-06-06 09:49:14 -04:00
|
|
|
print(pp.alg_policy['RSASHA256'])
|
|
|
|
|
print(pp.alg_policy['ECDSAP256SHA256'])
|
2016-04-28 03:12:33 -04:00
|
|
|
|
|
|
|
|
# print another named policy
|
2016-05-24 23:37:07 -04:00
|
|
|
print(pp.named_policy['extra'])
|
2016-04-28 03:12:33 -04:00
|
|
|
else:
|
|
|
|
|
print("ERROR: Please provide an input file")
|