Sha256: 0eebc100738f7accdf6f30cd36de977c2591e16f4c0a4fe3e2f1afe8b170b785

Contents?: true

Size: 834 Bytes

Versions: 5

Compression:

Stored size: 834 Bytes

Contents

require "digicert/cli/csr"

module Digicert
  module CLI
    module Commands
      class Csr < Thor
        desc "fetch ORDER_ID", "Fetch an existing CSR"

        def fetch(order_id)
          say(csr_instance(order_id: order_id).fetch)
        end

        desc "generate", "Generate certificate CSR"
        option :common_name, aliases: "-c", desc: "The common name"
        option :san, type: :array, desc: "The subject alternative names"
        option :key, aliases: "-k", desc: "Complete path to the rsa key file"
        option :order_id, required: true, aliases: "-o", desc: "An Order ID"

        def generate
          say(csr_instance.generate)
        end

        private

        def csr_instance(id_attribute = {})
          Digicert::CLI::CSR.new(options.merge(id_attribute))
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
digicert-cli-0.4.2 lib/digicert/cli/commands/csr.rb
digicert-cli-0.4.1 lib/digicert/cli/commands/csr.rb
digicert-cli-0.4.0 lib/digicert/cli/commands/csr.rb
digicert-cli-0.3.0 lib/digicert/cli/commands/csr.rb
digicert-cli-0.2.0 lib/digicert/cli/commands/csr.rb