Class SAML2Utils

java.lang.Object
org.apache.rahas.impl.util.SAML2Utils

public class SAML2Utils extends Object
  • Constructor Details

    • SAML2Utils

      public SAML2Utils()
  • Method Details

    • getElementFromAssertion

      public static Element getElementFromAssertion(org.opensaml.core.xml.XMLObject xmlObj) throws TrustException
      Throws:
      TrustException
    • getSAML2KeyInfo

      public static SAML2KeyInfo getSAML2KeyInfo(Element elem, org.apache.wss4j.common.crypto.Crypto crypto, CallbackHandler cb, org.apache.wss4j.dom.handler.RequestData requestData) throws org.apache.wss4j.common.ext.WSSecurityException
      Extract certificates or the key available in the SAMLAssertion
      Parameters:
      elem - The element to process.
      crypto - The crypto properties.
      cb - Callback class to get the Key
      Returns:
      SAML2KeyInfo the SAML2 Key Info
      Throws:
      org.apache.wss4j.common.ext.WSSecurityException - If an error occurred while extracting KeyInfo.
    • getSAML2KeyInfo

      public static SAML2KeyInfo getSAML2KeyInfo(org.opensaml.saml.saml2.core.Assertion assertion, org.apache.wss4j.common.crypto.Crypto crypto, CallbackHandler cb, org.apache.wss4j.dom.handler.RequestData requestData) throws org.apache.wss4j.common.ext.WSSecurityException
      Throws:
      org.apache.wss4j.common.ext.WSSecurityException
    • getSAML2SubjectConfirmationMethod

      public static String getSAML2SubjectConfirmationMethod(org.opensaml.saml.saml2.core.Assertion assertion)
      Get the subject confirmation method of a SAML 2.0 assertion
      Parameters:
      assertion - SAML 2.0 assertion
      Returns:
      Subject Confirmation method
    • createAssertion

      public static org.opensaml.saml.saml2.core.Assertion createAssertion() throws TrustException
      Throws:
      TrustException
    • createIssuer

      public static org.opensaml.saml.saml2.core.Issuer createIssuer(String issuerName) throws TrustException
      Throws:
      TrustException
    • createConditions

      public static org.opensaml.saml.saml2.core.Conditions createConditions(Instant creationTime, Instant expirationTime) throws TrustException
      Throws:
      TrustException
    • createNamedIdentifier

      public static org.opensaml.saml.saml2.core.NameID createNamedIdentifier(String principalName, String format) throws TrustException
      Create named identifier.
      Parameters:
      principalName - Name of the subject.
      format - Format of the subject, whether it is an email, uid etc ...
      Returns:
      The NamedIdentifier object.
      Throws:
      TrustException - If unable to find the builder.