C2PASigner Component

Properties   Methods   Events   Config Settings   Errors  

Creates a C2PA Manifest, signs it, and embeds it into an asset.

Syntax

nsoftware.IPWorksLLM.C2PASigner

Remarks

The C2PASigner component produces Content Credentials: a signed C2PA Manifest that records how an asset was produced, which tool produced it, and whether generative AI was involved. The manifest is embedded directly into the asset, so the provenance travels with the file.

Supported Formats

The component embeds the manifest into the asset itself, so each container format needs its own support. JPEG, PNG and PDF are supported.

JPEGThe manifest travels in APP11 marker segments. Because a JPEG marker segment cannot exceed 64K, a manifest of any size spans several contiguous segments.
PNGThe manifest travels in a single caBX chunk placed before the image data.
PDFThe manifest travels in an embedded file stream, appended to the document as an incremental update. The original bytes of the document are left untouched.

The format is detected from the asset itself; there is nothing to configure. An asset in any other format is refused rather than written incorrectly.

For PDF, only documents using classic cross-reference tables can be signed. A document using cross-reference streams is refused, because appending a table-style update to it would produce a file that readers reject.

Signing an Asset

Set InputFile to the asset to be signed, OutputFile to the destination, and SigningCert to a certificate with an associated private key. Calling Sign builds the manifest, signs it, and writes the result.

C2PASigner signer = new C2PASigner(); signer.InputFile = "photo.jpg"; signer.OutputFile = "photo-signed.jpg"; signer.ClaimGenerator = "MyApp/1.0"; signer.SigningCert = new Certificate(CertStoreTypes.cstPFXFile, "signer.pfx", "password", "*"); signer.Sign();

The signing certificate must carry the C2PA claim signing extended key usage, and the manifest is signed with the algorithm named by SignatureAlgorithm. The permitted algorithms are ES256, ES384, ES512, PS256, PS384, PS512, and Ed25519; the C2PA specification permits no others.

Disclosing AI-Generated Content

The most common reason to sign an asset is to disclose how it was created. The AddAction method records a single action in the manifest. Marking an asset as generative AI output is one call.

signer.AddAction("c2pa.created", "http://cv.iptc.org/newscodes/digitalsourcetype/trainedAlgorithmicMedia", "MyApp/1.0"); signer.Sign();

The second parameter is the digital source type. The C2PA specification requires that a digital source type accompany the c2pa.created action for every asset; use http://c2pa.org/digitalsourcetype/empty when the asset began as a new file with no digital content.

Adding Other Assertions

Anything beyond the assertions the component computes for itself is added with AddAssertion, which appends a raw assertion payload under a given label. This keeps the API stable as the C2PA standard assertion set evolves.

string creativeWork = "{\"@context\":\"https://schema.org\",\"@type\":\"CreativeWork\",\"author\":[{\"@type\":\"Person\",\"name\":\"Jane Doe\"}]}"; signer.AddAssertion("stds.schema-org.CreativeWork", "application/json", System.Text.Encoding.UTF8.GetBytes(creativeWork));

The content binding assertion, which cryptographically ties the manifest to the asset bytes, is always computed by the component and cannot be supplied by the application. Doing so is what makes tampering detectable.

Trusted Time-Stamps

Setting TSAURL to the address of an RFC 3161 Time Stamping Authority adds a trusted time-stamp to the signature. A time-stamped signature remains verifiable after the signing certificate expires, which is why the C2PA specification recommends obtaining one whenever a TSA can be reached.

signer.TSAURL = "http://timestamp.example.com/tsa"; signer.Sign();

Property List


The following is the full list of the properties of the component with short descriptions. Click on the links for further details.

Actions The actions recorded in the Manifest.
Assertions The assertions to record in the C2PA Manifest.
ClaimGenerator The identifier of the tool that created the claim.
Ingredients The ingredients recorded in the Manifest.
InputData The asset to process, held in memory.
InputFile The asset to process.
OutputData The signed asset, held in memory.
OutputFile The file to write the signed asset to.
Overwrite Whether the component may overwrite an existing output file.
SignatureAlgorithm The algorithm used to sign the claim.
SigningCert The certificate used to sign the C2PA Manifest.
TSAURL The address of an RFC 3161 Time Stamping Authority.

Method List


The following is the full list of the methods of the component with short descriptions. Click on the links for further details.

AddAction Records an action in the C2PA Manifest.
AddAssertion Appends an assertion to the Assertions collection.
AddIngredient Records that an asset went into the one being signed.
Config Sets or retrieves a configuration setting.
Reset This method will reset the component.
Sign Builds, signs, and embeds a C2PA Manifest.

Event List


The following is the full list of the events fired by the component with short descriptions. Click on the links for further details.

Error Fired when information is available about errors during data delivery.
Log This event fires once for each log message.

Config Settings


The following is a list of config settings for the component with short descriptions. Click on the links for further details.

HashAlgorithm The hash algorithm used for the content binding.
IncludeThumbnail Whether a claim thumbnail is embedded in the manifest.
InstanceId The instance identifier recorded in the claim.
LogLevel The level of detail logged through the Log event.
SignaturePadding The number of bytes reserved for the claim signature.
BuildInfo Information about the product's build.
GUIAvailable Whether or not a message loop is available for processing events.
LicenseInfo Information about the current license.
MaskSensitiveData Whether sensitive data is masked in log messages.
UseInternalSecurityAPI Whether or not to use the system security libraries or an internal implementation.

Actions Property (C2PASigner Component)

The actions recorded in the Manifest.

Syntax

public C2PAActionList Actions { get; }
                
Public Property Actions As C2PAActionList
                

Remarks

Each entry describes something that was done to the content. AddAction is the short way to add one; this collection is how an application reads them back, and how it reaches the When field, which AddAction does not take.

The actions travel in a single c2pa.actions.v2 assertion, written when the Manifest is signed.

Example. Recording when an edit happened:

C2PASigner signer = new C2PASigner(); signer.InputFile = "edited.jpg"; signer.SigningCert = cert; signer.AddAction("c2pa.edited", "", "Acme Editor/3.0"); // AddAction takes no timestamp, so set it on the queued action. signer.Actions[0].When = "2026-09-01T10:30:00Z"; signer.Sign();

Example. Checking what will be recorded before signing:

for (int i = 0; i < signer.Actions.Count; i++) { Console.WriteLine(signer.Actions[i].Action + " by " + signer.Actions[i].SoftwareAgent); }

This property is not available at design time.

Please refer to the C2PAAction type for a complete list of fields.

Assertions Property (C2PASigner Component)

The assertions to record in the C2PA Manifest.

Syntax

public C2PAAssertionList Assertions { get; }
                
Public Property Assertions As C2PAAssertionList
                

Remarks

This collection holds the C2PAAssertion items written into the manifest when Sign is called. The AddAssertion and AddAction methods are a convenient way to append items without constructing them directly.

