Class: Spiped
- Inherits:
-
Object
- Object
- Spiped
- Defined in:
- lib/spiped.rb
Constant Summary collapse
- VERSION =
"1.4.1"- BASE =
File. File.join(File.dirname(__FILE__), "..", "ext", "spiped" )
- SPIPE =
File.join(BASE, "spipe", "spipe" )
- SPIPED =
File.join(BASE, "spiped", "spiped" )
Class Method Summary collapse
Class Method Details
.spawn_encryptor(source, target, key, verbose = false) ⇒ Object
-
Delete the ‘source’ socket file if it exists.
-
Write the provided base64-encoded key to disk.
-
Spawn spiped to send plaintext received on
sourceencrypted to spiped running attarget
17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/spiped.rb', line 17 def self.spawn_encryptor( source, target, key, verbose = false ) File.delete(source) if File.exist?(source) keyfile = Tempfile.new("spiped") keyfile.write Base64.decode64(key) keyfile.close cmd = [SPIPED, '-e', '-s', source, '-t', target, '-k', keyfile.path, '-D'] if verbose $stdout.puts "Running #{cmd.join(' ')}" end system *cmd end |