C2paSettings class final
Conservative limits used while reading and validating C2PA data.
Constructors
- C2paSettings({int maxResourceBytes = 50 * 1024 * 1024, int maxTotalResourceBytes = 200 * 1024 * 1024, int maxResourceCount = 1024, bool allowNetworkAccess = false, int maxNetworkBytes = 10 * 1024 * 1024, Duration networkTimeout = const Duration(seconds: 10), int maxRedirects = 3, bool enableOcspFetch = false, int maxOcspRequestBytes = 16 * 1024, int maxOcspResponseBytes = 1024 * 1024, Duration ocspMaxAgeWithoutNextUpdate = const Duration(hours: 24), Duration ocspClockSkew = const Duration(minutes: 5), int maxRecursionDepth = 16, int maxManifestBytes = 64 * 1024 * 1024, int maxDecompressedManifestBytes = defaultMaxDecompressedManifestBytes, int maxJumbfBoxCount = 10000, int maxIngredientDepth = 8, int maxIngredientCount = 1024})
-
Creates settings with conservative resource and network defaults.
const
-
C2paSettings.fromJson(Map<
String, Object?> json) -
Creates settings from JSON, using defaults for missing or mistyped values.
factory
Properties
- allowNetworkAccess → bool
-
Whether remote manifest and OCSP network fetches are allowed.
final
- enableOcspFetch → bool
-
Whether missing OCSP responses may be fetched over the network.
final
- hashCode → int
-
The hash code for this object.
no setteroverride
- maxDecompressedManifestBytes → int
-
Maximum decompressed manifest bytes, capped at 1 GiB.
final
- maxIngredientCount → int
-
Maximum ingredient count traversed; default 1024.
final
- maxIngredientDepth → int
-
Maximum ingredient traversal depth; default 8.
final
- maxJumbfBoxCount → int
-
Maximum JUMBF boxes parsed from one manifest; default 10000.
final
- maxManifestBytes → int
-
Maximum compressed or stored manifest bytes; default 64 MiB.
final
- maxNetworkBytes → int
-
Maximum bytes read from one network response; default 10 MiB.
final
- maxOcspRequestBytes → int
-
Maximum OCSP request size in bytes; default 16 KiB.
final
- maxOcspResponseBytes → int
-
Maximum OCSP response size in bytes; default 1 MiB.
final
- maxRecursionDepth → int
-
Maximum nested JUMBF recursion depth; default 16.
final
- maxRedirects → int
-
Maximum HTTP redirects followed for remote manifests; default 3.
final
- maxResourceBytes → int
-
Maximum bytes allowed for one embedded resource; default 50 MiB.
final
- maxResourceCount → int
-
Maximum embedded resource count; default 1024.
final
- maxTotalResourceBytes → int
-
Maximum combined embedded resource bytes; default 200 MiB.
final
- networkTimeout → Duration
-
Overall timeout for network requests; default 10 seconds.
final
- ocspClockSkew → Duration
-
Allowed OCSP clock skew; default 5 minutes.
final
- ocspMaxAgeWithoutNextUpdate → Duration
-
Maximum OCSP age without
nextUpdate; default 24 hours.final - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
copyWith(
{int? maxResourceBytes, int? maxTotalResourceBytes, int? maxResourceCount, bool? allowNetworkAccess, int? maxNetworkBytes, Duration? networkTimeout, int? maxRedirects, bool? enableOcspFetch, int? maxOcspRequestBytes, int? maxOcspResponseBytes, Duration? ocspMaxAgeWithoutNextUpdate, Duration? ocspClockSkew, int? maxRecursionDepth, int? maxManifestBytes, int? maxDecompressedManifestBytes, int? maxJumbfBoxCount, int? maxIngredientDepth, int? maxIngredientCount}) → C2paSettings - Creates a copy with the provided settings replaced.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, Object?> - Encodes these settings as JSON-compatible values.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override
Constants
- defaultMaxDecompressedManifestBytes → const int
- Default decompressed manifest limit: 32 MiB.
- maximumDecompressedManifestBytes → const int
- Hard decompressed manifest limit: 1 GiB.