Package com.sun.identity.wss.security
Class SAML2Token
- java.lang.Object
-
- com.sun.identity.wss.security.SAML2Token
-
- All Implemented Interfaces:
SecurityToken
public class SAML2Token extends Object implements SecurityToken
This classSAML2Tokenrepresents a SAML2 token that can be inserted into web services security header for message level security.This class implements
SecurityTokenand can be created through security token factory.
-
-
Field Summary
-
Fields inherited from interface com.sun.identity.wss.security.SecurityToken
LIBERTY_ASSERTION_TOKEN, WSS_FAM_SSO_TOKEN, WSS_KERBEROS_TOKEN, WSS_SAML_TOKEN, WSS_SAML2_TOKEN, WSS_USERNAME_TOKEN, WSS_X509_TOKEN
-
-
Constructor Summary
Constructors Constructor Description SAML2Token(SAML2TokenSpec spec, SSOToken ssoToken)Constructor that initializes the SAML2Token.SAML2Token(Element element)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AssertiongetAssertion()StringgetTokenType()Returns the security token type.X509CertificategetX509Certificate()Returns X509 certificate of the authenticated subject.booleanisSenderVouches()Returns true if the SAML2 token is of type sender vouchesvoidsign(String alias)Signs the SAML2 Token.ElementtoDocumentElement()Returns DOM element for the SAML2 token
-
-
-
Constructor Detail
-
SAML2Token
public SAML2Token(SAML2TokenSpec spec, SSOToken ssoToken) throws SecurityException
Constructor that initializes the SAML2Token.- Throws:
SecurityException
-
SAML2Token
public SAML2Token(Element element) throws SAML2Exception
- Throws:
SAML2Exception
-
-
Method Detail
-
getTokenType
public String getTokenType()
Returns the security token type.- Specified by:
getTokenTypein interfaceSecurityToken- Returns:
- String SAMLToken type.
-
getAssertion
public Assertion getAssertion()
-
getX509Certificate
public X509Certificate getX509Certificate() throws SecurityException
Returns X509 certificate of the authenticated subject.- Throws:
SecurityException
-
toDocumentElement
public Element toDocumentElement() throws SecurityException
Returns DOM element for the SAML2 token- Specified by:
toDocumentElementin interfaceSecurityToken- Returns:
- the DOM
Elementelement - Throws:
SecurityException- if there is a failure.
-
sign
public void sign(String alias) throws SecurityException
Signs the SAML2 Token.- Throws:
SecurityException- if unable to sign the assertion.
-
isSenderVouches
public boolean isSenderVouches()
Returns true if the SAML2 token is of type sender vouches
-
-