Class: Pantry::Communication::Security::CurveSecurity::Server
- Inherits:
-
Object
- Object
- Pantry::Communication::Security::CurveSecurity::Server
- Defined in:
- lib/pantry/communication/security/curve_security.rb
Instance Attribute Summary collapse
-
#authentication ⇒ Object
readonly
Returns the value of attribute authentication.
Instance Method Summary collapse
- #configure_socket(socket) ⇒ Object
- #create_client ⇒ Object
-
#initialize ⇒ Server
constructor
A new instance of Server.
- #link_to(parent) ⇒ Object
Constructor Details
#initialize ⇒ Server
Returns a new instance of Server.
42 43 44 45 46 47 48 49 |
# 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 |
Instance Attribute Details
#authentication ⇒ Object (readonly)
Returns the value of attribute authentication.
40 41 42 |
# File 'lib/pantry/communication/security/curve_security.rb', line 40 def authentication @authentication end |
Instance Method Details
#configure_socket(socket) ⇒ Object
55 56 57 58 |
# 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 ⇒ Object
60 61 62 |
# File 'lib/pantry/communication/security/curve_security.rb', line 60 def create_client @key_store.create_client end |
#link_to(parent) ⇒ Object
51 52 53 |
# File 'lib/pantry/communication/security/curve_security.rb', line 51 def link_to(parent) parent.link(@authentication) end |