Module: Tripwire::Server::CryptoSupport
- Defined in:
- lib/tripwire/server/crypto_support.rb
Constant Summary collapse
- MIN_SUPPORTED_RUBY_VERSION =
Gem::Version.new("3.3.0")
- UNSUPPORTED_RUNTIME_MESSAGE =
"Tripwire Ruby cryptography helpers require Ruby 3.3+ with modern OpenSSL support.".freeze
Class Method Summary collapse
- .ensure_supported_runtime! ⇒ Object
- .minimum_supported_ruby_version ⇒ Object
- .supported_runtime? ⇒ Boolean
- .unsupported_runtime_message ⇒ Object
Class Method Details
.ensure_supported_runtime! ⇒ Object
22 23 24 25 26 |
# File 'lib/tripwire/server/crypto_support.rb', line 22 def ensure_supported_runtime! return if supported_runtime? raise ConfigurationError, UNSUPPORTED_RUNTIME_MESSAGE end |
.minimum_supported_ruby_version ⇒ Object
28 29 30 |
# File 'lib/tripwire/server/crypto_support.rb', line 28 def minimum_supported_ruby_version MIN_SUPPORTED_RUBY_VERSION end |
.supported_runtime? ⇒ Boolean
12 13 14 15 16 17 18 19 20 |
# File 'lib/tripwire/server/crypto_support.rb', line 12 def supported_runtime? return @supported_runtime unless @supported_runtime.nil? @supported_runtime = Gem::Version.new(RUBY_VERSION) >= MIN_SUPPORTED_RUBY_VERSION && OpenSSL::PKey.respond_to?(:generate_key) && defined?(OpenSSL::KDF) && OpenSSL::KDF.respond_to?(:hkdf) && aead_auth_data_supported? end |
.unsupported_runtime_message ⇒ Object
32 33 34 |
# File 'lib/tripwire/server/crypto_support.rb', line 32 def UNSUPPORTED_RUNTIME_MESSAGE end |