The content binding assertion, which ties the manifest to the asset bytes, is always computed by the component and is not part of this collection. An application cannot supply it, because a self-supplied binding would defeat tamper detection.

This property is not available at design time.

Please refer to the C2PAAssertion type for a complete list of fields.

ClaimGenerator Property (C2PASigner Component)

The identifier of the tool that created the claim.

Syntax

public string ClaimGenerator { get; set; }
                
Public Property ClaimGenerator As String
                

Default Value

""

Remarks

This property identifies the application that produced the C2PA Manifest, and is recorded in the claim so a consumer can see which tool made the provenance assertion.

Use a name and version, for example MyApp/1.0. When this property is left empty, the component records its own name and version.

This property is not available at design time.

Ingredients Property (C2PASigner Component)

The ingredients recorded in the Manifest.

Syntax

public C2PAIngredientList Ingredients { get; }
                
Public Property Ingredients As C2PAIngredientList
                

Remarks

Each entry is an asset that went into the one being signed, added by AddIngredient. This collection is how an application reads them back before signing.

When an ingredient's source carried a Manifest of its own, ManifestLabel names it and that Manifest is carried in the store being written. When it did not, ManifestLabel is empty: the ingredient records what the source was, and the chain stops there.

Example. Reading back what was recorded:

signer.AddIngredient("original.jpg", "Original photograph", "parentOf"); C2PAIngredient added = signer.Ingredients[0]; Console.WriteLine(added.Title + " (" + added.Format + ") " + added.Relationship); if (added.ManifestLabel.Length > 0) { Console.WriteLine(" its own manifest travels along: " + added.ManifestLabel); } else { Console.WriteLine(" the source carried no manifest; the chain stops here"); }

This property is not available at design time.

Please refer to the C2PAIngredient type for a complete list of fields.

InputData Property (C2PASigner Component)

The asset to process, held in memory.

Syntax

public string InputData { get; set; }
public byte[] InputDataB { get; set; }
                
Public Property InputData As String
Public Property InputDataB As Byte()
                

Default Value

""

Remarks

This property specifies the asset to be processed as a byte array, for applications that do not work with files on disk.

When both InputFile and this property are set, InputFile takes precedence.

InputFile Property (C2PASigner Component)

The asset to process.

Syntax

public string InputFile { get; set; }
                
Public Property InputFile As String
                

Default Value

""

Remarks

This property specifies the asset to be processed. Set it to the full or relative path of the file.

When both this property and InputData are set, this property takes precedence.

OutputData Property (C2PASigner Component)

The signed asset, held in memory.

Syntax

public string OutputData { get; }
public byte[] OutputDataB { get; }
                
Public ReadOnly Property OutputData As String
Public ReadOnly Property OutputDataB As Byte()
                

Default Value

""

Remarks

This property holds the signed asset after the operation completes, when OutputFile was left empty.

This property is read-only.

OutputFile Property (C2PASigner Component)

The file to write the signed asset to.

Syntax

public string OutputFile { get; set; }
                
Public Property OutputFile As String
                

Default Value

""

Remarks

This property specifies where the signed asset is written. Set it to the full or relative path of the destination file.

If this property is empty, the signed asset is written to OutputData instead.

An error is thrown if the file already exists and Overwrite is False.

Overwrite Property (C2PASigner Component)

Whether the component may overwrite an existing output file.

Syntax

public bool Overwrite { get; set; }
                
Public Property Overwrite As Boolean
                

Default Value

False

Remarks

This property indicates whether the component will overwrite OutputFile. When it is False, an error is thrown if OutputFile already exists.

The default value is False.

SignatureAlgorithm Property (C2PASigner Component)

The algorithm used to sign the claim.

Syntax

public string SignatureAlgorithm { get; set; }
                
Public Property SignatureAlgorithm As String
                

Default Value

"ES256"

Remarks

This property specifies the signature algorithm. The C2PA specification permits only the following values, and no others:

ES256ECDSA with SHA-256.
ES384ECDSA with SHA-384.
ES512ECDSA with SHA-512.
PS256RSASSA-PSS using SHA-256 and MGF1 with SHA-256.
PS384RSASSA-PSS using SHA-384 and MGF1 with SHA-384.
PS512RSASSA-PSS using SHA-512 and MGF1 with SHA-512.
Ed25519EdDSA on the edwards25519 curve. No other EdDSA instance is allowed.

The value must be compatible with the key in SigningCert. The default value is ES256.

This property is not available at design time.

SigningCert Property (C2PASigner Component)

The certificate used to sign the C2PA Manifest.

Syntax

public Certificate SigningCert { get; set; }
                
Public Property SigningCert As Certificate
                

Remarks

This property specifies the certificate used to sign the claim. The certificate must have an associated private key.

The C2PA specification requires that a claim signing certificate carry the c2pa-kp-claimSigning extended key usage, OID 1.3.6.1.4.1.62558.2.1. A certificate without it will be rejected by conforming validators even though the signature itself is well formed.

The full chain presented with the certificate is embedded in the signature, so a validator can build a path to its own trust anchors without fetching intermediates.

This property is not available at design time.

Please refer to the Certificate type for a complete list of fields.

TSAURL Property (C2PASigner Component)

The address of an RFC 3161 Time Stamping Authority.

Syntax

public string TSAURL { get; set; }
                
Public Property TSAURL As String
                

Default Value

""

Remarks

This property specifies the Time Stamping Authority contacted during signing. When it is set, the component obtains a trusted time-stamp over the signature and embeds it in the C2PA Manifest as a countersignature.

A time-stamped signature stays verifiable after the signing certificate expires, because a validator can establish that the signature existed while the certificate was still valid. The C2PA specification recommends obtaining a time-stamp whenever a TSA can be reached at signing time.

When this property is empty, no time-stamp is requested.

When it is set and the authority cannot be reached, or returns no token, signing fails rather than producing an untimestamped Manifest. Asking for a time-stamp and quietly getting none would leave a signature that looks complete but loses its meaning the day the certificate expires.

The connection to the authority is authenticated like any other: a TSA presenting an untrusted or expired certificate is refused. There is no event for overriding that decision.

This property is not available at design time.

AddAction Method (C2PASigner Component)

Records an action in the C2PA Manifest.

Syntax

public void AddAction(string action, string digitalSourceType, string softwareAgent);

Async Version
public async Task AddAction(string action, string digitalSourceType, string softwareAgent);
public async Task AddAction(string action, string digitalSourceType, string softwareAgent, CancellationToken cancellationToken);
                
Public Sub AddAction(ByVal Action As String, ByVal DigitalSourceType As String, ByVal SoftwareAgent As String)

Async Version
Public Sub AddAction(ByVal Action As String, ByVal DigitalSourceType As String, ByVal SoftwareAgent As String) As Task
Public Sub AddAction(ByVal Action As String, ByVal DigitalSourceType As String, ByVal SoftwareAgent As String, cancellationToken As CancellationToken) As Task
                

