Class: Prototok::Ciphers::Base
- Inherits:
-
Object
- Object
- Prototok::Ciphers::Base
show all
- Defined in:
- lib/prototok/ciphers.rb
Class Attribute Summary collapse
Class Method Summary
collapse
Instance Method Summary
collapse
Class Attribute Details
.cipher_class ⇒ Object
9
10
11
12
|
# File 'lib/prototok/ciphers.rb', line 9
def cipher_class
@cipher_class ||
raise(Errors::CipherError, 'No cipher_class declared')
end
|
Class Method Details
.key ⇒ Object
14
15
16
|
# File 'lib/prototok/ciphers.rb', line 14
def key
RbNaCl::Random.random_bytes(cipher_class.key_bytes)
end
|
Instance Method Details
#cipher_class ⇒ Object
19
20
21
|
# File 'lib/prototok/ciphers.rb', line 19
def cipher_class
self.class.cipher_class
end
|