lcpLicense static method
Sniffs an LCP License Document.
Implementation
static Future<MediaType?> lcpLicense(SnifferContext context) async {
if (context.hasFileExtension(["lcpl"]) ||
context.hasMediaType("application/vnd.readium.lcp.license.v1.0+json")) {
return MediaType.lcpLicenseDocument;
}
if (await context
.containsJsonKeys(["id", "issued", "provider", "encryption"])) {
return MediaType.lcpLicenseDocument;
}
return null;
}