Class UsernameSecurityTokenImpl
- java.lang.Object
-
- org.apache.xml.security.stax.impl.securityToken.AbstractSecurityToken
-
- org.apache.xml.security.stax.impl.securityToken.AbstractInboundSecurityToken
-
- org.apache.wss4j.stax.impl.securityToken.UsernameSecurityTokenImpl
-
- All Implemented Interfaces:
SubjectAndPrincipalSecurityToken
,UsernameSecurityToken
,org.apache.xml.security.stax.securityToken.InboundSecurityToken
,org.apache.xml.security.stax.securityToken.SecurityToken
public class UsernameSecurityTokenImpl extends org.apache.xml.security.stax.impl.securityToken.AbstractInboundSecurityToken implements UsernameSecurityToken
-
-
Constructor Summary
Constructors Constructor Description UsernameSecurityTokenImpl(WSSConstants.UsernameTokenPasswordType usernameTokenPasswordType, String username, String password, String createdTime, byte[] nonce, byte[] salt, Long iteration, WSInboundSecurityContext wsInboundSecurityContext, String id, org.apache.xml.security.stax.securityToken.SecurityTokenConstants.KeyIdentifier keyIdentifier)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]
generateDerivedKey()
This method generates a derived key as defined in WSS Username Token Profile.protected byte[]
generateDerivedKey(WSInboundSecurityContext wsInboundSecurityContext)
This method generates a derived key as defined in WSS Username Token Profile.String
getCreatedTime()
Long
getIteration()
protected Key
getKey(String algorithmURI, org.apache.xml.security.stax.ext.XMLSecurityConstants.AlgorithmUsage algorithmUsage, String correlationID)
byte[]
getNonce()
String
getPassword()
Principal
getPrincipal()
byte[]
getSalt()
Subject
getSubject()
org.apache.xml.security.stax.securityToken.SecurityTokenConstants.TokenType
getTokenType()
String
getUsername()
WSSConstants.UsernameTokenPasswordType
getUsernameTokenPasswordType()
boolean
isAsymmetric()
void
setSubject(Subject subject)
-
Methods inherited from class org.apache.xml.security.stax.impl.securityToken.AbstractInboundSecurityToken
addTokenUsage, addWrappedToken, getElementPath, getKeyIdentifier, getKeyWrappingToken, getPubKey, getPublicKey, getSecretKey, getWrappedTokens, getXMLSecEvent, isIncludedInMessage, setElementPath, setKeyWrappingToken, setXMLSecEvent, verify
-
Methods inherited from class org.apache.xml.security.stax.impl.securityToken.AbstractSecurityToken
getId, getPublicKey, getSecretKey, getSha1Identifier, getTokenUsages, getX509Certificates, setAsymmetric, setPublicKey, setSecretKey, setSha1Identifier, setX509Certificates
-
-
-
-
Constructor Detail
-
UsernameSecurityTokenImpl
public UsernameSecurityTokenImpl(WSSConstants.UsernameTokenPasswordType usernameTokenPasswordType, String username, String password, String createdTime, byte[] nonce, byte[] salt, Long iteration, WSInboundSecurityContext wsInboundSecurityContext, String id, org.apache.xml.security.stax.securityToken.SecurityTokenConstants.KeyIdentifier keyIdentifier)
-
-
Method Detail
-
isAsymmetric
public boolean isAsymmetric() throws org.apache.xml.security.exceptions.XMLSecurityException
- Specified by:
isAsymmetric
in interfaceorg.apache.xml.security.stax.securityToken.SecurityToken
- Overrides:
isAsymmetric
in classorg.apache.xml.security.stax.impl.securityToken.AbstractSecurityToken
- Throws:
org.apache.xml.security.exceptions.XMLSecurityException
-
getKey
protected Key getKey(String algorithmURI, org.apache.xml.security.stax.ext.XMLSecurityConstants.AlgorithmUsage algorithmUsage, String correlationID) throws org.apache.xml.security.exceptions.XMLSecurityException
- Overrides:
getKey
in classorg.apache.xml.security.stax.impl.securityToken.AbstractInboundSecurityToken
- Throws:
org.apache.xml.security.exceptions.XMLSecurityException
-
getTokenType
public org.apache.xml.security.stax.securityToken.SecurityTokenConstants.TokenType getTokenType()
- Specified by:
getTokenType
in interfaceorg.apache.xml.security.stax.securityToken.SecurityToken
-
generateDerivedKey
public byte[] generateDerivedKey() throws WSSecurityException
This method generates a derived key as defined in WSS Username Token Profile.- Specified by:
generateDerivedKey
in interfaceUsernameSecurityToken
- Returns:
- Returns the derived key a byte array
- Throws:
WSSecurityException
-
generateDerivedKey
protected byte[] generateDerivedKey(WSInboundSecurityContext wsInboundSecurityContext) throws WSSecurityException
This method generates a derived key as defined in WSS Username Token Profile.- Returns:
- Returns the derived key a byte array
- Throws:
WSSecurityException
-
getPrincipal
public Principal getPrincipal() throws WSSecurityException
- Specified by:
getPrincipal
in interfaceSubjectAndPrincipalSecurityToken
- Throws:
WSSecurityException
-
getUsernameTokenPasswordType
public WSSConstants.UsernameTokenPasswordType getUsernameTokenPasswordType()
- Specified by:
getUsernameTokenPasswordType
in interfaceUsernameSecurityToken
-
getCreatedTime
public String getCreatedTime()
- Specified by:
getCreatedTime
in interfaceUsernameSecurityToken
-
getPassword
public String getPassword()
- Specified by:
getPassword
in interfaceUsernameSecurityToken
-
getUsername
public String getUsername()
- Specified by:
getUsername
in interfaceUsernameSecurityToken
-
getNonce
public byte[] getNonce()
- Specified by:
getNonce
in interfaceUsernameSecurityToken
-
getSalt
public byte[] getSalt()
- Specified by:
getSalt
in interfaceUsernameSecurityToken
-
getIteration
public Long getIteration()
- Specified by:
getIteration
in interfaceUsernameSecurityToken
-
setSubject
public void setSubject(Subject subject)
-
getSubject
public Subject getSubject() throws WSSecurityException
- Specified by:
getSubject
in interfaceSubjectAndPrincipalSecurityToken
- Throws:
WSSecurityException
-
-