Search in sources :

Example 46 with Saml2Exception

use of org.springframework.security.saml2.Saml2Exception in project spring-security by spring-projects.

the class Saml2Utils method samlInflate.

public static String samlInflate(byte[] b) {
    try {
        ByteArrayOutputStream out = new ByteArrayOutputStream();
        InflaterOutputStream inflaterOutputStream = new InflaterOutputStream(out, new Inflater(true));
        inflaterOutputStream.write(b);
        inflaterOutputStream.finish();
        return out.toString(StandardCharsets.UTF_8.name());
    } catch (IOException ex) {
        throw new Saml2Exception("Unable to inflate string", ex);
    }
}
Also used : InflaterOutputStream(java.util.zip.InflaterOutputStream) Inflater(java.util.zip.Inflater) ByteArrayOutputStream(java.io.ByteArrayOutputStream) IOException(java.io.IOException) Saml2Exception(org.springframework.security.saml2.Saml2Exception)

Aggregations

Saml2Exception (org.springframework.security.saml2.Saml2Exception)46 Element (org.w3c.dom.Element)19 Document (org.w3c.dom.Document)13 MarshallingException (org.opensaml.core.xml.io.MarshallingException)12 ByteArrayOutputStream (java.io.ByteArrayOutputStream)10 IOException (java.io.IOException)10 ByteArrayInputStream (java.io.ByteArrayInputStream)9 Saml2X509Credential (org.springframework.security.saml2.core.Saml2X509Credential)9 X509Certificate (java.security.cert.X509Certificate)7 CertificateException (java.security.cert.CertificateException)6 Marshaller (org.opensaml.core.xml.io.Marshaller)6 Deflater (java.util.zip.Deflater)5 DeflaterOutputStream (java.util.zip.DeflaterOutputStream)5 Inflater (java.util.zip.Inflater)5 InflaterOutputStream (java.util.zip.InflaterOutputStream)5 CriteriaSet (net.shibboleth.utilities.java.support.resolver.CriteriaSet)4 XMLObject (org.opensaml.core.xml.XMLObject)4 Unmarshaller (org.opensaml.core.xml.io.Unmarshaller)4 SAMLMetadataSignatureSigningParametersResolver (org.opensaml.saml.security.impl.SAMLMetadataSignatureSigningParametersResolver)4 SecurityException (org.opensaml.security.SecurityException)4