ProtectedAsset class

Holds the result of opening a File with a ContentProtection.

@property file Protected file which will be provided to the parsers. In most cases, this will be the file provided to ContentProtection::open(), but a Content Protection might modify it in some cases:

  • If the original file has a media type that can't be recognized by parsers, the Content Protection must return a file with the matching unprotected media type.
  • If the Content Protection technology needs to redirect the Streamer to a different file. For example, this could be used to decrypt a publication to a temporary secure location.

@property fetcher Primary leaf fetcher to be used by parsers. The Content Protection can unlock resources by modifying the Fetcher provided to ContentProtection::open(), for example by:

  • Wrapping the given fetcher in a TransformingFetcher with a decryption Resource.Transformer function.
  • Discarding the provided fetcher altogether and creating a new one to handle access restrictions. For example, by creating an HTTPFetcher which will inject a Bearer Token in requests.

@property onCreatePublication Called on every parsed Publication.Builder. It can be used to modify the Manifest, the root Fetcher or the list of service factories of a Publication.

Constructors

ProtectedAsset({required PublicationAsset asset, required Fetcher fetcher, required void onCreatePublication(ServicesBuilder)})

Properties

asset PublicationAsset
final
fetcher Fetcher
final
hashCode int
The hash code for this object.
no setterinherited
onCreatePublication → void Function(ServicesBuilder)
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited