From 77d6d5c7715c6b8f9f003f7f55dfe08c6b427cbc Mon Sep 17 00:00:00 2001 From: Postmodern Date: Wed, 2 Aug 2023 15:36:24 -0700 Subject: [PATCH] Added support for `ronin cert-gen --key-type dsa`. --- lib/ronin/cli/commands/cert_gen.rb | 7 +++++-- man/ronin-cert-gen.1.md | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/ronin/cli/commands/cert_gen.rb b/lib/ronin/cli/commands/cert_gen.rb index 3cfb60467..5d3b06fd9 100644 --- a/lib/ronin/cli/commands/cert_gen.rb +++ b/lib/ronin/cli/commands/cert_gen.rb @@ -20,6 +20,7 @@ require 'ronin/support/crypto/cert' require 'ronin/support/crypto/key/rsa' require 'ronin/support/crypto/key/ec' +require 'ronin/support/crypto/key/dsa' require 'ronin/support/text/patterns' require 'ronin/core/cli/logging' @@ -47,7 +48,7 @@ module Commands # -L, --locality NAME The locality for the certificate # -S, --state XX The two-letter State (ST) code for the certificate # -C, --country XX The two-letter Country (C) code for the certificate - # -t, --key-type rsa|ec The signing key type + # -t, --key-type rsa|dsa|ec The signing key type # --generate-key PATH Generates and saves a random key (Default: key.pem) # -k, --key-file FILE Loads the signing key from the FILE # -H sha256|sha1|md5, The hash algorithm to use for signing (Default: sha256) @@ -149,7 +150,7 @@ class CertGen < Command option :key_type, short: '-t', value: { - type: [:rsa, :ec] + type: [:rsa, :dsa, :ec] }, desc: 'The signing key type' @@ -287,12 +288,14 @@ def not_after # The `--key-type` key class. # # @return [Class, + # Class, # Class, nil] # def key_class case options[:key_type] when :rsa then Support::Crypto::Key::RSA when :ec then Support::Crypto::Key::EC + when :dsa then Support::Crypto::Key::DSA end end diff --git a/man/ronin-cert-gen.1.md b/man/ronin-cert-gen.1.md index c7277d586..e5d7a4113 100644 --- a/man/ronin-cert-gen.1.md +++ b/man/ronin-cert-gen.1.md @@ -43,7 +43,7 @@ Generates a new X509 certificate. `-C`, `--country` *XX* The two-letter Country (C) code for the certificate. -`-t`, `--key-type `rsa`\|`ec` +`-t`, `--key-type `rsa`\|`dsa`\|`ec` The signing key type. `--generate-key` *PATH*