Remarks

This method appends an action to the manifest's actions assertion, creating that assertion if it does not exist yet.

Action is the C2PA action identifier, such as c2pa.created, c2pa.edited, c2pa.opened, or c2pa.placed.

DigitalSourceType describes the nature of the content the action produced. The C2PA specification requires that a digital source type accompany the c2pa.created action for every asset. Commonly used values are:

http://cv.iptc.org/newscodes/digitalsourcetype/trainedAlgorithmicMediaMedia produced by a generative model.
http://cv.iptc.org/newscodes/digitalsourcetype/digitalCaptureCaptured by a camera or other recording device.
http://c2pa.org/digitalsourcetype/emptyThe asset began as a new file with no digital content.

Other values defined by the IPTC digital source type vocabulary may also be used. Pass an empty string when the action does not take one; a c2pa.opened action, for example, requires none.

SoftwareAgent names the tool that performed the action.

Disclosing AI-generated content is a single call:

signer.AddAction("c2pa.created", "http://cv.iptc.org/newscodes/digitalsourcetype/trainedAlgorithmicMedia", "MyApp/1.0");

AddAssertion Method (C2PASigner Component)

Appends an assertion to the Assertions collection.

Syntax

public void AddAssertion(string assertionLabel, string mediaType, byte[] data);

Async Version
public async Task AddAssertion(string assertionLabel, string mediaType, byte[] data);
public async Task AddAssertion(string assertionLabel, string mediaType, byte[] data, CancellationToken cancellationToken);
                
Public Sub AddAssertion(ByVal AssertionLabel As String, ByVal MediaType As String, ByVal Data As Byte())

Async Version
Public Sub AddAssertion(ByVal AssertionLabel As String, ByVal MediaType As String, ByVal Data As Byte()) As Task
Public Sub AddAssertion(ByVal AssertionLabel As String, ByVal MediaType As String, ByVal Data As Byte(), cancellationToken As CancellationToken) As Task
                

Remarks

This method appends a new C2PAAssertion item to the Assertions collection.

AssertionLabel is the C2PA assertion label, such as stds.schema-org.CreativeWork or stds.exif. MediaType is the payload's media type, normally application/json or application/cbor. Data is the assertion payload.

Passing the payload through verbatim keeps the API stable as the C2PA standard assertion set evolves: a new assertion type can be written without waiting for a new build of the component.

string creativeWork = "{\"@context\":\"https://schema.org\",\"@type\":\"CreativeWork\",\"author\":[{\"@type\":\"Person\",\"name\":\"Jane Doe\"}]}"; signer.AddAssertion("stds.schema-org.CreativeWork", "application/json", System.Text.Encoding.UTF8.GetBytes(creativeWork));

Use AddAction instead when recording an action, since it builds the correctly structured actions assertion for you.

AddIngredient Method (C2PASigner Component)

Records that an asset went into the one being signed.

Syntax

public void AddIngredient(string sourceFile, string title, string relationship);

Async Version
public async Task AddIngredient(string sourceFile, string title, string relationship);
public async Task AddIngredient(string sourceFile, string title, string relationship, CancellationToken cancellationToken);
                
Public Sub AddIngredient(ByVal SourceFile As String, ByVal Title As String, ByVal Relationship As String)

Async Version
Public Sub AddIngredient(ByVal SourceFile As String, ByVal Title As String, ByVal Relationship As String) As Task
Public Sub AddIngredient(ByVal SourceFile As String, ByVal Title As String, ByVal Relationship As String, cancellationToken As CancellationToken) As Task
                

Remarks

An ingredient is a source asset and the relationship it has to this one. Recording ingredients is what turns individual Manifests into a provenance chain: a consumer can follow an edited image back to the photograph it came from, and that one back to the camera that produced it.

SourceFile is the asset that went in. Title is a human-readable name for it; pass an empty string to omit it. Relationship is one of:

parentOfThe asset this one was derived from. An edit of a photograph names the photograph as its parent.
componentOfAn asset included in this one. A photograph placed into a composite is a component of it. This is the default when an empty string is passed.
inputToAn asset fed to a process that produced this one. A photograph used as a prompt for a generative model is an input to the result.

When the source carries a C2PA Manifest of its own, that Manifest is copied into the Manifest being written and the ingredient points at it. The chain then travels with the file: a verifier can follow it without needing the original source asset.

When the source carries no Manifest, the ingredient still records what the source was. The chain stops there, which is the truth about that asset rather than something to conceal.

Call this before Sign. Ingredients are read back through the Ingredients collection.

Example. Recording that an edited image came from a signed original:

C2PASigner signer = new C2PASigner(); signer.InputFile = "edited.jpg"; signer.OutputFile = "edited-signed.jpg"; signer.SigningCert = new Certificate(CertStoreTypes.cstPFXFile, "signer.pfx", "password", "*"); signer.ClaimGenerator = "Acme Editor/3.0"; // The photograph this edit was made from. Its Manifest travels along. signer.AddIngredient("original.jpg", "Original photograph", "parentOf"); signer.AddAction("c2pa.edited", "", "Acme Editor/3.0"); signer.Sign();

Example. Recording the sources of a generated image:

C2PASigner signer = new C2PASigner(); signer.InputFile = "generated.png"; signer.OutputFile = "generated-signed.png"; signer.SigningCert = cert; signer.ClaimGenerator = "Acme Generator/1.0"; signer.AddIngredient("reference.jpg", "Reference image", "inputTo"); // Disclose that the output is generative. signer.AddAction("c2pa.created", "http://cv.iptc.org/newscodes/digitalsourcetype/trainedAlgorithmicMedia", "Acme Generator/1.0"); signer.Sign();

Config Method (C2PASigner Component)

Sets or retrieves a configuration setting.

Syntax

public string Config(string configurationString);

Async Version
public async Task<string> Config(string configurationString);
public async Task<string> Config(string configurationString, CancellationToken cancellationToken);
                
Public Function Config(ByVal ConfigurationString As String) As String

Async Version
Public Function Config(ByVal ConfigurationString As String) As Task(Of String)
Public Function Config(ByVal ConfigurationString As String, cancellationToken As CancellationToken) As Task(Of String)
                

Remarks

Config is a generic method available in every component. It is used to set and retrieve configuration settings for the component.

These settings are similar in functionality to properties, but they are rarely used. In order to avoid "polluting" the property namespace of the component, access to these internal properties is provided through the Config method.

To set a configuration setting named PROPERTY, you must call Config("PROPERTY=VALUE"), where VALUE is the value of the setting expressed as a string. For boolean values, use the strings "True", "False", "0", "1", "Yes", or "No" (case does not matter).

To read (query) the value of a configuration setting, you must call Config("PROPERTY"). The value will be returned as a string.

