class PgExport::Factories::CipherFactory

Constants

ALGORITHM

Public Instance Methods

decryptor() click to toggle source
# File lib/pg_export/lib/pg_export/factories/cipher_factory.rb, line 15
def decryptor
  cipher(:decrypt)
end
encryptor() click to toggle source
# File lib/pg_export/lib/pg_export/factories/cipher_factory.rb, line 11
def encryptor
  cipher(:encrypt)
end

Private Instance Methods

cipher(type) click to toggle source
# File lib/pg_export/lib/pg_export/factories/cipher_factory.rb, line 24
def cipher(type)
  OpenSSL::Cipher.new(ALGORITHM).tap do |cipher|
    cipher.public_send(type)
    cipher.key = config.dump_encryption_key
  end
end