Package com.bfo.box

Class C2PAClaim


public class C2PAClaim extends CborContainerBox
The claim box used to stored the claim in a manifest box. Every manifest has exactly one claim.
Since:
5
See Also:
  • Method Details

    • setFormat

      public void setFormat(String format)
      Set the format - this must be set before signing
      Parameters:
      format - the format, eg "application/pdf"
    • getFormat

      public String getFormat()
      Return the format, as loaded or set by setFormat(java.lang.String)
      Returns:
      the format
    • setInstanceID

      public void setInstanceID(String id)
      Set the instance ID - this should be a UUID and must be set before signing
      Parameters:
      id - the id
    • getInstanceID

      public String getInstanceID()
      Return the instance ID, as loaded or set by setInstanceID(java.lang.String)
      Returns:
      the instanace ID
    • setHashAlgorithm

      public void setHashAlgorithm(String alg)
      Set the hash algorithm used to hash any assertions. If this is not set before signing, it will be set to SHA256
      Parameters:
      alg - the hash algorithm, which should be a valid Java Hash algorithm name.
    • getHashAlgorithm

      public String getHashAlgorithm()
      Return the hash algorithm used to hash any assertions, as loaded or set by setHashAlgorithm(java.lang.String).
      Returns:
      the hash algorithm
    • getAssertions

      public List<C2PA_Assertion> getAssertions()
      Return the list of assertions that will be part of this claim. Although this list is live can be edited, if it is blank whan the manifest is signed, it will be set to the same value as C2PAManifest.getAssertions(). All assertions added must be present in that list; all assertions that are returned should be too, and if not the value null will be returned for that entry and the entry cleared when the manifest is signed.
      Returns:
      a live list of all the assertions that will be part of this claim.
    • setGenerator

      public void setGenerator(String generator, Json properties)
      Set the "claim generator", a user-agent string identifying the tooling that created this C2PA claim. If not set before signing, a default value will be used as this is a mandatory field.
      Parameters:
      generator - the claim_generator id
      properties - an optional Json that will be stored as claim_generator_info in the C2PA object. This is supposed to be mandatory, but is missing from several official examples - we accept null.
    • getGenerator

      public String getGenerator()
      Return the "claim_generator" field, as loaded or set by setGenerator(java.lang.String, com.bfo.json.Json)
      Returns:
      the claim_generator