     }
     
     class open func hasPassword(fileURL: URL) -> Bool {
-        return autoreleasepool { () -> Bool in
-            do {
-                let data = try Data(contentsOf: fileURL)
-                return hasPassword(data: data)
-            } catch {
-                return false
-            }
+        do {
+            return hasPassword(data: try Data(contentsOf: fileURL))
+        } catch {
+            return false
         }
     }
     

    
    class open func canUnlock(data: Data, password: String) -> Bool {
        return autoreleasepool { () -> Bool in
            let dataProvider = CGDataProvider(data: data as CFData)
            let pdf = CGPDFDocument(dataProvider!)
            
            // Try a blank password first, per Apple's Quartz PDF example
            if pdf?.isEncrypted == true &&

    
    class open func canUnlock(fileURL: URL, password: String) -> Bool {
        do {
            return canUnlock(data: try Data(contentsOf: fileURL), password: password)
        } catch {
            return false
        }
