Package com.bfo.box

Class C2PA_AssertionIngredient

All Implemented Interfaces:
C2PA_Assertion

public class C2PA_AssertionIngredient extends CborContainerBox implements C2PA_Assertion
A C2PA Assertion for the "c2pa.ingredient" type
Since:
5
  • Constructor Details

    • C2PA_AssertionIngredient

      public C2PA_AssertionIngredient()
      Create a new assertion
    • C2PA_AssertionIngredient

      public C2PA_AssertionIngredient(String label, Json json)
      Create a new assertion
      Parameters:
      label - the label (will default to "c2pa.ingredient" if null)
      json - the Json to initialize the assertion with
  • Method Details

    • setTargetManifest

      public void setTargetManifest(String relationship, C2PAManifest manifest, List<C2PAStatus> status)
      Set this ingredient to refer to the specified manifest. The manifest must be already in the same store as this one.
      Parameters:
      relationship - should be "parentOf" or "componentOf"
      manifest - the manifest
      status - if not null, a list of status codes to be attached as validationStatus.
    • getTargetManifest

      public C2PAManifest getTargetManifest()
      If this ingredient has a c2pa_manifest value, return the target manifest, or null if it's not specified or can't be found
      Returns:
      the target manifest, or null
    • getValidationStatus

      public List<C2PAStatus> getValidationStatus()
      If this ingredient has a validationStatus value, return it as a list of C2PAStatus
      Returns:
      the list of validation status codes, or an empty list
    • relationship

      public String relationship()
      Return the specified relationship between this ingredient and the manifest it refers to
      Returns:
      one of "parentOf", "componentOf"
    • verify

      public List<C2PAStatus> verify()
      Description copied from interface: C2PA_Assertion
      Verify this assertion, returning a list of status codes describing why this assertion failed or an empty list if it succeeded. The default implementation succeeds, and returns an empty list.
      Specified by:
      verify in interface C2PA_Assertion
      Returns:
      a list of status codes, which may be empty on success