Reset Method (C2PASigner Component)

This method will reset the component.

Syntax

public void Reset();

Async Version
public async Task Reset();
public async Task Reset(CancellationToken cancellationToken);
                
Public Sub Reset()

Async Version
Public Sub Reset() As Task
Public Sub Reset(cancellationToken As CancellationToken) As Task
                

Remarks

This method will reset the component's properties to their default values.

Sign Method (C2PASigner Component)

Builds, signs, and embeds a C2PA Manifest.

Syntax

public void Sign();

Async Version
public async Task Sign();
public async Task Sign(CancellationToken cancellationToken);
                
Public Sub Sign()

Async Version
Public Sub Sign() As Task
Public Sub Sign(cancellationToken As CancellationToken) As Task
                

Remarks

This method reads the asset named by InputFile (or held in InputData), builds a C2PA Manifest from the Assertions collection, signs the claim with SigningCert, embeds the manifest into the asset, and writes the result to OutputFile (or OutputData).

The following example signs a JPEG and discloses that it was produced by a generative model.

C2PASigner signer = new C2PASigner(); signer.InputFile = "photo.jpg"; signer.OutputFile = "photo-signed.jpg"; signer.ClaimGenerator = "MyApp/1.0"; signer.SigningCert = new Certificate(CertStoreTypes.cstPFXFile, "signer.pfx", "password", "*"); signer.AddAction("c2pa.created", "http://cv.iptc.org/newscodes/digitalsourcetype/trainedAlgorithmicMedia", "MyApp/1.0"); signer.Sign();

Signing is a two-pass operation. The manifest is embedded once at a reserved size so the final byte layout of the asset is known, the content binding hash is then computed over the asset outside the manifest's own bytes, and the real signature replaces the reservation. This is what allows the hash to cover an asset that contains the manifest.

An error is thrown when SigningCert has no private key, when SignatureAlgorithm is incompatible with that key, or when the input asset is of a format the component cannot embed into.

Error Event (C2PASigner Component)

Fired when information is available about errors during data delivery.

Syntax

public event OnErrorHandler OnError;

public delegate void OnErrorHandler(object sender, C2PASignerErrorEventArgs e);

public class C2PASignerErrorEventArgs : EventArgs {
  public int ErrorCode { get; }
  public string Description { get; }
}

Async Version
public event AsyncEventHandler<C2PASignerErrorEventArgs> OnError;

public delegate Task AsyncEventHandler<TEventArgs>(object sender, TEventArgs e);

public class C2PASignerErrorEventArgs : AsyncEventArgs {
  public CancellationToken CancellationToken { get; }
  public int ErrorCode { get; }
  public string Description { get; }
}
                
Public Event OnError As OnErrorHandler

Public Delegate Sub OnErrorHandler(sender As Object, e As C2PASignerErrorEventArgs)

Public Class C2PASignerErrorEventArgs Inherits EventArgs
  Public ReadOnly Property ErrorCode As Integer
  Public ReadOnly Property Description As String
End Class

Async Version
Public Event OnError As AsyncEventHandler(Of C2PASignerErrorEventArgs)

Public Delegate Function AsyncEventHandler(Of TEventArgs)(sender As Object, e As TEventArgs) As Task

Public Class C2PASignerErrorEventArgs Inherits AsyncEventArgs
  Public ReadOnly Property CancellationToken As CancellationToken
  Public ReadOnly Property ErrorCode As Integer
  Public ReadOnly Property Description As String
End Class
                

Remarks

The Error event is fired in case of exceptional conditions during message processing. Normally the component throws an exception.

The ErrorCode parameter contains an error code, and the Description parameter contains a textual description of the error. For a list of valid error codes and their descriptions, please refer to the Error Codes section.

Log Event (C2PASigner Component)

This event fires once for each log message.

Syntax

public event OnLogHandler OnLog;

public delegate void OnLogHandler(object sender, C2PASignerLogEventArgs e);

public class C2PASignerLogEventArgs : EventArgs {
  public int LogLevel { get; }
  public string Message { get; }
  public string LogType { get; }
}

Async Version
public event AsyncEventHandler<C2PASignerLogEventArgs> OnLog;

public delegate Task AsyncEventHandler<TEventArgs>(object sender, TEventArgs e);

public class C2PASignerLogEventArgs : AsyncEventArgs {
  public CancellationToken CancellationToken { get; }
  public int LogLevel { get; }
  public string Message { get; }
  public string LogType { get; }
}
                
Public Event OnLog As OnLogHandler

Public Delegate Sub OnLogHandler(sender As Object, e As C2PASignerLogEventArgs)

Public Class C2PASignerLogEventArgs Inherits EventArgs
  Public ReadOnly Property LogLevel As Integer
  Public ReadOnly Property Message As String
  Public ReadOnly Property LogType As String
End Class

Async Version
Public Event OnLog As AsyncEventHandler(Of C2PASignerLogEventArgs)

Public Delegate Function AsyncEventHandler(Of TEventArgs)(sender As Object, e As TEventArgs) As Task

Public Class C2PASignerLogEventArgs Inherits AsyncEventArgs
  Public ReadOnly Property CancellationToken As CancellationToken
  Public ReadOnly Property LogLevel As Integer
  Public ReadOnly Property Message As String
  Public ReadOnly Property LogType As String
End Class
                

Remarks

This event fires once for each log message generated by the component. The verbosity is controlled by the LogLevel setting.

LogLevel indicates the level of message. Possible values are as follows:

0 (None)No messages are logged.
1 (Info - default)Informational events such as the start and completion of a signing or verification operation are logged.
2 (Verbose)Detailed data such as individual manifest boxes and validation steps are logged.
3 (Debug)Debug data including byte offsets and hash inputs are logged.

Message is the log entry.

LogType identifies the type of log entry. Possible values are Info, Manifest, Signature, and Validation.

C2PAAction Type

A single action recorded in the actions assertion.

Remarks

This type represents one entry in a C2PA Manifest's actions assertion: something that was done to the asset, by what, and what kind of content resulted.

The actions assertion is where an asset's history is written down, and it is the mechanism regulators point to for AI disclosure. An asset produced by a generative model carries a c2pa.created action whose DigitalSourceType identifies the output as trained algorithmic media.

The following fields are available:

Fields

Action
string

Default: ""

The action identifier.

This field holds the C2PA action identifier. Values defined by the specification include c2pa.created, c2pa.edited, c2pa.opened, c2pa.placed, c2pa.converted, and c2pa.published.

The first action in a manifest describes how the asset came into being, and is normally c2pa.created.

DigitalSourceType
string

Default: ""

The nature of the content the action produced.

This field identifies what kind of content resulted from the action, using a term from the IPTC digital source type vocabulary or one of the C2PA-specific values.

The C2PA specification requires that a digital source type accompany the c2pa.created action for every asset. Commonly used values are:

