Class: Pantry::Communication::Security::CurveSecurity::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/pantry/communication/security/curve_security.rb

Overview

Client-side handling of Curve encryption.

Instance Method Summary collapse

Constructor Details

#initializeClient

Returns a new instance of Client.



25
26
27
28
# File 'lib/pantry/communication/security/curve_security.rb', line 25

def initialize
  @key_store = CurveKeyStore.new("client_keys")
  Pantry.logger.info("Configuring Client to use Curve encryption")
end

Instance Method Details

#configure_socket(socket) ⇒ Object



30
31
32
33
34
# File 'lib/pantry/communication/security/curve_security.rb', line 30

def configure_socket(socket)
  socket.set(::ZMQ::CURVE_SERVERKEY, @key_store.server_public_key)
  socket.set(::ZMQ::CURVE_PUBLICKEY, @key_store.public_key)
  socket.set(::ZMQ::CURVE_SECRETKEY, @key_store.private_key)
end