Module: GPGME::Engine
- Defined in:
- lib/gpgme/engine.rb
Overview
Convenience methods to check different aspects of the gpg system installation.
Class Method Summary collapse
-
.check_version(proto) ⇒ Boolean
Verify that the engine implementing the protocol
proto
is installed in the system. -
.dirinfo(what) ⇒ Object
Return the default configuration.
-
.home_dir=(home_dir) ⇒ Object
Sets the home dir for the configuration options.
-
.info ⇒ Object
Return an array of EngineInfo structures of enabled engines.
-
.set_info(proto, file_name, home_dir) ⇒ Object
Change the default configuration of the crypto engine implementing protocol
proto
.
Class Method Details
.check_version(proto) ⇒ Boolean
Verify that the engine implementing the protocol proto
is installed in the system. Can be one of PROTOCOL_OpenPGP
or PROTOCOL_CMS
.
18 19 20 21 22 |
# File 'lib/gpgme/engine.rb', line 18 def check_version(proto) err = GPGME::gpgme_engine_check_version(proto) exc = GPGME::error_to_exception(err) !exc end |
.dirinfo(what) ⇒ Object
Return the default configuration.
82 83 84 |
# File 'lib/gpgme/engine.rb', line 82 def dirinfo(what) GPGME::gpgme_get_dirinfo(what) end |
.home_dir=(home_dir) ⇒ Object
Sets the home dir for the configuration options. This way one could, for example, load the keys from a customized keychain.
70 71 72 73 |
# File 'lib/gpgme/engine.rb', line 70 def home_dir=(home_dir) current = info.first set_info current.protocol, current.file_name, home_dir end |
.info ⇒ Object
Return an array of GPGME::EngineInfo structures of enabled engines.
35 36 37 38 39 |
# File 'lib/gpgme/engine.rb', line 35 def info rinfo = [] GPGME::gpgme_get_engine_info(rinfo) rinfo end |
.set_info(proto, file_name, home_dir) ⇒ Object
Change the default configuration of the crypto engine implementing protocol proto
.
57 58 59 60 61 |
# File 'lib/gpgme/engine.rb', line 57 def set_info(proto, file_name, home_dir) err = GPGME::gpgme_set_engine_info(proto, file_name, home_dir) exc = GPGME::error_to_exception(err) raise exc if exc end |