http://cv.iptc.org/newscodes/digitalsourcetype/trainedAlgorithmicMediaMedia produced by a generative model.
http://cv.iptc.org/newscodes/digitalsourcetype/digitalCaptureCaptured by a camera or other recording device.
http://cv.iptc.org/newscodes/digitalsourcetype/compositeWithTrainedAlgorithmicMediaA composite that includes generated elements.
http://c2pa.org/digitalsourcetype/emptyThe asset began as a new file with no digital content.

No digital source type is required with a c2pa.opened action.

SoftwareAgent
string

Default: ""

The tool that performed the action.

This field names the software that carried out the action, for example MyApp/1.0.

It answers a different question from the manifest's claim generator: the claim generator is whatever wrote the provenance data, while this field is whatever actually edited the asset. They are often, but not always, the same tool.

When
string

Default: ""

When the action took place.

This field holds the time the action was performed, as an RFC 3339 date and time.

The C2PA specification requires an explicit timezone or a trailing Z for UTC. When this field is left empty, no time is recorded for the action.

Note that this is a claimed time, asserted by whoever signed the manifest. It is not the same as a trusted time-stamp, which is obtained from a Time Stamping Authority and is what a validator relies on to establish when the signature actually existed.

Constructors

public C2PAAction();
                
Public C2PAAction()
                

C2PAAssertion Type

A single assertion recorded in a C2PA Manifest.

Remarks

This type represents one assertion: a labelled statement about the asset, stored in the manifest and covered by the claim signature.

Assertions are how a C2PA Manifest says anything at all. Some describe what was done to the asset, some describe who made it, and one, the content binding, ties the manifest to the asset bytes. Each carries a label defined by the C2PA specification and a payload whose shape that label determines.

The payload is exposed as raw data rather than parsed into typed fields, so that assertion types added to the standard after this component was built can still be read and written.

The following fields are available:

Fields

AssertionLabel
string

Default: ""

The assertion label.

This field holds the C2PA assertion label, which identifies what kind of statement the assertion makes and therefore how Data should be interpreted.

Examples are c2pa.actions.v2, c2pa.hash.data, stds.schema-org.CreativeWork, and stds.exif.

Data
string

Default: ""

The assertion payload.

This field holds the assertion's payload, encoded according to MediaType.

The payload is passed through verbatim in both directions. An application can therefore write assertion types the component has no built-in knowledge of, and read back ones added to the standard after the component was built.

DataB
byte []

Default: ""

The assertion payload.

This field holds the assertion's payload, encoded according to MediaType.

The payload is passed through verbatim in both directions. An application can therefore write assertion types the component has no built-in knowledge of, and read back ones added to the standard after the component was built.

MediaType
string

Default: "application/cbor"

The media type of the assertion payload.

This field holds the media type of Data, normally application/cbor or application/json.

The C2PA specification requires that assertions it defines be serialized as CBOR, so application/cbor is the default.

Constructors

public C2PAAssertion();
                
Public C2PAAssertion()
                

C2PAIngredient Type

An asset that went into the one being described.

Remarks

This type represents an ingredient: another asset that was used to produce this one, together with the relationship between them.

Ingredients are what turn individual manifests into a provenance chain. When an editor opens a photograph and places it into a composite, the composite's manifest records the photograph as an ingredient, carrying that photograph's own manifest with it. A consumer can then walk backwards through the chain to the original capture.

The following fields are available:

Fields

Format
string

Default: ""

The media type of the ingredient asset.

This field holds the media type of the asset that went into this one, for example image/jpeg, image/png or application/pdf. The component fills it in from the source asset when the ingredient is added.

InstanceId
string

Default: ""

The instance identifier of the ingredient asset.

This field holds the identifier of the exact version of the asset that went into this one, normally an XMP instance identifier such as xmp:iid:....

When the ingredient carried a C2PA Manifest of its own, the component fills this in from that Manifest's claim, so the reference names the precise version that was used rather than the document in general.

Version 2 of the ingredient assertion also carried a document identifier. Version 3, which this component writes, removed it, so there is no corresponding field.

ManifestLabel
string

Default: ""

The label of the ingredient's own C2PA Manifest.

This field identifies the manifest that describes the ingredient, when the ingredient carried one. It is the urn:c2pa label of that manifest within the same manifest store.

An empty value means the ingredient arrived without provenance data of its own.

Relationship
string

Default: "componentOf"

How the ingredient relates to the asset.

This field describes the ingredient's role. The C2PA specification defines the following values:

parentOfThe asset is a derivative of this ingredient. There is at most one parent.
componentOfThe ingredient was placed into the asset alongside other content.
inputToThe ingredient was consumed as input, for example as a prompt or a training input, without appearing in the result.

The default value is componentOf.

Title
string

Default: ""

A human-readable name for the ingredient.

This field holds a title for the ingredient asset, typically its filename, so a consumer can present the provenance chain in terms a person recognises.

Constructors

public C2PAIngredient();
                
Public C2PAIngredient()
                

Certificate Type

This is the digital certificate being used.

Remarks

This type describes the current digital certificate. The certificate may be a public or private key. The fields are used to identify or select certificates.

The following fields are available:

Fields

EffectiveDate
string (read-only)

Default: ""

The date on which this certificate becomes valid. Before this date, it is not valid. The date is localized to the system's time zone. The following example illustrates the format of an encoded date:

23-Jan-2000 15:00:00.

ExpirationDate
string (read-only)

Default: ""

The date on which the certificate expires. After this date, the certificate will no longer be valid. The date is localized to the system's time zone. The following example illustrates the format of an encoded date:

23-Jan-2001 15:00:00.

ExtendedKeyUsage
string (read-only)

Default: ""

A comma-delimited list of extended key usage identifiers. These are the same as ASN.1 object identifiers (OIDs).

Fingerprint
string (read-only)

Default: ""

The hex-encoded, 16-byte MD5 fingerprint of the certificate. This property is primarily used for keys which do not have a corresponding X.509 public certificate, such as PEM keys that only contain a private key. It is commonly used for SSH keys.

The following example illustrates the format: bc:2a:72:af:fe:58:17:43:7a:5f:ba:5a:7c:90:f7:02

FingerprintSHA1
string (read-only)

Default: ""

The hex-encoded, 20-byte SHA-1 fingerprint of the certificate. This property is primarily used for keys which do not have a corresponding X.509 public certificate, such as PEM keys that only contain a private key. It is commonly used for SSH keys.

The following example illustrates the format: 30:7b:fa:38:65:83:ff:da:b4:4e:07:3f:17:b8:a4:ed:80:be:ff:84

FingerprintSHA256
string (read-only)

Default: ""

The hex-encoded, 32-byte SHA-256 fingerprint of the certificate. This property is primarily used for keys which do not have a corresponding X.509 public certificate, such as PEM keys that only contain a private key. It is commonly used for SSH keys.

