Class UsernameToken

java.lang.Object
com.sun.xml.ws.policy.PolicyAssertion
com.sun.xml.ws.security.impl.policy.UsernameToken
All Implemented Interfaces:
SecurityAssertionValidator, com.sun.xml.ws.security.policy.Token, UserNameToken, Cloneable

public class UsernameToken extends com.sun.xml.ws.policy.PolicyAssertion implements UserNameToken, Cloneable, SecurityAssertionValidator
Author:
K.Venugopal@sun.com
  • Nested Class Summary

    Nested classes/interfaces inherited from interface com.sun.xml.ws.security.policy.SecurityAssertionValidator

    SecurityAssertionValidator.AssertionFitness
  • Field Summary

    Fields inherited from interface com.sun.xml.ws.security.policy.Token

    REQUIRE_DERIVED_KEYS, REQUIRE_EMBEDDED_TOKEN_REFERENCE, REQUIRE_EXTERNAL_REFERENCE, REQUIRE_EXTERNAL_URI_REFERENCE, REQUIRE_INTERNAL_REFERENCE, REQUIRE_ISSUER_SERIAL_REFERENCE, REQUIRE_KEY_IDENTIFIER_REFERENCE, REQUIRE_THUMBPRINT_REFERENCE, RSA_KEYVALUE_TOKEN, SC10_SECURITYCONTEXT_TOKEN, WSS_REL_V10_TOKEN10, WSS_REL_V10_TOKEN11, WSS_REL_V20_TOKEN10, WSS_REL_V20_TOKEN11, WSS_SAML_V10_TOKEN10, WSS_SAML_V10_TOKEN11, WSS_SAML_V11_TOKEN10, WSS_SAML_V11_TOKEN11, WSS_SAML_V20_TOKEN11, WSS_USERNAME_TOKEN_10, WSS_USERNAME_TOKEN_11, WSS10, WSS11, WSSKERBEROS_GSS_V5_AP_REQ_TOKEN11, WSSKERBEROS_V5_AP_REQ_TOKEN11, WSSX509PKCS7TOKEN10, WSSX509PKCS7TOKEN11, WSSX509PKIPATHV1TOKEN10, WSSX509PKIPATHV1TOKEN11, WSSX509V1TOKEN10, WSSX509V1TOKEN11, WSSX509V3TOKEN10, WSSX509V3TOKEN11
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a new instance of UsernameToken
    UsernameToken(com.sun.xml.ws.policy.sourcemodel.AssertionData name, Collection<com.sun.xml.ws.policy.PolicyAssertion> nestedAssertions, com.sun.xml.ws.policy.AssertionSet nestedAlternative)
     
  • Method Summary

    Modifier and Type
    Method
    Description
     
     
     
    returns the issuer for the Username token.
     
    com.sun.xml.ws.security.policy.SecurityPolicyVersion
     
     
     
    UsernameToken version
    boolean
    returns true is password needs to be used in the UsernameToken Header sent in the message.
    boolean
     
    void
     
    void
     
    void
     
    boolean
    returns true is Created needs to be used in the UsernameToken Header sent in the message.
    boolean
     
    boolean
    returns true is Nonce needs to be used in the UsernameToken Header sent in the message.
    validate(boolean isServer)
    returns true if all the assertions embeeded under a SecurityPolicy assertion are valid and supported by the implementation.

    Methods inherited from class com.sun.xml.ws.policy.PolicyAssertion

    equals, getAttributes, getAttributesSet, getAttributeValue, getImplementation, getName, getNestedAssertionsIterator, getNestedPolicy, getParametersIterator, getValue, hashCode, hasNestedAssertions, hasNestedPolicy, hasParameters, isIgnorable, isOptional, isPrivate, toString, toString

    Methods inherited from class java.lang.Object

    finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • UsernameToken

      public UsernameToken()
      Creates a new instance of UsernameToken
    • UsernameToken

      public UsernameToken(com.sun.xml.ws.policy.sourcemodel.AssertionData name, Collection<com.sun.xml.ws.policy.PolicyAssertion> nestedAssertions, com.sun.xml.ws.policy.AssertionSet nestedAlternative)
  • Method Details

    • setType

      public void setType(String type)
    • getType

      public String getType()
      Description copied from interface: UserNameToken
      UsernameToken version
      Specified by:
      getType in interface UserNameToken
      Returns:
      1.0 or 1.1
    • getTokenId

      public String getTokenId()
      Specified by:
      getTokenId in interface com.sun.xml.ws.security.policy.Token
    • setTokenId

      public void setTokenId(String _id)
    • getIncludeToken

      public String getIncludeToken()
      Specified by:
      getIncludeToken in interface com.sun.xml.ws.security.policy.Token
    • setIncludeToken

      public void setIncludeToken(String type)
    • getIssuer

      public Issuer getIssuer()
      Description copied from interface: UserNameToken
      returns the issuer for the Username token.
      Specified by:
      getIssuer in interface UserNameToken
      Returns:
      returns the issuer
    • getIssuerName

      public IssuerName getIssuerName()
      Specified by:
      getIssuerName in interface UserNameToken
      Returns:
      the issuer name for Username token
    • getClaims

      public Claims getClaims()
      Specified by:
      getClaims in interface UserNameToken
      Returns:
      Claims
    • validate

      public SecurityAssertionValidator.AssertionFitness validate(boolean isServer)
      Description copied from interface: SecurityAssertionValidator
      returns true if all the assertions embeeded under a SecurityPolicy assertion are valid and supported by the implementation.
      Specified by:
      validate in interface SecurityAssertionValidator
    • hasPassword

      public boolean hasPassword()
      Description copied from interface: UserNameToken
      returns true is password needs to be used in the UsernameToken Header sent in the message.
      Specified by:
      hasPassword in interface UserNameToken
    • useHashPassword

      public boolean useHashPassword()
      Specified by:
      useHashPassword in interface UserNameToken
      Returns:
      true if password hash should be used instead of plaintext password
    • isRequireDerivedKeys

      public boolean isRequireDerivedKeys()
      Specified by:
      isRequireDerivedKeys in interface UserNameToken
    • clone

      public Object clone() throws CloneNotSupportedException
      Overrides:
      clone in class Object
      Throws:
      CloneNotSupportedException
    • getSecurityPolicyVersion

      public com.sun.xml.ws.security.policy.SecurityPolicyVersion getSecurityPolicyVersion()
      Specified by:
      getSecurityPolicyVersion in interface com.sun.xml.ws.security.policy.Token
    • getTokenRefernceType

      public Set getTokenRefernceType()
      Specified by:
      getTokenRefernceType in interface UserNameToken
    • useNonce

      public boolean useNonce()
      Description copied from interface: UserNameToken
      returns true is Nonce needs to be used in the UsernameToken Header sent in the message.
      Specified by:
      useNonce in interface UserNameToken
    • useCreated

      public boolean useCreated()
      Description copied from interface: UserNameToken
      returns true is Created needs to be used in the UsernameToken Header sent in the message.
      Specified by:
      useCreated in interface UserNameToken