acquirePublicationFromFile method

Future<Try<AcquiredPublication, LcpException>> acquirePublicationFromFile(
  1. File lcpl
)

Acquires a protected publication from a standalone LCPL file.

Implementation

Future<Try<AcquiredPublication, LcpException>> acquirePublicationFromFile(
    File lcpl) async {
  try {
    return lcpl
        .readAsBytes()
        .then((data) => ByteData.sublistView(data))
        .then((data) => acquirePublication(data));
  } on Exception catch (e) {
    return Try.failure(LcpException.wrap(e));
  }
}