public class WSUsernameTokenPrincipalImpl extends Object implements Serializable, UsernameTokenPrincipal
Principal
interface and
represents a UsernameToken user.
In addition to the principal's name
this principal object also contains the nonce and created time of the
UsernameToken (refer to the OASIS WS Security specification, UsernameToken
profile). These values are set only if the password of UsernameToken was of
type PasswordDigest
.
Furthermore the password type is
provided to the application. The password type is the string of the type
attribute of the password element inside the username token. Refer to the
OASIS WSS specification for predefined password types. The
equals()
method use the prinicipal's name only and does not
compare nonce or created time.
Modelled according to the example provided
by JAAS documentation
Principal
,
Subject
,
Serialized FormConstructor and Description |
---|
WSUsernameTokenPrincipalImpl(String name,
boolean digest)
Create a WSUsernameTokenPrincipalImpl with a WSUsernameToken username.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o)
Compares the specified Object with this
WSUsernameTokenPrincipal
for equality. |
String |
getCreatedTime()
Return the WSUsernameToken created time for this
WSUsernameTokenPrincipalImpl . |
String |
getName()
Return the WSUsernameToken username for this
WSUsernameTokenPrincipalImpl . |
byte[] |
getNonce()
Return the WSUsernameToken nonce for this
WSUsernameTokenPrincipalImpl . |
String |
getPassword()
Return the WSUsernameToken password for this
WSUsernameTokenPrincipalImpl . |
String |
getPasswordType() |
int |
hashCode()
Return a hash code for this
WSUsernameTokenPrincipalImpl . |
boolean |
isPasswordDigest()
Return the WSUsernameToken password type for this
WSUsernameTokenPrincipalImpl . |
void |
setCreatedTime(String createdTime)
Set the WSUsernameToken created time for this
WSUsernameTokenPrincipalImpl . |
void |
setNonce(byte[] nonce)
Set the WSUsernameToken nonce for this
WSUsernameTokenPrincipalImpl . |
void |
setPassword(String password)
Set the WSUsernameToken password for this
WSUsernameTokenPrincipalImpl . |
void |
setPasswordType(String passwordType) |
String |
toString()
Return a string representation of this
WSUsernameTokenPrincipalImpl . |
public WSUsernameTokenPrincipalImpl(String name, boolean digest)
name
- the WSUsernameToken username for this user.public String getName()
WSUsernameTokenPrincipalImpl
.public boolean isPasswordDigest()
WSUsernameTokenPrincipalImpl
.isPasswordDigest
in interface UsernameTokenPrincipal
PassowrdDigest
public void setPassword(String password)
WSUsernameTokenPrincipalImpl
.password
- public String getPassword()
WSUsernameTokenPrincipalImpl
.getPassword
in interface UsernameTokenPrincipal
WSUsernameTokenPrincipalImpl
public void setNonce(byte[] nonce)
WSUsernameTokenPrincipalImpl
.nonce
- public byte[] getNonce()
WSUsernameTokenPrincipalImpl
.getNonce
in interface UsernameTokenPrincipal
WSUsernameTokenPrincipalImpl
public void setCreatedTime(String createdTime)
WSUsernameTokenPrincipalImpl
.createdTime
- public String getCreatedTime()
WSUsernameTokenPrincipalImpl
.getCreatedTime
in interface UsernameTokenPrincipal
WSUsernameTokenPrincipalImpl
public String toString()
WSUsernameTokenPrincipalImpl
.public String getPasswordType()
getPasswordType
in interface UsernameTokenPrincipal
public void setPasswordType(String passwordType)
passwordType
- The passwordType to set.public boolean equals(Object o)
WSUsernameTokenPrincipal
for equality. Returns true if the given object is also a
WSUsernameTokenPrincipal
and the two WSUsernameTokenPrincipals
have the same username.Copyright © 2019 JBoss by Red Hat. All rights reserved.