Sha256: caf503c9a326e8aa848fb32aa3627d3adf0128f4845b305be69a488c1fd9815b

Contents?: true

Size: 733 Bytes

Versions: 4

Compression:

Stored size: 733 Bytes

Contents

require 'conjur/authn'
require 'conjur/command'

class Conjur::Command::KeyPairs < Conjur::Command
  self.prefix = :"key-pair"
  
  desc "Encrypt with a key pair"
  arg_name "key-pair (value | STDIN)"
  command :"encrypt" do |c|
    c.action do |global_options, options, args|
      id = require_arg(args, 'key-pair')
      value = args.shift || STDIN.read
      
      $stdout.write api.key_pair(id).encrypt value
    end
  end

  desc "Decrypt with a key pair"
  arg_name "key-pair (value | STDIN)"
  command :"decrypt" do |c|
    c.action do |global_options, options, args|
      id = require_arg(args, 'key-pair')
      value = args.shift || STDIN.read
      
      $stdout.write api.key_pair(id).decrypt value
    end
  end
end

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
conjur-asset-key-pair-api-0.3.2 lib/conjur/command/key_pairs.rb
conjur-asset-key-pair-api-0.2.2 lib/conjur/command/key_pairs.rb
conjur-asset-key-pair-api-0.2.1 lib/conjur/command/key_pairs.rb
conjur-asset-key-pair-0.2.1 lib/conjur/command/key_pairs.rb