Package-level declarations

Types

Link copied to clipboard
data class Action(val action: String, val digitalSourceType: String? = null, val softwareAgent: String? = null, val parameters: Map<String, String>? = null)

Represents a C2PA action that describes an operation performed on content.

Link copied to clipboard
class Builder(ptr: Long) : Closeable

C2PA Builder for creating and signing manifest stores.

Link copied to clipboard
sealed class BuilderIntent

Specifies what kind of manifest to create when building a C2PA claim.

Link copied to clipboard
class ByteArrayStream(initialData: ByteArray? = null) : Stream

Read-write stream with growable byte array. Use this for in-memory operations that need to write output.

Link copied to clipboard
object C2PA

Main C2PA object for static operations

Link copied to clipboard
sealed class C2PAError : Exception

Error model for C2PA operations

Link copied to clipboard
class CallbackStream(reader: StreamReader? = null, seeker: StreamSeeker? = null, writer: StreamWriter? = null, flusher: StreamFlusher? = null) : Stream

Stream implementation with callbacks

Link copied to clipboard

Certificate management for C2PA signing on Android

Link copied to clipboard
class DataStream(data: ByteArray) : Stream

Stream implementation backed by Data

Link copied to clipboard

Defines the digital source type for content created by the builder.

Link copied to clipboard
class FileStream(fileURL: File, mode: FileStream.Mode = Mode.READ_WRITE, createIfNeeded: Boolean = true) : Stream

File-based stream implementation

Link copied to clipboard

KeyStoreSigner provides signing capabilities using keys stored in the Android KeyStore, with hardware-backed key storage, biometric authentication, and hardware security features.

Link copied to clipboard

Predefined C2PA action types as specified in the C2PA specification.

Link copied to clipboard
class Reader(ptr: Long) : Closeable

C2PA Reader for reading and validating manifest stores from media files.

Link copied to clipboard

Seek modes for stream operations

Link copied to clipboard
interface SignCallback

Callback interface for custom signing operations

Link copied to clipboard
class Signer(var ptr: Long) : Closeable

C2PA Signer for signing manifests

Link copied to clipboard
sealed class SignerException(message: String, cause: Throwable? = null) : Exception

Exceptions specific to signer operations

Link copied to clipboard
data class SignerInfo(val algorithm: SigningAlgorithm, val certificatePEM: String, val privateKeyPEM: String, val tsaURL: String? = null)

Signer information

Link copied to clipboard

Signing algorithms

Link copied to clipboard
abstract class Stream : Closeable

Abstract base class for C2PA streams

Link copied to clipboard
typealias StreamFlusher = () -> Int
Link copied to clipboard
typealias StreamReader = (buffer: ByteArray, count: Int) -> Int
Link copied to clipboard
typealias StreamSeeker = (offset: Long, origin: SeekMode) -> Long
Link copied to clipboard
typealias StreamWriter = (buffer: ByteArray, count: Int) -> Int
Link copied to clipboard

StrongBoxSigner provides signing capabilities using Android's StrongBox Keymaster, which provides hardware-isolated key storage and cryptographic operations.

Link copied to clipboard
class WebServiceSigner(configurationURL: String, bearerToken: String? = null, customHeaders: Map<String, String> = emptyMap())

WebServiceSigner provides remote signing capabilities through a C2PA signing server.

Properties

Link copied to clipboard

C2PA version fetched once

Functions

Link copied to clipboard
fun derToRawSignature(derSignature: ByteArray, componentLength: Int): ByteArray

Converts a DER-encoded ECDSA signature to raw format (r || s) required by COSE.

Link copied to clipboard
internal inline fun <T : Any> executeC2PAOperation(errorMessage: String, operation: () -> T?): T

Execute a C2PA operation with standard error handling

Link copied to clipboard
internal fun loadC2PALibraries()

Load native C2PA libraries. Safe to call multiple times - System.loadLibrary handles duplicates.