Class SamlIoUtil
java.lang.Object
swiss.trustbroker.common.saml.util.SamlIoUtil
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic StringbuildEncodedSamlRedirectSignature(org.opensaml.saml.common.SAMLObject message, org.opensaml.security.credential.Credential credential, String sigAlg, String relayState, String encodedSamlMessage) static StringbuildSamlRedirectQueryString(String sigAlg, boolean request, String encodedSamlMessage, String relayState, String signature) static StringbuildSignedSamlRedirectQueryString(org.opensaml.saml.common.SAMLObject message, org.opensaml.security.credential.Credential credential, String sigAlg, String relayState) static org.opensaml.core.xml.XMLObjectdecodeSamlPostData(String samlPostData) static StringdecodeSamlPostDataToString(String samlPostData, boolean prettyPrint) static org.opensaml.core.xml.XMLObjectdecodeSamlRedirectData(String message) static StringdecodeSamlRedirectDataToString(String sankRedirectData, boolean prettyPrint) static StringencodeSamlArtifactData(org.apache.velocity.app.VelocityEngine velocityEngine, org.opensaml.saml.common.binding.artifact.SAMLArtifactMap artifactMap, org.opensaml.saml.saml2.core.RequestAbstractType message, ArtifactResolutionParameters artifactResolutionParameters, String relayState) static StringencodeSamlArtifactData(org.apache.velocity.app.VelocityEngine velocityEngine, org.opensaml.saml.common.binding.artifact.SAMLArtifactMap artifactMap, org.opensaml.saml.saml2.core.StatusResponseType message, ArtifactResolutionParameters artifactResolutionParameters, String relayState) static StringencodeSamlRedirectData(org.opensaml.saml.common.SAMLObject message) static StringgenerateRedirectUrl(org.opensaml.messaging.context.MessageContext messageContext, String message, String url) static org.opensaml.saml.saml2.core.AssertiongetAssertionFromSubjectToken(String subjectToken) static ElementgetDomElementFromStream(InputStream stream, String sourceName) static InputStreamgetInputStreamFromFile(String fileName) static StringgetSamlArtifactDataFromHttpProtocol(jakarta.servlet.http.HttpServletRequest request) static StringgetSamlDataFromHttpProtocol(jakarta.servlet.http.HttpServletRequest request) static StringgetSamlPostDataFromHttpProtocol(jakarta.servlet.http.HttpServletRequest request, boolean pretty) static StringgetSamlRedirectDataFromHttpProtocol(jakarta.servlet.http.HttpServletRequest request, boolean pretty) static Stringstatic org.opensaml.core.xml.XMLObjectgetXmlObjectFromFileOrClassPath(String fileName) static org.opensaml.core.xml.XMLObjectgetXmlObjectFromStream(InputStream stream, String sourceName) static <T extends org.opensaml.core.xml.XMLObject>
TgetXmlObjectFromString(Class<? extends T> expected, String data, String sourceName) static org.opensaml.core.xml.XMLObjectgetXmlObjectFromString(String data) static <T extends org.opensaml.core.xml.XMLObject>
StringmarshalXmlObject(T xmlObject) static <T extends org.opensaml.core.xml.XMLObject>
byte[]marshalXmlObjectToBytes(T xmlObject) static <T extends org.opensaml.core.xml.XMLObject>
StringmarshalXmlObjectToString(T xmlObject) static voidoverrideUnmarshaller(QName qname, org.opensaml.core.xml.io.Unmarshaller unmarshaller) static org.opensaml.saml.saml2.core.AssertionunmarshallAssertion(InputStream stream) Unmarshalls a SAML Assertion from stream resource into its SAMLObject.static org.opensaml.saml.saml2.core.AuthnRequestunmarshallAuthnRequest(InputStream stream) Unmarshalls a SAML AuthnRequest from stream resource into its SAMLObject.static org.opensaml.saml.saml2.core.AuthnRequestunmarshallAuthnRequest(String mappingFile) static org.opensaml.saml.saml2.core.LogoutRequestunmarshallLogoutRequest(String mappingFile) static org.opensaml.saml.saml2.core.LogoutResponseunmarshallLogoutResponse(String mappingFile) static org.opensaml.saml.saml2.core.RequestAbstractTypeunmarshallRequest(String mappingFile) static org.opensaml.soap.wstrust.RequestSecurityTokenUnmarshalls a WSTrust token request from stream resource into its SAMLObject.static org.opensaml.saml.saml2.core.ResponseunmarshallResponse(InputStream stream) Unmarshalls a SAML Response from stream resource into its SAMLObject.static org.opensaml.saml.saml2.core.ResponseunmarshallResponse(String mappingFile) static org.opensaml.saml.saml2.core.StatusResponseTypeunmarshallStatusResponse(String mappingFile) static <T> TunmarshallXmlFile(String mappingFile, InputStream stream) static voidwriteXmlObjectToSteam(org.opensaml.core.xml.XMLObject xmlObject, OutputStream out) static StringxmlObjectToString(org.opensaml.core.xml.XMLObject xmlObject) static StringxmlObjectToString(org.opensaml.core.xml.XMLObject xmlObject, boolean prettyPrint)
-
Field Details
-
SAML_REQUEST_NAME
- See Also:
-
SAML_RESPONSE_NAME
- See Also:
-
SAML_ARTIFACT_NAME
- See Also:
-
SAML_RELAY_STATE
- See Also:
-
SAML_REDIRECT_SIGNATURE
- See Also:
-
SAML_REDIRECT_SIGNATURE_ALGORITHM
- See Also:
-
-
Method Details
-
unmarshallAuthnRequest
Unmarshalls a SAML AuthnRequest from stream resource into its SAMLObject.<saml2:AuthnRequest/>should result inorg.opensaml.saml.saml2.core.impl.AssertionImpl -
unmarshallResponse
Unmarshalls a SAML Response from stream resource into its SAMLObject.<saml2:Response/>results inorg.opensaml.saml.saml2.core.impl.ResponseImpl -
unmarshallAssertion
Unmarshalls a SAML Assertion from stream resource into its SAMLObject.<saml2:Assertion/>results inorg.opensaml.saml.saml2.core.impl.AssertionImpl -
unmarshallRequestSecurityToken
public static org.opensaml.soap.wstrust.RequestSecurityToken unmarshallRequestSecurityToken(InputStream stream) Unmarshalls a WSTrust token request from stream resource into its SAMLObject.<saml2:Assertion/>results inorg.opensaml.soap.wstrust.impl.RequestSecurityTokenImpl -
unmarshallAuthnRequest
-
unmarshallLogoutRequest
public static org.opensaml.saml.saml2.core.LogoutRequest unmarshallLogoutRequest(String mappingFile) -
unmarshallRequest
public static org.opensaml.saml.saml2.core.RequestAbstractType unmarshallRequest(String mappingFile) -
unmarshallResponse
-
unmarshallLogoutResponse
public static org.opensaml.saml.saml2.core.LogoutResponse unmarshallLogoutResponse(String mappingFile) -
unmarshallStatusResponse
public static org.opensaml.saml.saml2.core.StatusResponseType unmarshallStatusResponse(String mappingFile) -
unmarshallXmlFile
-
getXmlObjectFromFileOrClassPath
-
getInputStreamFromFile
-
getDomElementFromStream
-
getXmlObjectFromStream
public static org.opensaml.core.xml.XMLObject getXmlObjectFromStream(InputStream stream, String sourceName) -
decodeSamlPostData
public static org.opensaml.core.xml.XMLObject decodeSamlPostData(String samlPostData) throws IOException - Throws:
IOException
-
decodeSamlPostDataToString
public static String decodeSamlPostDataToString(String samlPostData, boolean prettyPrint) throws IOException - Throws:
IOException
-
decodeSamlRedirectDataToString
-
encodeSamlRedirectData
-
decodeSamlRedirectData
-
generateRedirectUrl
public static String generateRedirectUrl(org.opensaml.messaging.context.MessageContext messageContext, String message, String url) throws org.opensaml.messaging.encoder.MessageEncodingException - Throws:
org.opensaml.messaging.encoder.MessageEncodingException
-
encodeSamlArtifactData
public static String encodeSamlArtifactData(org.apache.velocity.app.VelocityEngine velocityEngine, org.opensaml.saml.common.binding.artifact.SAMLArtifactMap artifactMap, org.opensaml.saml.saml2.core.RequestAbstractType message, ArtifactResolutionParameters artifactResolutionParameters, String relayState) -
encodeSamlArtifactData
public static String encodeSamlArtifactData(org.apache.velocity.app.VelocityEngine velocityEngine, org.opensaml.saml.common.binding.artifact.SAMLArtifactMap artifactMap, org.opensaml.saml.saml2.core.StatusResponseType message, ArtifactResolutionParameters artifactResolutionParameters, String relayState) -
xmlObjectToString
public static String xmlObjectToString(org.opensaml.core.xml.XMLObject xmlObject, boolean prettyPrint) -
xmlObjectToString
-
writeXmlObjectToSteam
public static void writeXmlObjectToSteam(org.opensaml.core.xml.XMLObject xmlObject, OutputStream out) -
getXmlObjectFromString
-
getXmlObjectFromString
-
marshalXmlObjectToString
public static <T extends org.opensaml.core.xml.XMLObject> String marshalXmlObjectToString(T xmlObject) -
marshalXmlObject
-
marshalXmlObjectToBytes
public static <T extends org.opensaml.core.xml.XMLObject> byte[] marshalXmlObjectToBytes(T xmlObject) -
getSamlPostDataFromHttpProtocol
public static String getSamlPostDataFromHttpProtocol(jakarta.servlet.http.HttpServletRequest request, boolean pretty) -
getSamlRedirectDataFromHttpProtocol
public static String getSamlRedirectDataFromHttpProtocol(jakarta.servlet.http.HttpServletRequest request, boolean pretty) -
getSamlArtifactDataFromHttpProtocol
public static String getSamlArtifactDataFromHttpProtocol(jakarta.servlet.http.HttpServletRequest request) -
getSamlDataFromHttpProtocol
-
buildSamlRedirectQueryString
-
buildSignedSamlRedirectQueryString
-
getSamlRedirectSignatureAlgorithmWithDefault
-
buildEncodedSamlRedirectSignature
-
overrideUnmarshaller
public static void overrideUnmarshaller(QName qname, org.opensaml.core.xml.io.Unmarshaller unmarshaller) -
getAssertionFromSubjectToken
public static org.opensaml.saml.saml2.core.Assertion getAssertionFromSubjectToken(String subjectToken)
-