Class: Izokatu::Rbnacl::PublicKey::KeysGenerator

Inherits:
KeysGenerator show all
Defined in:
lib/izokatu/rbnacl/public_key/keys_generator.rb

Overview

RbNaCl keys generator

Constant Summary

Constants inherited from KeysGenerator

KeysGenerator::KEYS_SYMBOLS, KeysGenerator::KEY_CLASSES

Instance Method Summary collapse

Methods inherited from KeysGenerator

#perform

Methods included from Callable

#call

Instance Method Details

#generate_private_keyRbNaCl::Boxes::Curve25519XSalsa20Poly1305::PrivateKey (private)

Performing generation of RbNaCl private key

Returns:

  • (RbNaCl::Boxes::Curve25519XSalsa20Poly1305::PrivateKey)

    RbNaCl private key

Since:

  • 0.1.0


16
17
18
# File 'lib/izokatu/rbnacl/public_key/keys_generator.rb', line 16

def generate_private_key
  RbNaCl::PrivateKey.generate
end

#generate_public_key(private_key) ⇒ RbNaCl::Boxes::Curve25519XSalsa20Poly1305::PublicKey (private)

Performing generation of RbNaCl public key

Returns:

  • (RbNaCl::Boxes::Curve25519XSalsa20Poly1305::PublicKey)

    RbNaCl public key

Since:

  • 0.1.0


27
28
29
# File 'lib/izokatu/rbnacl/public_key/keys_generator.rb', line 27

def generate_public_key(private_key)
  private_key.public_key
end