Package 

Interface LcpService


  • 
    public interface LcpService
    
                        

    Service used to acquire and open publications protected with LCP.

    • Method Detail

      • acquirePublication

         abstract Try<LcpService.AcquiredPublication, LcpError> acquirePublication(ByteArray lcpl, Function1<Double, Unit> onProgress)

        Acquires a protected publication from a standalone LCPL's bytes.

        License will be injected into the publication archive without explicitly calling injectLicenseDocument. You can cancel the on-going acquisition by cancelling its parent coroutine context.

        Parameters:
        onProgress - Callback to follow the acquisition progress from 0.0 to 1.0.
      • acquirePublication

         abstract Try<LcpService.AcquiredPublication, LcpError> acquirePublication(File lcpl, Function1<Double, Unit> onProgress)

        Acquires a protected publication from a standalone LCPL file.

        License will be injected into the publication archive without explicitly calling injectLicenseDocument. You can cancel the on-going acquisition by cancelling its parent coroutine context.

        Parameters:
        onProgress - Callback to follow the acquisition progress from 0.0 to 1.0.
      • retrieveLicense

        @Deprecated(message = Use the overload taking an asset instead., level = DeprecationLevel.ERROR) Try<LcpLicense, LcpError> retrieveLicense(File file, LcpAuthenticating authentication, Boolean allowUserInteraction, Object sender)

        Opens the LCP license of a protected publication, to access its DRM metadata and decipher its content.

        Parameters:
        authentication - Used to retrieve the user passphrase if it is not already known.
        allowUserInteraction - Indicates whether the user can be prompted for their passphrase.
        sender - Free object that can be used by reading apps to give some UX context when presenting dialogs with LcpAuthenticating.
      • retrieveLicense

         abstract Try<LcpLicense, LcpError> retrieveLicense(Asset asset, LcpAuthenticating authentication, Boolean allowUserInteraction)

        Opens the LCP license of a protected publication, to access its DRM metadata and decipher its content. If the updated license cannot be stored into the Asset, you'll get an exception if the license points to a LSD server that cannot be reached, for instance because no Internet gateway is available.

        Updated licenses can currently be stored only into Assets whose source property points to a URL with scheme file or content.

        Parameters:
        authentication - Used to retrieve the user passphrase if it is not already known.
        allowUserInteraction - Indicates whether the user can be prompted for their passphrase.
      • contentProtection

         abstract ContentProtection contentProtection(LcpAuthenticating authentication)

        Creates a ContentProtection instance which can be used with a Streamer to unlock LCP protected publications.

        The provided authentication will be used to retrieve the user passphrase when opening an LCP license. The default implementation LcpDialogAuthentication presents a dialog to the user to enter their passphrase.