class Pantry::Communication::Security::CurveSecurity::Server

Attributes

authentication[R]

Public Class Methods

new() click to toggle source
# File lib/pantry/communication/security/curve_security.rb, line 42
def initialize
  @key_store = CurveKeyStore.new("server_keys")
  @authentication = Authentication.new(@key_store)
  @authentication.open

  # We log the server's public key here to make it accessible for initial setup.
  Pantry.logger.info("Configuring Server to use Curve encryption :: #{@key_store.public_key}")
end

Public Instance Methods

configure_socket(socket) click to toggle source
# File lib/pantry/communication/security/curve_security.rb, line 55
def configure_socket(socket)
  socket.set(::ZMQ::CURVE_SERVER,    1)
  socket.set(::ZMQ::CURVE_SECRETKEY, @key_store.private_key)
end
create_client() click to toggle source
# File lib/pantry/communication/security/curve_security.rb, line 60
def create_client
  @key_store.create_client
end