Class: GameOverseer::EncryptionHandler
- Inherits:
-
Object
- Object
- GameOverseer::EncryptionHandler
- Defined in:
- lib/gameoverseer/encryption_handler/encryption_handler.rb
Class Method Summary collapse
Instance Method Summary collapse
- #decrypt(client_id, string) ⇒ Object
- #decrypt_keypair(string) ⇒ Object
- #encrypt(client_id, string) ⇒ Object
- #encrypt_keypair(client_id, string) ⇒ Object
- #generate_server_keypair(keypair_size) ⇒ Object
-
#initialize(key_size: 128, keypair_size: 2048) ⇒ EncryptionHandler
constructor
A new instance of EncryptionHandler.
- #set_client_key(client_id) ⇒ Object
- #set_client_keypair(client_id, public_key_pem) ⇒ Object
Constructor Details
#initialize(key_size: 128, keypair_size: 2048) ⇒ EncryptionHandler
Returns a new instance of EncryptionHandler.
4 5 6 7 |
# File 'lib/gameoverseer/encryption_handler/encryption_handler.rb', line 4 def initialize(key_size: 128, keypair_size: 2048) EncryptionHandler.instance = self generate_server_keypair(keypair_size) end |
Class Method Details
.instance ⇒ Object
32 33 34 |
# File 'lib/gameoverseer/encryption_handler/encryption_handler.rb', line 32 def self.instance @instance end |
.instance=(_instance) ⇒ Object
36 37 38 |
# File 'lib/gameoverseer/encryption_handler/encryption_handler.rb', line 36 def self.instance=(_instance) @instance = _instance end |
Instance Method Details
#decrypt(client_id, string) ⇒ Object
22 23 |
# File 'lib/gameoverseer/encryption_handler/encryption_handler.rb', line 22 def decrypt(client_id, string) end |
#decrypt_keypair(string) ⇒ Object
16 17 |
# File 'lib/gameoverseer/encryption_handler/encryption_handler.rb', line 16 def decrypt_keypair(string) end |
#encrypt(client_id, string) ⇒ Object
19 20 |
# File 'lib/gameoverseer/encryption_handler/encryption_handler.rb', line 19 def encrypt(client_id, string) end |
#encrypt_keypair(client_id, string) ⇒ Object
13 14 |
# File 'lib/gameoverseer/encryption_handler/encryption_handler.rb', line 13 def encrypt_keypair(client_id, string) end |
#generate_server_keypair(keypair_size) ⇒ Object
9 10 11 |
# File 'lib/gameoverseer/encryption_handler/encryption_handler.rb', line 9 def generate_server_keypair(keypair_size) @server_keypair = OpenSSL::PKey::RSA.generate(keypair_size) end |
#set_client_key(client_id) ⇒ Object
28 29 30 |
# File 'lib/gameoverseer/encryption_handler/encryption_handler.rb', line 28 def set_client_key(client_id) ClientManager.instance.update(client_id, '_aes_key', 'In progress, not ready.') end |
#set_client_keypair(client_id, public_key_pem) ⇒ Object
25 26 |
# File 'lib/gameoverseer/encryption_handler/encryption_handler.rb', line 25 def set_client_keypair(client_id, public_key_pem) end |