class HexaPDF::Encryption::StandardSecurityHandler
def encryption_key_valid?
Additionally checks that the document trailer's ID has not changed.
def encryption_key_valid? super && (document.trailer[:Encrypt][:R] > 4 || trailer_id_hash == @trailer_id_hash) end