Skip to content

End of Life Ruby 3.0 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →

instance method

OpenSSL::Engine#cipher

engine.cipher(name) → OpenSSL::Cipher

Returns a new instance of OpenSSL::Cipher by name, if it is available in this engine.

An EngineError will be raised if the cipher is unavailable.

e = OpenSSL::Engine.by_id("openssl")
 => #<OpenSSL::Engine id="openssl" name="Software engine support">
e.cipher("RC4")
 => #<OpenSSL::Cipher:0x007fc5cacc3048>
See also .load #cmds .engines #ctrl_cmd also in 4.1 · 4.0 · 3.4 · 3.3 · 3.2 · 3.1