diff options
author | Libor Peltan <libor.peltan@nic.cz> | 2017-03-02 15:56:34 +0100 |
---|---|---|
committer | Libor Peltan <libor.peltan@nic.cz> | 2017-05-04 16:14:15 +0200 |
commit | d7f5895220f928d46bc238f774dbbb334fea961f (patch) | |
tree | 01e274a8d32e350712d99340b0e586ee29cd5b8f | |
parent | tests-extra: switched from pykemgr completely to kkeymgr (diff) | |
download | knot-d7f5895220f928d46bc238f774dbbb334fea961f.tar.xz knot-d7f5895220f928d46bc238f774dbbb334fea961f.zip |
pykeymgr: removed all functionality except importing old JSON key config
-rw-r--r-- | doc/man/pykeymgr.8in | 73 | ||||
-rw-r--r-- | doc/man_pykeymgr.rst | 49 | ||||
-rwxr-xr-x | scripts/pykeymgr.py | 48 |
3 files changed, 24 insertions, 146 deletions
diff --git a/doc/man/pykeymgr.8in b/doc/man/pykeymgr.8in index c16f46104..9b729165f 100644 --- a/doc/man/pykeymgr.8in +++ b/doc/man/pykeymgr.8in @@ -54,23 +54,9 @@ Print the program help. .SS Main commands .INDENT 0.0 .TP -\fB\-z\fP, \fB\-\-zones\fP \fIKASP_db_dir\fP -List zones configured in KASP db together with key IDs of the DNSSEC keys -belonging to each of the zones. -.TP -\fB\-l\fP, \fB\-\-list\fP \fIKASP_db_dir\fP \fIfilter\fP -List DNSSEC keys stored in the KASP db together with their parameters -(key ID, key tag, is KSK ?, timers). -.TP \fB\-i\fP, \fB\-\-import\fP \fIKASP_db_dir\fP Import the legacy JSON\-format KASP database into the current LMDB\-backed one. (You can import multiple databases at once by repeating this option.) -.TP -\fB\-d\fP, \fB\-\-ds\fP \fIKASP_db_dir\fP \fIzone_name\fP \fIkey_spec\fP -Calculate and print DS record for given key (used all SHA1, SHA256 and SHA384 digests). -.TP -\fB\-s\fP, \fB\-\-set\fP \fIKASP_db_dir\fP \fIzone_name\fP \fIkey_spec\fP \fIparam_name\fP \fInew_value\fP -Set a key parameter to new value (mostly useful for timers). .UNINDENT .SS Parameters .INDENT 0.0 @@ -79,28 +65,6 @@ Set a key parameter to new value (mostly useful for timers). A path to the KASP db. It is the directory where \fIdata.mdb\fP and \fIlock.mdb\fP files are usually stored as well as legacy JSON configuration and \fIkeys\fP subdirectory containing PEM files. -.TP -\fIzone_name\fP -A name of the zone including trailing dot. -.TP -\fIkey_spec\fP -Either the key tag, key ID, or a prefix of key ID. -.TP -\fIfilter\fP -Following key attributes delimited by \(aq&\(aq character: all, ksk, zsk, published, -active, retired. E.g. "all" means apply no filter; "zsk&active" filters the output -to display just ZSKs which are active. -.TP -\fIparam_name\fP -A name for key parameter in question. Possible parameters are: \fIkeytag\fP, -\fIalgorithm\fP (those two demand \fI\-\-force\fP option), \fIisksk\fP, \fIcreated\fP, -\fIpublish\fP, \fIactive\fP, \fIretire\fP, \fIremove\fP\&. -.TP -\fInew_value\fP -New value for specified parameter: for \fIkeytag\fP and \fIalgorithm\fP \- a number; -for \fIisksk\fP \- either "True" or "False"; for timers \- either a number (= UNIX time) -or "now[+\-]<number><unit>" where \fIunit\fP is from ("y", "mo", "d", "h", "mi", <nothing=seconds>), -e.g. "now\-10", "now+2mo". .UNINDENT .SH EXAMPLES .INDENT 0.0 @@ -116,43 +80,6 @@ $ pykemgr.py \-i ${knot_data_dir}/keys .fi .UNINDENT .UNINDENT -.IP 2. 3 -Set retire time for a specified key to 10 hours ahead: -.INDENT 3.0 -.INDENT 3.5 -.sp -.nf -.ft C -$ pykeymgr.py \-s ${knot_data_dir}/keys example.zone. 5a701f91 retire now+10h -.ft P -.fi -.UNINDENT -.UNINDENT -.IP 3. 3 -Display all published KSKs (for all zones): -.INDENT 3.0 -.INDENT 3.5 -.sp -.nf -.ft C -$ pykeymgr.py \-l ${knot_data_dir}/keys \(aqpublished&ksk\(aq -.ft P -.fi -.UNINDENT -.UNINDENT -.IP 4. 3 -Prepare DS records from key specified by tag (for all sha1, sha256, and sha384 -digest algorithms): -.INDENT 3.0 -.INDENT 3.5 -.sp -.nf -.ft C -$ pykeymgr.py \-d ${knot_data_dir}/keys 58041 -.ft P -.fi -.UNINDENT -.UNINDENT .UNINDENT .SH SEE ALSO .sp diff --git a/doc/man_pykeymgr.rst b/doc/man_pykeymgr.rst index 35eb92edb..3dc0ed92d 100644 --- a/doc/man_pykeymgr.rst +++ b/doc/man_pykeymgr.rst @@ -31,24 +31,10 @@ Global options Main commands ............. -**-z**, **--zones** *KASP_db_dir* - List zones configured in KASP db together with key IDs of the DNSSEC keys - belonging to each of the zones. - -**-l**, **--list** *KASP_db_dir* *filter* - List DNSSEC keys stored in the KASP db together with their parameters - (key ID, key tag, is KSK ?, timers). - **-i**, **--import** *KASP_db_dir* Import the legacy JSON-format KASP database into the current LMDB-backed one. (You can import multiple databases at once by repeating this option.) -**-d**, **--ds** *KASP_db_dir* *zone_name* *key_spec* - Calculate and print DS record for given key (used all SHA1, SHA256 and SHA384 digests). - -**-s**, **--set** *KASP_db_dir* *zone_name* *key_spec* *param_name* *new_value* - Set a key parameter to new value (mostly useful for timers). - Parameters .......... @@ -57,28 +43,6 @@ Parameters files are usually stored as well as legacy JSON configuration and `keys` subdirectory containing PEM files. -*zone_name* - A name of the zone including trailing dot. - -*key_spec* - Either the key tag, key ID, or a prefix of key ID. - -*filter* - Following key attributes delimited by '&' character: all, ksk, zsk, published, - active, retired. E.g. "all" means apply no filter; "zsk&active" filters the output - to display just ZSKs which are active. - -*param_name* - A name for key parameter in question. Possible parameters are: `keytag`, - `algorithm` (those two demand `--force` option), `isksk`, `created`, - `publish`, `active`, `retire`, `remove`. - -*new_value* - New value for specified parameter: for `keytag` and `algorithm` - a number; - for `isksk` - either "True" or "False"; for timers - either a number (= UNIX time) - or "now[+-]<number><unit>" where `unit` is from ("y", "mo", "d", "h", "mi", <nothing=seconds>), - e.g. "now-10", "now+2mo". - Examples -------- @@ -86,19 +50,6 @@ Examples $ pykemgr.py -i ${knot_data_dir}/keys -2. Set retire time for a specified key to 10 hours ahead:: - - $ pykeymgr.py -s ${knot_data_dir}/keys example.zone. 5a701f91 retire now+10h - -3. Display all published KSKs (for all zones):: - - $ pykeymgr.py -l ${knot_data_dir}/keys 'published&ksk' - -4. Prepare DS records from key specified by tag (for all sha1, sha256, and sha384 - digest algorithms):: - - $ pykeymgr.py -d ${knot_data_dir}/keys 58041 - See Also -------- diff --git a/scripts/pykeymgr.py b/scripts/pykeymgr.py index 4bf28fdbb..1695aeb91 100755 --- a/scripts/pykeymgr.py +++ b/scripts/pykeymgr.py @@ -439,18 +439,18 @@ def main(): help='''Import zone-key configuration from JSON. Syntax: -i <key_dir> (You can import multiple key_dirs at once by repeating this option.)''') - parser.add_argument("-s", "--set", action="append", nargs=5, dest="setparam", - help='''Zone-key set params. -Syntax: -s <key_dir> <zone_name> <key_id|key_tag> <parameter> <new_value>''') - parser.add_argument("-l", "--list", action="append", nargs=2, dest="listdir", - help='''List zone-key configuration (no key-zone relation). -Syntax: -l <key_dir> <filter>''') - parser.add_argument("-z", "--zones", action="append", nargs=1, dest="zonesdir", - help='''List zones together with key IDs belonging to them. -Syntax: -z <key_dir>''') - parser.add_argument("-d", "--ds", action="append", nargs=3, dest="ds", - help='''Calculate DS record for specified key. -Syntax: -d <key_dir> <zone_name> <key_id|key_tag>''') +# parser.add_argument("-s", "--set", action="append", nargs=5, dest="setparam", +# help='''Zone-key set params. +#Syntax: -s <key_dir> <zone_name> <key_id|key_tag> <parameter> <new_value>''') +# parser.add_argument("-l", "--list", action="append", nargs=2, dest="listdir", +# help='''List zone-key configuration (no key-zone relation). +#Syntax: -l <key_dir> <filter>''') +# parser.add_argument("-z", "--zones", action="append", nargs=1, dest="zonesdir", +# help='''List zones together with key IDs belonging to them. +#Syntax: -z <key_dir>''') +# parser.add_argument("-d", "--ds", action="append", nargs=3, dest="ds", +# help='''Calculate DS record for specified key. +#Syntax: -d <key_dir> <zone_name> <key_id|key_tag>''') parser.add_argument("-f", "--force", action="store_true", dest="force", help="Do stuff even if dangerous.") args = parser.parse_args() opt_force = args.force @@ -464,21 +464,21 @@ Syntax: -d <key_dir> <zone_name> <key_id|key_tag>''') for dirn in importdir: import_dir(dirn) - if args.listdir is not None: - for dirn, filte in args.listdir: - list_keys(dirn, filte) +# if args.listdir is not None: +# for dirn, filte in args.listdir: +# list_keys(dirn, filte) - if args.zonesdir is not None: - for dirn in args.zonesdir: - list_zones(dirn[0]) +# if args.zonesdir is not None: +# for dirn in args.zonesdir: +# list_zones(dirn[0]) - if args.setparam is not None: - for dirn, zone, key, parmn, val in args.setparam: - update_param(dirn, zone, key, parmn, val) +# if args.setparam is not None: +# for dirn, zone, key, parmn, val in args.setparam: +# update_param(dirn, zone, key, parmn, val) - if args.ds is not None: - for dirn, zone, key in args.ds: - calculate_ds(dirn, zone, key) +# if args.ds is not None: +# for dirn, zone, key in args.ds: +# calculate_ds(dirn, zone, key) if __name__ == "__main__": main() |