-
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 BooleanisLcpProtected(File file)Returns if the file is a LCP license document or a publication protected by LCP. abstract Try<LcpService.AcquiredPublication, LcpError>acquirePublication(ByteArray lcpl, Function1<Double, Unit> onProgress)Acquires a protected publication from a standalone LCPL's bytes. abstract Try<LcpService.AcquiredPublication, LcpError>acquirePublication(File lcpl, Function1<Double, Unit> onProgress)Acquires a protected publication from a standalone LCPL file. 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. 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. UnitretrieveLicense(String publication, LcpAuthenticating authentication, Function2<LcpLicense, LcpError, Unit> completion)abstract Try<Unit, LcpError>injectLicenseDocument(LicenseDocument licenseDocument, File publicationFile)Injects a licenseDocument into the given publicationFile package. abstract 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, LcpError, Unit> completion)-
-
Method Detail
-
isLcpProtected
@Deprecated(message = Use an AssetSniffer and check the conformance of the returned format to LcpSpecification, level = DeprecationLevel.ERROR) Boolean isLcpProtected(File file)
Returns if the file is a LCP license document or a publication protected by LCP.
-
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.
-
retrieveLicense
@Deprecated(message = Use `retrieveLicense()` with coroutines instead, replaceWith = @ReplaceWith(imports = {}, expression = retrieveLicense(File(publication), authentication, allowUserInteraction = true)), level = DeprecationLevel.ERROR)@DelicateCoroutinesApi() Unit retrieveLicense(String publication, LcpAuthenticating authentication, Function2<LcpLicense, LcpError, Unit> completion)
-
injectLicenseDocument
abstract Try<Unit, LcpError> injectLicenseDocument(LicenseDocument licenseDocument, File publicationFile)
Injects a licenseDocument into the given publicationFile package.
This is useful if you downloaded the publication yourself instead of using acquirePublication.
-
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.
-
importPublication
@Deprecated(message = Use `acquirePublication()` with coroutines instead, replaceWith = @ReplaceWith(imports = {}, expression = acquirePublication(lcpl)))@DelicateCoroutinesApi() Unit importPublication(ByteArray lcpl, LcpAuthenticating authentication, Function2<LcpService.AcquiredPublication, LcpError, Unit> completion)
-
-
-
-