     ///   - onCreatePublication: Transformation which will be applied on every parsed Publication
     ///     Builder. It can be used to modify the `Manifest`, the root `Fetcher` or the list of
     ///     service factories of a `Publication`.
-    ///   - onAskCredentials: Called when a content protection wants to prompt the user for its
-    ///     credentials.
     public init(
         parsers: [PublicationParser] = [],
         ignoreDefaultParsers: Bool = false,
         contentProtections: [ContentProtection] = [],
-        onCreatePublication: Publication.Builder.Transform? = nil,
         openArchive: @escaping ArchiveFactory = DefaultArchiveFactory,
-        onAskCredentials: @escaping OnAskCredentials = { _, callback in callback(nil) }
+        onCreatePublication: Publication.Builder.Transform? = nil
     ) {
         self.parsers = parsers + (ignoreDefaultParsers ? [] : Streamer.makeDefaultParsers())
         self.contentProtections = contentProtections
         self.openArchive = openArchive
         self.onCreatePublication = onCreatePublication
-        self.onAskCredentials = onAskCredentials
     }
     
     private let parsers: [PublicationParser]
     private let contentProtections: [ContentProtection]
     private let openArchive: ArchiveFactory
     private let onCreatePublication: Publication.Builder.Transform?
-    private let onAskCredentials: OnAskCredentials
-    
+
     /// Parses a `Publication` from the given file.
     ///
     /// If you are opening the publication to render it in a Navigator, you must set

        }
    }
    
    /// Prompts the user for a password.
    private func askPassword(sender: Any?) -> Deferred<String?, Publication.OpeningError> {
        return deferred(on: .main) { success, _, cancel in
            self.onAskCredentials(sender) { password in
                if let password = password {
                    success(password)
                } else {
                    cancel()
                }
            }
        }
    }
    
    /// Unlocks any protected file with the provided Content Protections.
    private func openFile(at file: File, with fetcher: Fetcher, credentials: String?, allowUserInteraction: Bool, sender: Any?) -> Deferred<PublicationFile, Publication.OpeningError> {
        func unlock(using protections: [ContentProtection]) -> Deferred<ProtectedFile?, Publication.OpeningError> {
            return deferred {
                var protections = protections

private extension ContentProtection {
    
    /// Wrapper to use `Deferred` with `ContentProtection.open()`.
    func open(file: File, fetcher: Fetcher, allowUserInteraction: Bool, credentials: String?, sender: Any?) -> Deferred<ProtectedFile?, Publication.OpeningError> {
        return deferred { completion in
            self.open(file: file, fetcher: fetcher, allowUserInteraction: allowUserInteraction, credentials: credentials, sender: sender, completion: completion)
        }
    }