The following example illustrates the format: 6a:80:5c:33:a9:43:ea:b0:96:12:8a:64:96:30:ef:4a:8a:96:86:ce:f4:c7:be:10:24:8e:2b:60:9e:f3:59:53

Issuer
string (read-only)

Default: ""

The issuer of the certificate. This field contains a string representation of the name of the issuing authority for the certificate.

PrivateKey
string (read-only)

Default: ""

The private key of the certificate (if available). The key is provided as PEM/Base64-encoded data.

NOTE: The PrivateKey may be available but not exportable. In this case, PrivateKey returns an empty string.

PrivateKeyAvailable
bool (read-only)

Default: false

Whether a PrivateKey is available for the selected certificate. If PrivateKeyAvailable is True, the certificate may be used for authentication purposes (e.g., server authentication).

PrivateKeyContainer
string (read-only)

Default: ""

The name of the PrivateKey container for the certificate (if available). This functionality is available only on Windows platforms.

PublicKey
string (read-only)

Default: ""

The public key of the certificate. The key is provided as PEM/Base64-encoded data.

PublicKeyAlgorithm
string (read-only)

Default: ""

The textual description of the certificate's public key algorithm. The property contains either the name of the algorithm (e.g., "RSA" or "RSA_DH") or an object identifier (OID) string representing the algorithm.

PublicKeyLength
int (read-only)

Default: 0

The length of the certificate's public key (in bits). Common values are 512, 1024, and 2048.

SerialNumber
string (read-only)

Default: ""

The serial number of the certificate encoded as a string. The number is encoded as a series of hexadecimal digits, with each pair representing a byte of the serial number.

SignatureAlgorithm
string (read-only)

Default: ""

The text description of the certificate's signature algorithm. The property contains either the name of the algorithm (e.g., "RSA" or "RSA_MD5RSA") or an object identifier (OID) string representing the algorithm.

Store
string

Default: "MY"

The name of the certificate store for the client certificate.

The StoreType field denotes the type of the certificate store specified by Store. If the store is password-protected, specify the password in StorePassword.

Store is used in conjunction with the Subject field to specify client certificates. If Store has a value, and Subject or Encoded is set, a search for a certificate is initiated. Please see the Subject field for details.

Designations of certificate stores are platform dependent.

The following designations are the most common User and Machine certificate stores in Windows:

MYA certificate store holding personal certificates with their associated private keys.
CACertifying authority certificates.
ROOTRoot certificates.

