Sha256: 6b7ae1961840c1b0630ac99c66da094e732af764cce7d05b3ce569101c93282d

Contents?: true

Size: 869 Bytes

Versions: 1

Compression:

Stored size: 869 Bytes

Contents

module ECMBlockchain
  class CA
    extend ECMBlockchain::Routes
    extend ECMBlockchain::Request

    class << self
      def create(data)
        member(request( :post, MEMBERS_URL, data ))
      end

      def retrieve(identity)
        member(request( :get, "/#{identity}#{MEMBERS_URL}" ))
      end

      def update(identity, data)
        member(request( :patch, "/#{identity}#{MEMBERS_URL}", data ))
      end

      def revoke(identity)
        response = request( :delete, "/#{identity}#{MEMBERS_URL}")
        OpenStruct.new(success: true, details: "Certificate successfully revoked")
      end

      def crypto_material(identity)
        response = request( :get, "/#{identity}#{MEMBERS_URL}/crypto")
        OpenStruct.new(response)
      end

      private

      def member(params)
        ECMBlockchain::Member.new(params)
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ecm-blockchain-api-1.1.2 lib/ecm-blockchain-api/ca.rb