Method: PDF::Reader::SecurityHandlerFactory.standard_v5?
- Defined in:
- lib/pdf/reader/security_handler_factory.rb
.standard_v5?(encrypt) ⇒ Boolean
This handler supports both
-
AES-256 encryption defined in PDF 1.7 Extension Level 3 (‘revision 5’)
-
AES-256 encryption defined in PDF 2.0 (‘revision 6’)
68 69 70 71 72 73 74 75 76 77 |
# File 'lib/pdf/reader/security_handler_factory.rb', line 68 def self.standard_v5?(encrypt) return false if encrypt.nil? filter = encrypt.fetch(:Filter, :Standard) version = encrypt.fetch(:V, 0) revision = encrypt.fetch(:R, 0) algorithm = encrypt.fetch(:CF, {}).fetch(encrypt[:StmF], {}).fetch(:CFM, nil) (filter == :Standard) && (encrypt[:StmF] == encrypt[:StrF]) && ((version == 5) && (revision == 5 || revision == 6) && (algorithm == :AESV3)) end |