-
- All Implemented Interfaces:
public interface LcpServiceService used to acquire and open publications protected with LCP.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final classLcpService.AcquiredPublicationInformation about an acquired publication protected with LCP.
public classLcpService.Companion
-
Method Summary
Modifier and Type Method Description abstract BooleanisLcpProtected(File file)Returns if the publication is protected by LCP. abstract Try<LcpService.AcquiredPublication, LcpException>acquirePublication(ByteArray lcpl, Function1<Double, Unit> onProgress)Acquires a protected publication from a standalone LCPL's bytes. Try<LcpService.AcquiredPublication, LcpException>acquirePublication(File lcpl, Function1<Double, Unit> onProgress)Acquires a protected publication from a standalone LCPL file. abstract Try<LcpLicense, LcpException>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. UnitretrieveLicense(String publication, LcpAuthenticating authentication, Function2<LcpLicense, LcpException, Unit> completion)ContentProtectioncontentProtection(LcpAuthenticating authentication)Creates a ContentProtection instance which can be used with a Streamer to unlock LCP protected publications. UnitimportPublication(ByteArray lcpl, LcpAuthenticating authentication, Function2<LcpService.AcquiredPublication, LcpException, Unit> completion)-
-
Method Detail
-
isLcpProtected
abstract Boolean isLcpProtected(File file)
Returns if the publication is protected by LCP.
-
acquirePublication
abstract Try<LcpService.AcquiredPublication, LcpException> acquirePublication(ByteArray lcpl, Function1<Double, Unit> onProgress)
Acquires a protected publication from a standalone LCPL's bytes.
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
Try<LcpService.AcquiredPublication, LcpException> acquirePublication(File lcpl, Function1<Double, Unit> onProgress)
Acquires a protected publication from a standalone LCPL file.
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
abstract Try<LcpLicense, LcpException> 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
@Deprecated(message = "Use `retrieveLicense()` with coroutines instead", replaceWith = @ReplaceWith(imports = {}, expression = "retrieveLicense(File(publication), authentication, allowUserInteraction = true)"))@DelicateCoroutinesApi() Unit retrieveLicense(String publication, LcpAuthenticating authentication, Function2<LcpLicense, LcpException, Unit> completion)
-
contentProtection
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.
-
importPublication
@Deprecated(message = "Use `acquirePublication()` with coroutines instead", replaceWith = @ReplaceWith(imports = {}, expression = "acquirePublication(lcpl)"))@DelicateCoroutinesApi() Unit importPublication(ByteArray lcpl, LcpAuthenticating authentication, Function2<LcpService.AcquiredPublication, LcpException, Unit> completion)
-
-
-
-