When the certificate store type is cstPFXFile, this property must be set to the name of the file. When the type is cstPFXBlob, the property must be set to the binary contents of a PFX file (i.e., PKCS#12 certificate store).

StoreB
byte []

Default: "MY"

The name of the certificate store for the client certificate.

The StoreType field denotes the type of the certificate store specified by Store. If the store is password-protected, specify the password in StorePassword.

Store is used in conjunction with the Subject field to specify client certificates. If Store has a value, and Subject or Encoded is set, a search for a certificate is initiated. Please see the Subject field for details.

Designations of certificate stores are platform dependent.

The following designations are the most common User and Machine certificate stores in Windows:

MYA certificate store holding personal certificates with their associated private keys.
CACertifying authority certificates.
ROOTRoot certificates.

When the certificate store type is cstPFXFile, this property must be set to the name of the file. When the type is cstPFXBlob, the property must be set to the binary contents of a PFX file (i.e., PKCS#12 certificate store).

StorePassword
string

Default: ""

If the type of certificate store requires a password, this field is used to specify the password needed to open the certificate store.

StoreType
CertStoreTypes

Default: 0

The type of certificate store for this certificate.

The component supports both public and private keys in a variety of formats. When the cstAuto value is used, the component will automatically determine the type. This field can take one of the following values:

0 (cstUser - default)For Windows, this specifies that the certificate store is a certificate store owned by the current user.

NOTE: This store type is not available in Java.

1 (cstMachine)For Windows, this specifies that the certificate store is a machine store.

NOTE: This store type is not available in Java.

2 (cstPFXFile)The certificate store is the name of a PFX (PKCS#12) file containing certificates.
3 (cstPFXBlob)The certificate store is a string (binary or Base64-encoded) representing a certificate store in PFX (PKCS#12) format.
4 (cstJKSFile)The certificate store is the name of a Java Key Store (JKS) file containing certificates.

NOTE: This store type is only available in Java.

5 (cstJKSBlob)The certificate store is a string (binary or Base64-encoded) representing a certificate store in Java Key Store (JKS) format.

NOTE: This store type is only available in Java.

6 (cstPEMKeyFile)The certificate store is the name of a PEM-encoded file that contains a private key and an optional certificate.
7 (cstPEMKeyBlob)The certificate store is a string (binary or Base64-encoded) that contains a private key and an optional certificate.
8 (cstPublicKeyFile)The certificate store is the name of a file that contains a PEM- or DER-encoded public key certificate.
9 (cstPublicKeyBlob)The certificate store is a string (binary or Base64-encoded) that contains a PEM- or DER-encoded public key certificate.
10 (cstSSHPublicKeyBlob)The certificate store is a string (binary or Base64-encoded) that contains an SSH-style public key.
11 (cstP7BFile)The certificate store is the name of a PKCS#7 file containing certificates.
12 (cstP7BBlob)The certificate store is a string (binary) representing a certificate store in PKCS#7 format.
13 (cstSSHPublicKeyFile)The certificate store is the name of a file that contains an SSH-style public key.
14 (cstPPKFile)The certificate store is the name of a file that contains a PPK (PuTTY Private Key).
15 (cstPPKBlob)The certificate store is a string (binary) that contains a PPK (PuTTY Private Key).
16 (cstXMLFile)The certificate store is the name of a file that contains a certificate in XML format.
17 (cstXMLBlob)The certificate store is a string that contains a certificate in XML format.
18 (cstJWKFile)The certificate store is the name of a file that contains a JWK (JSON Web Key).
19 (cstJWKBlob)The certificate store is a string that contains a JWK (JSON Web Key).
21 (cstBCFKSFile)The certificate store is the name of a file that contains a BCFKS (Bouncy Castle FIPS Key Store).

NOTE: This store type is only available in Java and .NET.

22 (cstBCFKSBlob)The certificate store is a string (binary or Base64-encoded) representing a certificate store in BCFKS (Bouncy Castle FIPS Key Store) format.

NOTE: This store type is only available in Java and .NET.

23 (cstPKCS11)The certificate is present on a physical security key accessible via a PKCS#11 interface.

To use a security key, create a new Certificate object and pass cstPKCS11 as the StoreType, the full path of the PKCS#11 DLL as the Store, and the PIN as the StorePassword.

Code Example. SSH Authentication with Security Key (without CertMgr): sftp.SSHCert = new Certificate(CertStoreTypes.cstPKCS11, @"C:\Program Files\OpenSC Project\OpenSC\pkcs11\opensc-pkcs11.dll", "123456", // PIN "CN=cert_subject"); sftp.SSHUser = "test"; sftp.SSHLogon("myhost", 22);

Alternatively, collect the necessary data using the CertMgr component by calling the ListStoreCertificates method after setting the corresponding properties accordingly. The certificate information returned in the CertList event's CertEncoded parameter may be saved for later use.

When using a certificate obtained with this approach, pass the previously saved security key information as the Store and set StorePassword to the PIN.

Code Example. SSH Authentication with Security Key (with CertMgr): certmgr.CertStoreType = CertStoreTypes.cstPKCS11; certmgr.OnCertList += (s, e) => { secKeyBlob = e.CertEncoded; }; certmgr.CertStore = @"C:\Program Files\OpenSC Project\OpenSC\pkcs11\opensc-pkcs11.dll"; certmgr.CertStorePassword = "123456"; // PIN certmgr.ListStoreCertificates(); sftp.SSHCert = new Certificate(CertStoreTypes.cstPKCS11, secKeyBlob, "123456", "*"); sftp.SSHUser = "test"; sftp.SSHLogon("myhost", 22);

99 (cstAuto)The store type is automatically detected from the input data. This setting may be used with both public and private keys and can detect any of the supported formats automatically.

SubjectAltNames
string (read-only)

Default: ""

Comma-separated lists of alternative subject names for the certificate.

ThumbprintMD5
string (read-only)

Default: ""

The MD5 hash of the certificate. It is primarily used for X.509 certificates. If the hash does not already exist, it is automatically computed.

ThumbprintSHA1
string (read-only)

Default: ""

The SHA-1 hash of the certificate. It is primarily used for X.509 certificates. If the hash does not already exist, it is automatically computed.

ThumbprintSHA256
string (read-only)

Default: ""

The SHA-256 hash of the certificate. It is primarily used for X.509 certificates. If the hash does not already exist, it is automatically computed.

Usage
string (read-only)

Default: ""

The text description of UsageFlags.

This value will be one or more of the following strings and will be separated by commas:

  • Digital Signature
  • Non-Repudiation
  • Key Encipherment
  • Data Encipherment
  • Key Agreement
  • Certificate Signing
  • CRL Signing
  • Encipher Only

If the provider is OpenSSL, the value is a comma-separated list of X.509 certificate extension names.

UsageFlags
int (read-only)

Default: 0

The flags that show intended use for the certificate. The value of UsageFlags is a combination of the following flags:

0x80Digital Signature
0x40Non-Repudiation
0x20Key Encipherment
0x10Data Encipherment
0x08Key Agreement
0x04Certificate Signing
0x02CRL Signing
0x01Encipher Only

Please see the Usage field for a text representation of UsageFlags.

This functionality currently is not available when the provider is OpenSSL.

Version
string (read-only)

Default: ""

The certificate's version number. The possible values are the strings "V1", "V2", and "V3".

Subject
string

Default: ""

The subject of the certificate used for client authentication.

This field will be populated with the full subject of the loaded certificate. When loading a certificate, the subject is used to locate the certificate in the store.

If an exact match is not found, the store is searched for subjects containing the value of the property.

If a match is still not found, the property is set to an empty string, and no certificate is selected.

The special value "*" picks a random certificate in the certificate store.

The certificate subject is a comma-separated list of distinguished name fields and values. For instance, "CN=www.server.com, OU=test, C=US, E=example@email.com". Common fields and their meanings are as follows:

FieldMeaning
CNCommon Name. This is commonly a hostname like www.server.com.
OOrganization
OUOrganizational Unit
LLocality
SState
CCountry
EEmail Address

If a field value contains a comma, it must be quoted.

Encoded
string

Default: ""

The certificate (PEM/Base64 encoded). This field is used to assign a specific certificate. The Store and Subject fields also may be used to specify a certificate.

When Encoded is set, a search is initiated in the current Store for the private key of the certificate. If the key is found, Subject is updated to reflect the full subject of the selected certificate; otherwise, Subject is set to an empty string.

EncodedB
byte []

Default: ""

The certificate (PEM/Base64 encoded). This field is used to assign a specific certificate. The Store and Subject fields also may be used to specify a certificate.

When Encoded is set, a search is initiated in the current Store for the private key of the certificate. If the key is found, Subject is updated to reflect the full subject of the selected certificate; otherwise, Subject is set to an empty string.

Constructors

public Certificate();
                
Public Certificate()
                

Creates a instance whose properties can be set.

public Certificate(string certificateFile);
                
Public Certificate(ByVal CertificateFile As String)
                

Opens CertificateFile and reads out the contents as an X.509 public key.

public Certificate(byte[] encoded);
                
Public Certificate(ByVal Encoded As Byte())
                

Parses Encoded as an X.509 public key.

public Certificate(CertStoreTypes storeType, string store, string storePassword, string subject);
                
Public Certificate(ByVal StoreType As CertStoreTypes, ByVal Store As String, ByVal StorePassword As String, ByVal Subject As String)
                

StoreType identifies the type of certificate store to use. See for descriptions of the different certificate stores. Store is a file containing the certificate store. StorePassword is the password used to protect the store.

After the store has been successfully opened, the component will attempt to find the certificate identified by Subject . This can be either a complete or a substring match of the X.509 certificate's subject Distinguished Name (DN). The Subject parameter can also take an MD5, SHA-1, or SHA-256 thumbprint of the certificate to load in a "Thumbprint=value" format.

public Certificate(CertStoreTypes storeType, string store, string storePassword, string subject, string configurationString);
                
Public Certificate(ByVal StoreType As CertStoreTypes, ByVal Store As String, ByVal StorePassword As String, ByVal Subject As String, ByVal ConfigurationString As String)
                

StoreType identifies the type of certificate store to use. See for descriptions of the different certificate stores. Store is a file containing the certificate store. StorePassword is the password used to protect the store.

ConfigurationString is a newline-separated list of name-value pairs that may be used to modify the default behavior. Possible values include "PersistPFXKey", which shows whether or not the PFX key is persisted after performing operations with the private key. This correlates to the PKCS12_NO_PERSIST_KEY CryptoAPI option. The default value is True (the key is persisted). "Thumbprint" - an MD5, SHA-1, or SHA-256 thumbprint of the certificate to load. When specified, this value is used to select the certificate in the store. This is applicable to the cstUser , cstMachine , cstPublicKeyFile , and cstPFXFile store types. "UseInternalSecurityAPI" shows whether the platform (default) or the internal security API is used when performing certificate-related operations.

After the store has been successfully opened, the component will attempt to find the certificate identified by Subject . This can be either a complete or a substring match of the X.509 certificate's subject Distinguished Name (DN). The Subject parameter can also take an MD5, SHA-1, or SHA-256 thumbprint of the certificate to load in a "Thumbprint=value" format.

public Certificate(CertStoreTypes storeType, string store, string storePassword, byte[] encoded);
                
Public Certificate(ByVal StoreType As CertStoreTypes, ByVal Store As String, ByVal StorePassword As String, ByVal Encoded As Byte())
                

StoreType identifies the type of certificate store to use. See for descriptions of the different certificate stores. Store is a file containing the certificate store. StorePassword is the password used to protect the store.

After the store has been successfully opened, the component will load Encoded as an X.509 certificate and search the opened store for a corresponding private key.

public Certificate(CertStoreTypes storeType, byte[] store, string storePassword, string subject);
                
Public Certificate(ByVal StoreType As CertStoreTypes, ByVal Store As Byte(), ByVal StorePassword As String, ByVal Subject As String)
                

StoreType identifies the type of certificate store to use. See for descriptions of the different certificate stores. Store is a byte array containing the certificate data. StorePassword is the password used to protect the store.

After the store has been successfully opened, the component will attempt to find the certificate identified by Subject . This can be either a complete or a substring match of the X.509 certificate's subject Distinguished Name (DN). The Subject parameter can also take an MD5, SHA-1, or SHA-256 thumbprint of the certificate to load in a "Thumbprint=value" format.

public Certificate(CertStoreTypes storeType, byte[] store, string storePassword, string subject, string configurationString);
                
Public Certificate(ByVal StoreType As CertStoreTypes, ByVal Store As Byte(), ByVal StorePassword As String, ByVal Subject As String, ByVal ConfigurationString As String)
                

StoreType identifies the type of certificate store to use. See for descriptions of the different certificate stores. Store is a byte array containing the certificate data. StorePassword is the password used to protect the store.

After the store has been successfully opened, the component will attempt to find the certificate identified by Subject . This can be either a complete or a substring match of the X.509 certificate's subject Distinguished Name (DN). The Subject parameter can also take an MD5, SHA-1, or SHA-256 thumbprint of the certificate to load in a "Thumbprint=value" format.

public Certificate(CertStoreTypes storeType, byte[] store, string storePassword, byte[] encoded);
                
Public Certificate(ByVal StoreType As CertStoreTypes, ByVal Store As Byte(), ByVal StorePassword As String, ByVal Encoded As Byte())
                

StoreType identifies the type of certificate store to use. See for descriptions of the different certificate stores. Store is a byte array containing the certificate data. StorePassword is the password used to protect the store.

After the store has been successfully opened, the component will load Encoded as an X.509 certificate and search the opened store for a corresponding private key.

Config Settings (C2PASigner Component)

The component accepts one or more of the following configuration settings. Configuration settings are similar in functionality to properties, but they are rarely used. In order to avoid "polluting" the property namespace of the component, access to these internal properties is provided through the Config method.

C2PASigner Config Settings

HashAlgorithm:   The hash algorithm used for the content binding.

This setting specifies the algorithm used to hash the asset for the content binding assertion, and to hash the assertions referenced by the claim. Possible values are sha256 (the default), sha384, and sha512.

IncludeThumbnail:   Whether a claim thumbnail is embedded in the manifest.

This setting controls whether a thumbnail of the asset is embedded in the C2PA Manifest. A thumbnail lets a consumer show what the asset looked like when it was signed, at the cost of a larger manifest. The default value is False.

InstanceId:   The instance identifier recorded in the claim.

This setting specifies the instance identifier written into the claim, which uniquely identifies this particular version of the asset. When it is left empty, the component generates one. It must be set before calling Sign.

LogLevel:   The level of detail logged through the Log event.

This setting controls the verbosity of the Log event. Possible values are 0 (None), 1 (Info, the default), 2 (Verbose), and 3 (Debug).

SignaturePadding:   The number of bytes reserved for the claim signature.

This setting specifies how much room is set aside for the signature while the manifest is being assembled.

Signing happens in two passes: the manifest is written once at a fixed size to establish the byte offsets the content binding needs, then rewritten with the real signature in the space reserved for it. If the signature does not fit, the whole operation repeats with a larger reservation, which costs time.

The default is 25600 bytes, the size the C2PA specification recommends. Lower it when the signing certificate chain is small and manifest size matters; raise it when signing with a long chain, to avoid the retry.

Base Config Settings

BuildInfo:   Information about the product's build.

When queried, this setting will return a string containing information about the product's build.

GUIAvailable:   Whether or not a message loop is available for processing events.

In a GUI-based application, long-running blocking operations may cause the application to stop responding to input until the operation returns. The component will attempt to discover whether or not the application has a message loop and, if one is discovered, it will process events in that message loop during any such blocking operation.

In some non-GUI applications, an invalid message loop may be discovered that will result in errant behavior. In these cases, setting GUIAvailable to false will ensure that the component does not attempt to process external events.

LicenseInfo:   Information about the current license.

When queried, this setting will return a string containing information about the license this instance of a component is using. It will return the following information:

  • Product: The product the license is for.
  • Product Key: The key the license was generated from.
  • License Source: Where the license was found (e.g., RuntimeLicense, License File).
  • License Type: The type of license installed (e.g., Royalty Free, Single Server).
  • Last Valid Build: The last valid build number for which the license will work.
MaskSensitiveData:   Whether sensitive data is masked in log messages.

In certain circumstances it may be beneficial to mask sensitive data, like passwords, in log messages. Set this to true to mask sensitive data. The default is true.

UseInternalSecurityAPI:   Whether or not to use the system security libraries or an internal implementation.

When set to false, the component will use the system security libraries by default to perform cryptographic functions where applicable. In this case, calls to unmanaged code will be made. In certain environments, this is not desirable. To use a completely managed security implementation, set this setting to true.

Setting this configuration setting to true tells the component to use the internal implementation instead of using the system security libraries.

On Windows, this setting is set to false by default. On Linux/macOS, this setting is set to true by default.

NOTE: This setting is static. The value set is applicable to all components used in the application.

When this value is set, the product's system dynamic link library (DLL) is no longer required as a reference, as all unmanaged code is stored in that file.

Trappable Errors (C2PASigner Component)

C2PASigner Errors

101   Unsupported algorithm. See SignatureAlgorithm for the permitted signature algorithms, and the HashAlgorithm configuration setting for the permitted hash algorithms.
102   The signing certificate is missing or has no associated private key.
103   Unsupported asset format. The asset is not one of the formats the component can embed a C2PA Manifest into.
105   The claim signature could not be fitted into the reserved space. Raise the SignaturePadding configuration setting; the usual cause is an unusually large certificate chain.
106   A required parameter is missing or invalid.
107   The Manifest could not be laid out. This indicates a defect in the component rather than a problem with the input.
108   The Time Stamping Authority named by TSAURL did not return a time-stamp token. The Manifest is not written, so that a signature is never produced without the time-stamp that was asked for.
109   The output file already exists and Overwrite is False.
304   Cannot write file.
305   Cannot read file.