Module: CcipherFactory::AsymKeyCipher

Includes:
TR::CondUtils
Defined in:
lib/ccipher_factory/asymkey_cipher/asymkey_cipher.rb,
lib/ccipher_factory/asymkey_cipher/ecc/ecc_decrypt.rb,
lib/ccipher_factory/asymkey_cipher/ecc/ecc_encrypt.rb,
lib/ccipher_factory/asymkey_cipher/ecc/ecc_att_decrypt.rb,
lib/ccipher_factory/asymkey_cipher/ecc/ecc_att_encrypt.rb

Defined Under Namespace

Modules: ECCAttDecrypt, ECCAttEncrypt, ECCDecrypt, ECCEncrypt Classes: ASKCipher, AsymKeyCipherError

Class Method Summary collapse

Class Method Details

.att_decryptor(eng = :ecc) ⇒ Object



44
45
46
47
48
49
50
51
52
53
# File 'lib/ccipher_factory/asymkey_cipher/asymkey_cipher.rb', line 44

def self.att_decryptor(eng = :ecc)
  c = ASKCipher.new
  case eng
  when :ecc
    c.extend(ECCAttDecrypt)
  else
    raise AsymKeyCipherError, "Not supoprted decryptor engine '#{eng}'"
  end
  c
end

.att_encryptor(eng = :ecc) ⇒ Object



33
34
35
36
37
38
39
40
41
42
# File 'lib/ccipher_factory/asymkey_cipher/asymkey_cipher.rb', line 33

def self.att_encryptor(eng = :ecc)
  c = ASKCipher.new
  case eng
  when :ecc
    c.extend(ECCAttEncrypt)
  else
    raise AsymKeyCipherError, "Not supported encryptor engine '#{eng}'"
  end
  c
end

.decryptor(eng = :ecc) ⇒ Object



22
23
24
25
26
27
28
29
30
31
# File 'lib/ccipher_factory/asymkey_cipher/asymkey_cipher.rb', line 22

def self.decryptor(eng = :ecc)
  c = ASKCipher.new
  case eng
  when :ecc
    c.extend(ECCDecrypt)
  else
    raise AsymKeyCipherError, "Not supoprted decryptor engine '#{eng}'"
  end
  c
end

.encryptor(eng = :ecc) ⇒ Object



11
12
13
14
15
16
17
18
19
20
# File 'lib/ccipher_factory/asymkey_cipher/asymkey_cipher.rb', line 11

def self.encryptor(eng = :ecc)
  c = ASKCipher.new
  case eng
  when :ecc
    c.extend(ECCEncrypt)
  else
    raise AsymKeyCipherError, "Not supported encryptor engine '#{eng}'"
  end
  c
end