Class: PGP::Signer

Inherits:
Object
  • Object
show all
Includes:
KeysImporter
Defined in:
lib/pgp/signer.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from KeysImporter

#add_keys, #add_keys_from_file

Instance Attribute Details

#passphraseObject

Returns the value of attribute passphrase.



5
6
7
# File 'lib/pgp/signer.rb', line 5

def passphrase
  @passphrase
end

Instance Method Details

#sign(data) ⇒ Object



7
8
9
10
# File 'lib/pgp/signer.rb', line 7

def sign(data)
  result = GPG::Engine.new.sign(data, self.passphrase)
  result[1]
end

#sign_file(file_path) ⇒ Object



12
13
14
# File 'lib/pgp/signer.rb', line 12

def sign_file(file_path)
  sign File.read(file_path)
end