Class: OpenSSL::Engine
Relationships & Source Files | |
Namespace Children | |
Exceptions:
| |
Inherits: | Object |
Defined in: | ext/openssl/ossl_engine.c, ext/openssl/ossl_engine.c |
Overview
This class is the access to openssl's ENGINE cryptographic module implementation.
See also, www.openssl.org/docs/crypto/engine.html
Class Method Summary
-
.by_id(name) ⇒ Engine
Fetch the engine as specified by the #id String.
-
.cleanup
It is only necessary to run cleanup when engines are loaded via .load.
-
.engines
Returns an array of currently loaded engines.
- .load(*args)
Instance Method Summary
- #cipher(name) ⇒ OpenSSL::Cipher
-
#cmds
Returns an array of command definitions for the current engine.
-
#ctrl_cmd(command, value = nil) ⇒ Engine
Send the given
command
to this engine. - #digest(name) ⇒ OpenSSL::Digest
-
#finish
Releases all internal structural references for this engine.
-
#id
Get the id for this engine.
-
#inspect
Pretty print this engine.
-
#load_private_key(id = nil, data = nil) ⇒ OpenSSL::PKey
Loads the given private key by #id and
data
. -
#load_public_key(id = nil, data = nil) ⇒ OpenSSL::PKey
Loads the given private key by #id and
data
. -
#name
Get the descriptive name for this engine.
-
#set_default(flag)
Set the defaults for this engine with the given
flag
.
Class Method Details
.by_id(name) ⇒ Engine
.cleanup
It is only necessary to run cleanup when engines are loaded via .load. However, running cleanup before exit is recommended.
See also, www.openssl.org/docs/crypto/engine.html
.engines
Returns an array of currently loaded engines.
.load(*args)
Instance Method Details
#cipher(name) ⇒ OpenSSL::Cipher
#cmds
Returns an array of command definitions for the current engine
#ctrl_cmd(command, value = nil) ⇒ Engine
Send the given command
to this engine.
Raises an Engine::EngineError if the command
fails.
#digest(name) ⇒ OpenSSL::Digest
This returns an Digest by #name.
Will raise an Engine::EngineError if the digest is unavailable.
e = OpenSSL::Engine.by_id("openssl")
#=> #<OpenSSL::Engine id="openssl" name="Software engine support">
e.digest("SHA1")
#=> #<OpenSSL::Digest: da39a3ee5e6b4b0d3255bfef95601890afd80709>
e.digest("zomg")
#=> OpenSSL::Engine::EngineError: no such digest `zomg'
#finish
Releases all internal structural references for this engine.
May raise an Engine::EngineError if the engine is unavailable
#id
#inspect
Pretty print this engine
#load_private_key(id = nil, data = nil) ⇒ OpenSSL::PKey
#load_public_key(id = nil, data = nil) ⇒ OpenSSL::PKey
#name
#set_default(flag)
Set the defaults for this engine with the given flag
.
These flags are used to control combinations of algorithm methods.
flag
can be one of the following, other flags are available depending on your OS.
- All flags
-
0xFFFF
- No flags
-
0x0000
See also <openssl/engine.h>