Method: Ccrypto::Ruby::CipherEngine.is_supported_cipher?
- Defined in:
- lib/ccrypto/ruby/engines/cipher_engine.rb
.is_supported_cipher?(c) ⇒ Boolean
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/ccrypto/ruby/engines/cipher_engine.rb', line 23 def self.is_supported_cipher?(c) case c when String supported_ciphers.include?(c) when Hash spec = to_openssl_spec(c) begin OpenSSL::Cipher.new(spec) true rescue Exception => ex false end else raise Ccrypto::CipherEngineException, "Unsupported input #{c} to check supported cipher" end end |