Sha256: b75fdf02da7c29fea958ba80ecf3a076aa009ac11305119fbb18799dd7b62c12

Contents?: true

Size: 768 Bytes

Versions: 21

Compression:

Stored size: 768 Bytes

Contents

require 'openssl'

module Eligible
  class PublicKey < APIResource
    def self.get(params, api_key = nil)
      send_request(:get, api_url('public_keys', params, :key_id), api_key, params, :key_id)
    end

    def self.post(params, api_key = nil)
      send_request(:post, api_url('public_keys'), api_key, params)
    end

    def self.activate(params, api_key = nil)
      key_id = Util.value(params, :key_id)
      send_request(:get, "/public_keys/#{key_id}/activate.json", api_key, params, :key_id)
    end

    def self.all(params, api_key = nil)
      send_request(:get, api_url('public_keys'), api_key, params)
    end

    def self.create_pair
      rsa_key = OpenSSL::PKey::RSA.new(4096)
      [ rsa_key.to_pem, rsa_key.public_key.to_pem ]
    end
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
eligible-2.9.15 lib/eligible/public_key.rb
eligible-2.9.14 lib/eligible/public_key.rb
eligible-2.9.13 lib/eligible/public_key.rb
eligible-2.9.12 lib/eligible/public_key.rb
eligible-2.9.11 lib/eligible/public_key.rb
eligible-2.9.10 lib/eligible/public_key.rb
eligible-2.9.9 lib/eligible/public_key.rb
eligible-2.9.8 lib/eligible/public_key.rb
eligible-2.9.7 lib/eligible/public_key.rb
eligible-2.9.6 lib/eligible/public_key.rb
eligible-2.9.5 lib/eligible/public_key.rb
eligible-2.9.4 lib/eligible/public_key.rb
eligible-2.9.3 lib/eligible/public_key.rb
eligible-2.9.2 lib/eligible/public_key.rb
eligible-2.9.1 lib/eligible/public_key.rb
eligible-2.8.2 lib/eligible/public_key.rb
eligible-2.8.1 lib/eligible/public_key.rb
eligible-2.8.0 lib/eligible/public_key.rb
eligible-2.7.0 lib/eligible/public_key.rb
eligible-2.6.3 lib/eligible/public_key.rb