Method: PDF::Reader::SecurityHandlerFactory.build

Defined in:
lib/pdf/reader/security_handler_factory.rb

.build(encrypt, doc_id, password) ⇒ Object



10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/pdf/reader/security_handler_factory.rb', line 10

def self.build(encrypt, doc_id, password)
  doc_id   ||= []
  password ||= ""

  if encrypt.nil?
    NullSecurityHandler.new
  elsif standard?(encrypt)
    build_standard_handler(encrypt, doc_id, password)
  elsif standard_v5?(encrypt)
    build_v5_handler(encrypt, doc_id, password)
  else
    UnimplementedSecurityHandler.new
  end
end