diff options
Diffstat (limited to 'connector/src/main/java/at/asitplus/eidas/specific/connector/verification/MetadataSignatureVerificationFilter.java')
-rw-r--r-- | connector/src/main/java/at/asitplus/eidas/specific/connector/verification/MetadataSignatureVerificationFilter.java | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/connector/src/main/java/at/asitplus/eidas/specific/connector/verification/MetadataSignatureVerificationFilter.java b/connector/src/main/java/at/asitplus/eidas/specific/connector/verification/MetadataSignatureVerificationFilter.java index bf10de82..eeaea135 100644 --- a/connector/src/main/java/at/asitplus/eidas/specific/connector/verification/MetadataSignatureVerificationFilter.java +++ b/connector/src/main/java/at/asitplus/eidas/specific/connector/verification/MetadataSignatureVerificationFilter.java @@ -43,10 +43,10 @@ import org.opensaml.xml.validation.ValidationException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import at.gv.egiz.eaaf.core.exceptions.EAAFException; +import at.gv.egiz.eaaf.core.exceptions.EaafException; import at.gv.egiz.eaaf.core.impl.utils.KeyStoreUtils; -import at.gv.egiz.eaaf.modules.pvp2.exception.PVP2MetadataException; -import at.gv.egiz.eaaf.modules.pvp2.idp.exception.SAMLRequestNotSignedException; +import at.gv.egiz.eaaf.modules.pvp2.exception.Pvp2MetadataException; +import at.gv.egiz.eaaf.modules.pvp2.idp.exception.SamlRequestNotSignedException; import at.gv.egiz.eaaf.modules.pvp2.impl.validation.metadata.AbstractMetadataSignatureFilter; public class MetadataSignatureVerificationFilter extends AbstractMetadataSignatureFilter{ @@ -56,7 +56,7 @@ public class MetadataSignatureVerificationFilter extends AbstractMetadataSignatu private List<BasicX509Credential> trustedCredential = new ArrayList<BasicX509Credential>(); public MetadataSignatureVerificationFilter(String trustStorePath, String trustStorePassword, String metadataURL) - throws PVP2MetadataException { + throws Pvp2MetadataException { this.metadataURL = metadataURL; log.trace("Initialize metadata signature-verification filter with truststore: " + trustStorePath + " ... "); @@ -84,12 +84,12 @@ public class MetadataSignatureVerificationFilter extends AbstractMetadataSignatu } else - throw new PVP2MetadataException("pvp2.26", + throw new Pvp2MetadataException("pvp2.26", new Object[] {"Can not open trustStore: " + trustStorePath + " for metadata: " + metadataURL}); } catch (KeyStoreException | IOException e) { log.warn("Can not open trustStore: " + trustStorePath + " for metadata: " + metadataURL + " Reason: " + e.getMessage(), e); - throw new PVP2MetadataException("pvp2.26", + throw new Pvp2MetadataException("pvp2.26", new Object[] {"Can not open trustStore: " + trustStorePath + " for metadata"}, e); } @@ -99,36 +99,36 @@ public class MetadataSignatureVerificationFilter extends AbstractMetadataSignatu @Override - protected void verify(EntityDescriptor desc) throws PVP2MetadataException { + protected void verify(EntityDescriptor desc) throws Pvp2MetadataException { try { internalVerify(desc); - } catch (EAAFException e) { + } catch (EaafException e) { log.info("Metadata verification FAILED for: " + metadataURL + " Reason: " +e.getMessage()); - throw new PVP2MetadataException("pvp2.26", + throw new Pvp2MetadataException("pvp2.26", new Object[] {"Metadata verification FAILED for: " + metadataURL + " Reason: " +e.getMessage()}, e); } } @Override - protected void verify(EntitiesDescriptor desc) throws PVP2MetadataException { - throw new PVP2MetadataException("pvp2.26", + protected void verify(EntitiesDescriptor desc) throws Pvp2MetadataException { + throw new Pvp2MetadataException("pvp2.26", new Object[] {"EntitiesDescritors are NOT supported"}); } @Override - protected void verify(EntityDescriptor entity, EntitiesDescriptor desc) throws PVP2MetadataException { - throw new PVP2MetadataException("pvp2.26", + protected void verify(EntityDescriptor entity, EntitiesDescriptor desc) throws Pvp2MetadataException { + throw new Pvp2MetadataException("pvp2.26", new Object[] {"EntitiesDescritors are NOT supported"}); } private void internalVerify(SignableSAMLObject signedElement) - throws EAAFException { + throws EaafException { if (signedElement.getSignature() == null) { - throw new SAMLRequestNotSignedException(); + throw new SamlRequestNotSignedException(); } try { @@ -136,7 +136,7 @@ public class MetadataSignatureVerificationFilter extends AbstractMetadataSignatu sigValidator.validate(signedElement.getSignature()); } catch (ValidationException e) { log.error("Failed to validate Signature", e); - throw new SAMLRequestNotSignedException(e); + throw new SamlRequestNotSignedException(e); } boolean isTrusted = false; @@ -155,7 +155,7 @@ public class MetadataSignatureVerificationFilter extends AbstractMetadataSignatu if (!isTrusted) { log.warn("PVP2 metadata: " + metadataURL + " are NOT trusted!"); - throw new SAMLRequestNotSignedException(); + throw new SamlRequestNotSignedException(); } |