Class: Omnizip::Formats::Rar::Rar5::Models::EncryptionOptions
- Inherits:
-
Lutaml::Model::Serializable
- Object
- Lutaml::Model::Serializable
- Omnizip::Formats::Rar::Rar5::Models::EncryptionOptions
- Defined in:
- lib/omnizip/formats/rar/rar5/models/encryption_options.rb
Overview
Encryption options for RAR5 archives
This model configures password-based encryption using AES-256-CBC with PBKDF2-HMAC-SHA256 key derivation.
Instance Method Summary collapse
-
#enabled? ⇒ Boolean
Check if encryption is enabled.
-
#has_password? ⇒ Boolean
Check if password is set.
-
#validate! ⇒ Object
Validate options.
Instance Method Details
#enabled? ⇒ Boolean
Check if encryption is enabled
59 60 61 |
# File 'lib/omnizip/formats/rar/rar5/models/encryption_options.rb', line 59 def enabled? enabled == true end |
#has_password? ⇒ Boolean
Check if password is set
66 67 68 |
# File 'lib/omnizip/formats/rar/rar5/models/encryption_options.rb', line 66 def has_password? !password.nil? && !password.empty? end |
#validate! ⇒ Object
Validate options
44 45 46 47 48 49 50 51 52 53 54 |
# File 'lib/omnizip/formats/rar/rar5/models/encryption_options.rb', line 44 def validate! if enabled? && (password.nil? || password.empty?) raise ArgumentError, "Password required when encryption is enabled" end if kdf_iterations < 65_536 || kdf_iterations > 1_048_576 raise ArgumentError, "KDF iterations must be between 65,536 and 1,048,576" end end |