Class: Veil::Hasher::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/veil/hasher/base.rb

Direct Known Subclasses

BCrypt, PBKDF2

Instance Method Summary collapse

Instance Method Details

#encrypt(group, name, version) ⇒ String

Hash the credential group, name and version with the stored secret and salt

Parameters:

  • group (String)

    The service group name, eg: postgresql

  • name (String)

    The credential name, eg: sql_password

  • version (Integer)

    The Credential version, eg: 1

Returns:

  • (String)

    SHA512 hex digest of hashed data

Raises:



20
21
22
# File 'lib/veil/hasher/base.rb', line 20

def encrypt(group, name, version)
  raise Veil::NotImplmented.new("#{caller[0]} has not implemented #encrypt")
end

#to_hashHash<Symbol,String>

Return the instance as a Hash

Returns:

  • (Hash<Symbol,String>)

Raises:



27
28
29
# File 'lib/veil/hasher/base.rb', line 27

def to_hash
  raise Veil::NotImplmented.new("#{caller[0]} has not implemented #to_hash")
end