Module: Encrypto::Keys

Defined in:
lib/encrypto/keys.rb

Class Method Summary collapse

Class Method Details

.generate_keypairObject



4
5
6
7
# File 'lib/encrypto/keys.rb', line 4

def self.generate_keypair
  private_key = RbNaCl::PrivateKey.generate
  [private_key.public_key, private_key]
end

.public_key_from_bytes(bytes) ⇒ Object



13
14
15
# File 'lib/encrypto/keys.rb', line 13

def self.public_key_from_bytes(bytes)
  RbNaCl::PublicKey.new(bytes)
end

.to_bytes(key) ⇒ Object



9
10
11
# File 'lib/encrypto/keys.rb', line 9

def self.to_bytes(key)
  key.to_bytes
end