Module: Meshchat::Encryption

Extended by:
ActiveSupport::Autoload
Defined in:
lib/meshchat/encryption.rb,
lib/meshchat/encryption/aes_rsa.rb,
lib/meshchat/encryption/passthrough.rb

Defined Under Namespace

Modules: AES_RSA, Passthrough

Constant Summary collapse

DEFAULT_ENCRYPTOR =
AES_RSA

Class Method Summary collapse

Class Method Details

.current_encryptorObject



20
21
22
# File 'lib/meshchat/encryption.rb', line 20

def current_encryptor
  @current_encryptor || DEFAULT_ENCRYPTOR
end

.decrypt(*args) ⇒ Object



24
25
26
# File 'lib/meshchat/encryption.rb', line 24

def decrypt(*args)
  current_encryptor.decrypt(*args)
end

.encrypt(*args) ⇒ Object



28
29
30
# File 'lib/meshchat/encryption.rb', line 28

def encrypt(*args)
  current_encryptor.encrypt(*args)
end

.encryptor=(klass) ⇒ Object



16
17
18
# File 'lib/meshchat/encryption.rb', line 16

def encryptor=(klass)
  @current_encryptor = klass
end