acquirePublication method

  1. @override
Future<Try<AcquiredPublication, LcpException>> acquirePublication(
  1. ByteData lcpl
)
override

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

Implementation

@override
Future<Try<AcquiredPublication, LcpException>> acquirePublication(
    ByteData lcpl) async {
  try {
    LicenseDocument licenseDocument = LicenseDocument.parse(lcpl);
    return _fetchPublication(licenseDocument)
        .then((license) => Try.success(license));
  } on Exception catch (e, stacktrace) {
    Fimber.d("fetchPublication ERROR", ex: e, stacktrace: stacktrace);
    return Try.failure(LcpException.wrap(e));
  }
}