Class AsicSContainerValidationUtils

java.lang.Object
org.digidoc4j.impl.asic.asics.AsicSContainerValidationUtils

public final class AsicSContainerValidationUtils extends Object
Utility class for validating ASiC-S container contents.
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    Validates the contents of the specified AsicParseResult, throwing IllegalContainerContentException if any of the following rules are violated: Mimetype must be "application/vnd.etsi.asic-s+zip". Signatures and timestamps must not be present simultaneously. No CAdES signature entries "META-INF/*signature*.p7s" must be present (comparison of "signature" and "p7s" is case-insensitive). No evidence record entries "META-INF/evidencerecord.ers" or "META-INF/evidencerecord.xml" must be present(comparison of "evicencerecord", "ers" and "xml" is case-insensitive). In case any signatures are present: Exactly one data file must be present. No CAdES timestamp token entries "META-INF/*timestamp*.tst" must be present (comparison of "timestamp" and "tst" is case-insensitive). In case any timestamp tokens are present: Exactly one data file must be present. No XAdES signature entries "META-INF/*signatures*.xml" must be present (comparison of "signatures" and "xml" is case-insensitive). In case no signatures nor timestamps are present: No more than one data file can be present.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • validateContainerParseResult

      public static void validateContainerParseResult(AsicParseResult parseResult)
      Validates the contents of the specified AsicParseResult, throwing IllegalContainerContentException if any of the following rules are violated:
      • Mimetype must be "application/vnd.etsi.asic-s+zip".
      • Signatures and timestamps must not be present simultaneously.
      • No CAdES signature entries "META-INF/*signature*.p7s" must be present (comparison of "signature" and "p7s" is case-insensitive).
      • No evidence record entries "META-INF/evidencerecord.ers" or "META-INF/evidencerecord.xml" must be present(comparison of "evicencerecord", "ers" and "xml" is case-insensitive).
      • In case any signatures are present:
        • Exactly one data file must be present.
        • No CAdES timestamp token entries "META-INF/*timestamp*.tst" must be present (comparison of "timestamp" and "tst" is case-insensitive).
      • In case any timestamp tokens are present:
        • Exactly one data file must be present.
        • No XAdES signature entries "META-INF/*signatures*.xml" must be present (comparison of "signatures" and "xml" is case-insensitive).
      • In case no signatures nor timestamps are present:
        • No more than one data file can be present.
      Parameters:
      parseResult - ASiC parse result to validate
      Throws:
      IllegalContainerContentException - if validation rules are violated