Module: CarrierWave::SecureFile

Defined in:
lib/carrierwave/securefile.rb,
lib/carrierwave/securefile/aes_file.rb,
lib/carrierwave/securefile/uploader.rb,
lib/carrierwave/securefile/downloader.rb,
lib/carrierwave/securefile/configuration.rb

Defined Under Namespace

Modules: AESFile, Downloader, Uploader Classes: AESFileDecrypt, AESFileEncrypt, AESFileKeygen, Configuration

Class Method Summary collapse

Class Method Details

.configurationObject



8
9
10
# File 'lib/carrierwave/securefile/configuration.rb', line 8

def self.configuration
	@configuration ||= CarrierWave::SecureFile::Configuration.new
end

.configure {|configuration| ... } ⇒ Object

Yields:



4
5
6
# File 'lib/carrierwave/securefile/configuration.rb', line 4

def self.configure
	yield configuration
end

.cryptableObject



23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# File 'lib/carrierwave/securefile/configuration.rb', line 23

def cryptable
	configuration = CarrierWave::SecureFile.configuration
	begin
		case configuration.encryption_type.downcase.to_sym
		when :blowfish
			Crypt::Blowfish
		when :rijndael
			Crypt::Rijndael
		when :gost
			Crypt::Gost
		when :aes
			CarrierWave::SecureFile::AESFile
		else
			Crypt::Blowfish
		end
	rescue
		Crypt::Blowfish
	end
end

.cypherObject



18
19
20
21
# File 'lib/carrierwave/securefile/configuration.rb', line 18

def cypher
	configuration = CarrierWave::SecureFile.configuration
	configuration.cypher[0..55]
end