class HexaPDF::Encryption::StandardEncryptionDictionary
The specialized encryption dictionary for the StandardSecurityHandler
.
Contains additional fields that are used for storing the information needed for retrieving the encryption key and a set of permissions.
Private Instance Methods
perform_validation() { |"Invalid size for /U or /O values for revisions <= 4", false| ... }
click to toggle source
Validates the fields special for this encryption dictionary.
Calls superclass method
HexaPDF::Encryption::EncryptionDictionary#perform_validation
# File lib/hexapdf/encryption/standard_security_handler.rb, line 61 def perform_validation super case value[:R] when 2, 3, 4 if value[:U].length != 32 || value[:O].length != 32 yield("Invalid size for /U or /O values for revisions <= 4", false) end when 6 if !key?(:OE) || !key?(:UE) || !key?(:Perms) yield("Value of /OE, /UE or /Perms is missing for dictionary revision 6", false) return end if value[:U].length != 48 || value[:O].length != 48 || value[:UE].length != 32 || value[:OE].length != 32 || value[:Perms].length != 16 yield("Invalid size for /U, /O, /UE, /OE or /Perms values for revisions 6", false) end else yield("Value of /R is not one of 2, 3, 4 or 6", false) end end