C2PAContext
C2PA Context for creating readers and builders with shared configuration.
C2PAContext wraps the native C2PAContext struct and provides an immutable, shareable configuration context. Once created, a context can be used to create multiple Reader and Builder instances that share the same settings.
Usage
Default context
val context = C2PAContext.create()
val builder = Builder.fromContext(context)
val reader = Reader.fromContext(context)
context.close()Content copied to clipboard
Custom settings
val settings = C2PASettings.create()
.updateFromString(settingsJson, "json")
val context = C2PAContext.fromSettings(settings)
settings.close()
val builder = Builder.fromContext(context)
.withDefinition(manifestJson)Content copied to clipboard
Resource Management
C2PAContext implements Closeable and must be closed when done to free native resources. The context can be closed after creating readers/builders from it.
Since
1.0.0