package at.gv.egiz.eaaf.modules.sigverify.moasig.api; import java.util.Date; import java.util.List; import java.util.Map; import at.gv.egiz.eaaf.modules.sigverify.moasig.api.data.ICmsSignatureVerificationResponse; import at.gv.egiz.eaaf.modules.sigverify.moasig.api.data.IPdfSignatureVerificationResponse; import at.gv.egiz.eaaf.modules.sigverify.moasig.api.data.IXmlSignatureVerificationResponse; import at.gv.egiz.eaaf.modules.sigverify.moasig.exceptions.MoaSigServiceException; public interface ISignatureVerificationService { /** * Verify a CAdES or CMS signature.
*
* This method only validates the first CMS or CAdES signature if more than * one signature exists * * @param signature Enveloped CMS or CAdES signature * @param trustProfileID Id of the Trust-Profile from MOA-Sig configuration * @return {@link ICmsSignatureVerificationResponse}, or null if no * signature was found * @throws MoaSigServiceException on signatue-verification error */ ICmsSignatureVerificationResponse verifyCmsSignature(byte[] signature, String trustProfileID) throws MoaSigServiceException; /** * Verify a CAdES or CMS signature.
*
* This method only validates the first CMS or CAdES signature if more than * one signature exists * * @param signature Enveloped CMS or CAdES signature * @param trustProfileID Id of the Trust-Profile from MOA-Sig configuration * @param performExtendedValidation If true than MOA-Sig perform extended validation on this signature. * @return {@link ICmsSignatureVerificationResponse}, or null if no * signature was found * @throws MoaSigServiceException on signatue-verification error */ ICmsSignatureVerificationResponse verifyCmsSignature(byte[] signature, String trustProfileID, boolean performExtendedValidation) throws MoaSigServiceException; /** * Verify a PAdES or PDF signature. * * @param pdf PDF document * @param trustProfileID Id of the Trust-Profile from MOA-Sig configuration * @return {@link List} of {@link IPdfSignatureVerificationResponse}, or null if no * signature was found * @throws MoaSigServiceException on signatue-verification error */ List verifyPdfSignature(byte[] pdf, String trustProfileID) throws MoaSigServiceException; /** * Verify a PAdES or PDF signature. * * @param pdf PDF document * @param trustProfileID Id of the Trust-Profile from MOA-Sig configuration * @param performExtendedValidation If true than MOA-Sig perform extended validation on this signature. * @return {@link List} of {@link IPdfSignatureVerificationResponse}, or null if no * signature was found * @throws MoaSigServiceException on signatue-verification error */ List verifyPdfSignature(byte[] pdf, String trustProfileID, boolean performExtendedValidation) throws MoaSigServiceException; /** * Verify a XML or XAdES signature.
*
* This method only validates the first XML or XAdES signature if more than * one signature exists * * @param signature Serialized XML or XAdES signature * @param trustProfileID Id of the Trust-Profile from MOA-Sig configuration * @return @link {@link IXmlSignatureVerificationResponse}, or null if no * signature was found * @throws MoaSigServiceException on signatue-verification error */ IXmlSignatureVerificationResponse verifyXmlSignature(byte[] signature, String trustProfileID) throws MoaSigServiceException; /** * Verify a XML or XAdES signature.
*
* This method only validates the first XML or XAdES signature if more than * one signature exists * * @param signature Serialized XML or XAdES signature * @param trustProfileID Id of the Trust-Profile from MOA-Sig configuration * @param signingDate Signature timestamp * @return @link {@link IXmlSignatureVerificationResponse}, or null if no * signature was found * @throws MoaSigServiceException on signatue-verification error */ IXmlSignatureVerificationResponse verifyXmlSignature(byte[] signature, String trustProfileID, Date signingDate) throws MoaSigServiceException; /** * Verify a XML or XAdES signature.
*
* This method only validates the first XML or XAdES signature if more than * one signature exists * * @param signature Serialized XML or XAdES signature * @param trustProfileID Id of the Trust-Profile from MOA-Sig * configuration * @param verifyTransformsInfoProfileID {@link List} of XML Transformations that * should be used for * signature-verification * @return @link {@link IXmlSignatureVerificationResponse}, or null if no * signature was found * @throws MoaSigServiceException on signatue-verification error */ IXmlSignatureVerificationResponse verifyXmlSignature(byte[] signature, String trustProfileID, List verifyTransformsInfoProfileID) throws MoaSigServiceException; /** * Verify a XML or XAdES signature.
*
* This method only validates the first XML or XAdES signature if more than * one signature exists * * @param signature Serialized XML or XAdES signature * @param trustProfileID Id of the Trust-Profile from MOA-Sig * configuration * @param signatureLocationXpath Xpath that points to location of Signature * element * @return @link {@link IXmlSignatureVerificationResponse}, or null if no * signature was found * @throws MoaSigServiceException on signatue-verification error */ IXmlSignatureVerificationResponse verifyXmlSignature(byte[] signature, String trustProfileID, String signatureLocationXpath) throws MoaSigServiceException; /** * Verify a XML or XAdES signature.
*
* This method only validates the first XML or XAdES signature if more than * one signature exists * * @param signature Serialized XML or XAdES signature * @param trustProfileID Id of the Trust-Profile from MOA-Sig * configuration * @param verifyTransformsInfoProfileID {@link List} of XML Transformations that * should be used for * signature-verification * @param signatureLocationXpath Xpath that points to location of * Signature element * @param signingDate Signature timestamp * @return @link {@link IXmlSignatureVerificationResponse}, or null if no * signature was found * @throws MoaSigServiceException on signatue-verification error */ IXmlSignatureVerificationResponse verifyXmlSignature(byte[] signature, String trustProfileID, List verifyTransformsInfoProfileID, String signatureLocationXpath, Date signingDate) throws MoaSigServiceException; /** * Verify a XML or XAdES signature.
*
* This method only validates the first XML or XAdES signature if more than * one signature exists * * @param signature Serialized XML or XAdES signature * @param trustProfileID Id of the Trust-Profile from MOA-Sig * configuration * @param verifyTransformsInfoProfileID {@link List} of XML Transformations that * should be used for * signature-verification * @param signatureLocationXpath Xpath that points to location of * Signature element * @param signingDate Signature timestamp * @param supplementContent Map that contains supplement profile content; keyed by references. Each entry * in this map becomes a Content/Base64Content child in the SupplementProfile * node. * @return @link {@link IXmlSignatureVerificationResponse}, or null if no * signature was found * @throws MoaSigServiceException on signatue-verification error */ IXmlSignatureVerificationResponse verifyXmlSignature(final byte[] signature, final String trustProfileID, final List verifyTransformsInfoProfileID, final String signatureLocationXpath, Date signingDate, final Map supplementContent) throws MoaSigServiceException; }