Class: GitBlur::KeyGen::KeyGenerator
- Inherits:
-
Object
- Object
- GitBlur::KeyGen::KeyGenerator
- Defined in:
- lib/git-blur/keygen.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#cipher_keys ⇒ Object
readonly
Returns the value of attribute cipher_keys.
-
#cipher_list ⇒ Object
readonly
Returns the value of attribute cipher_list.
Instance Method Summary collapse
- #generate_keys ⇒ Object
- #hex_keys ⇒ Object
-
#initialize ⇒ KeyGenerator
constructor
A new instance of KeyGenerator.
- #keys ⇒ Object
Constructor Details
#initialize ⇒ KeyGenerator
Returns a new instance of KeyGenerator.
29 30 31 32 33 |
# File 'lib/git-blur/keygen.rb', line 29 def initialize( ) @cipher_list = GitBlur::Conf.ciphers raise 'No ciphers defined' if @cipher_list.nil? @cipher_keys = {} end |
Instance Attribute Details
#cipher_keys ⇒ Object (readonly)
Returns the value of attribute cipher_keys.
27 28 29 |
# File 'lib/git-blur/keygen.rb', line 27 def cipher_keys @cipher_keys end |
#cipher_list ⇒ Object (readonly)
Returns the value of attribute cipher_list.
27 28 29 |
# File 'lib/git-blur/keygen.rb', line 27 def cipher_list @cipher_list end |
Instance Method Details
#generate_keys ⇒ Object
35 36 37 |
# File 'lib/git-blur/keygen.rb', line 35 def generate_keys raise "Please overwrite this method in your generator" end |
#hex_keys ⇒ Object
43 44 45 |
# File 'lib/git-blur/keygen.rb', line 43 def hex_keys Hash[ @cipher_keys.keys.collect{ |k| [ k, Base64.strict_encode64( @cipher_keys[k] ) ] } ] end |
#keys ⇒ Object
39 40 41 |
# File 'lib/git-blur/keygen.rb', line 39 def keys @cipher_keys end |