Thursday, March 29, 2018

How to validate SAML EntitiesDescriptor Signature with Apache Santuario

Leave a Comment

The aim is to validate a saml EntitiesDescriptor signature using a stux processor to ensure the amount of memory used is low.

I have been using the following code with an example from Apache Santuario without any luck.

Please can someone advise on how to use Apache Santuario with SAML Entity Descriptor files.

SignatureUtils can be found here

URL url = new URL("http://metadata.ukfederation.org.uk/ukfederation-metadata.xml");

// Validation List<QName> namesToSign = new ArrayList<QName>(); namesToSign.add(new QName("urn:oasis:names:tc:SAML:2.0:metadata", "EntitiesDescriptor"));  try (InputStream stream = url.openStream()) {   X509Certificate cert = getCertificate();   SignatureUtils.verifyUsingStAX(stream, namesToSign, cert); } 

0 Answers

If You Enjoyed This, Take 5 Seconds To Share It

0 comments:

Post a Comment