Module: MeshChat::Encryption

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



14
15
16
# File 'lib/meshchat/encryption.rb', line 14

def current_encryptor
  @current_encryptor || DEFAULT_ENCRYPTOR
end

.decrypt(*args) ⇒ Object



18
19
20
# File 'lib/meshchat/encryption.rb', line 18

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

.encrypt(*args) ⇒ Object



22
23
24
# File 'lib/meshchat/encryption.rb', line 22

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

.encryptor=(klass) ⇒ Object



10
11
12
# File 'lib/meshchat/encryption.rb', line 10

def encryptor=(klass)
  @current_encryptor = klass
end