Class: Izokatu::KeysGenerator Abstract
- Inherits:
-
Object
- Object
- Izokatu::KeysGenerator
- Extended by:
- Callable
- Includes:
- Contracts
- Defined in:
- lib/izokatu/keys_generator.rb
Overview
This class is abstract.
Subclasses are containing implementation of #generate_private_key and #generate_public_key
Abstract class for keys generators
Direct Known Subclasses
Openssl::PublicKey::EC::KeysGenerator, Openssl::PublicKey::RSA::KeysGenerator, Rbnacl::PublicKey::KeysGenerator
Constant Summary collapse
- KEYS_SYMBOLS =
Default key symbols for RbNaCl and OpenSSL keys
%i[private_key public_key].freeze
- KEY_CLASSES =
Classes of RbNaCl and OpenSSL keys
[ RbNaCl::Boxes::Curve25519XSalsa20Poly1305::PrivateKey, RbNaCl::Boxes::Curve25519XSalsa20Poly1305::PublicKey, OpenSSL::PKey::RSA, OpenSSL::PKey::EC ].freeze
Instance Method Summary collapse
-
#generate_private_key ⇒ Object
private
Performing generation of private key.
-
#generate_public_key(_private_key) ⇒ Object
private
Performing generation of public key.
-
#perform ⇒ Hash
Performing generation of private and public keys.
Methods included from Callable
Instance Method Details
#generate_private_key ⇒ Object (private)
Performing generation of private key
40 41 42 |
# File 'lib/izokatu/keys_generator.rb', line 40 def generate_private_key raise 'Not implemented!' end |
#generate_public_key(_private_key) ⇒ Object (private)
Performing generation of public key
49 50 51 |
# File 'lib/izokatu/keys_generator.rb', line 49 def generate_public_key(_private_key) raise 'Not implemented!' end |
#perform ⇒ Hash
Performing generation of private and public keys
28 29 30 31 |
# File 'lib/izokatu/keys_generator.rb', line 28 def perform generate_private_key .then { |private_key| { private_key: private_key, public_key: generate_public_key(private_key) } } end |