Package org.digidoc4j.impl.asic.asics
Class AsicSContainerValidationUtils
java.lang.Object
org.digidoc4j.impl.asic.asics.AsicSContainerValidationUtils
Utility class for validating ASiC-S container contents.
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidvalidateContainerParseResult(AsicParseResult parseResult) Validates the contents of the specifiedAsicParseResult, throwingIllegalContainerContentExceptionif 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.
-
Method Details
-
validateContainerParseResult
Validates the contents of the specifiedAsicParseResult, throwingIllegalContainerContentExceptionif 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
- Mimetype must be "
-