public class WSSecUsernameToken extends WSSecBase
attachmentCallbackHandler, callbackLookup, expandXopInclude, keyIdentifierType, password, storeBytesInAttachment, user
Constructor and Description |
---|
WSSecUsernameToken(Document doc) |
WSSecUsernameToken(WSSecHeader securityHeader) |
Modifier and Type | Method and Description |
---|---|
void |
addCreated()
Add a Created element to the UsernameToken.
|
void |
addDerivedKey(boolean useMac,
byte[] saltValue,
int iteration)
Add a derived key to the UsernameToken
|
void |
addNonce()
Add a Nonce element to the UsernameToken.
|
void |
appendToHeader()
Appends the UsernameToken element to the elements already in the
Security header.
|
Document |
build()
Adds a new
UsernameToken to a soap envelope. |
byte[] |
getDerivedKey()
Get the derived key.
|
String |
getId()
Get the id generated during
prepare() . |
boolean |
getPasswordsAreEncoded() |
Element |
getUsernameTokenElement()
Returns the
UsernameToken element. |
WSTimeSource |
getWsTimeSource() |
boolean |
isPrecisionInMilliSeconds() |
void |
prepare()
Creates a Username token.
|
void |
prependToHeader()
Prepends the UsernameToken element to the elements already in the
Security header.
|
void |
setPasswordsAreEncoded(boolean passwordsAreEncoded) |
void |
setPasswordType(String pwType)
Defines how to construct the password element of the
UsernameToken . |
void |
setPrecisionInMilliSeconds(boolean precisionInMilliSeconds) |
void |
setWsTimeSource(WSTimeSource wsTimeSource) |
getDocument, getIdAllocator, getKeyIdentifierType, getParts, getSecurityHeader, getWsDocInfo, isExpandXopInclude, setAttachmentCallbackHandler, setBodyID, setCallbackLookup, setExpandXopInclude, setIdAllocator, setKeyIdentifierType, setStoreBytesInAttachment, setUserInfo, setWsDocInfo, setWsuId
public WSSecUsernameToken(WSSecHeader securityHeader)
public WSSecUsernameToken(Document doc)
public void setPasswordType(String pwType)
UsernameToken
.pwType
- contains the password type. Only allowed values are
WSS4JConstants.PASSWORD_DIGEST
and
WSS4JConstants.PASSWORD_TEXT
.
or null when no password is needed.public void addNonce()
public void addCreated()
public void addDerivedKey(boolean useMac, byte[] saltValue, int iteration)
useMac
- whether the derived key is to be used for a MAC or notsaltValue
- The salt value to useiteration
- The number of iterations to use in deriving a keypublic byte[] getDerivedKey() throws WSSecurityException
prepare()
method was called use this method
to compute a derived key. The generation of this secret key is according
to the UsernameTokenProfile 1.1 specification (section 4 - Key Derivation).prepare()
was not called before.WSSecurityException
public void setPasswordsAreEncoded(boolean passwordsAreEncoded)
passwordsAreEncoded
- whether passwords are encodedpublic boolean getPasswordsAreEncoded()
public String getId()
prepare()
.
Returns the the value of wsu:Id attribute of this UsernameToken.prepare()
was not called before.public void prepare()
prepare()
all parameters such as user, password,
passwordType etc. must be set. A complete UsernameToken
is
constructed.public void prependToHeader()
prepare()
.
This allows to insert the UsernameToken element at any position in the
Security header.public void appendToHeader()
prepare()
.
This allows to insert the UsernameToken element at any position in the
Security header.public Document build()
UsernameToken
to a soap envelope.
Before calling build()
all parameters such as user,
password, passwordType etc. must be set. A complete
UsernameToken
is constructed and added to the
wsse:Security
header.public Element getUsernameTokenElement()
UsernameToken
element.
The method can be called any time after prepare()
.
This allows to insert the UsernameToken element at any position in the
Security header.public boolean isPrecisionInMilliSeconds()
public void setPrecisionInMilliSeconds(boolean precisionInMilliSeconds)
public WSTimeSource getWsTimeSource()
public void setWsTimeSource(WSTimeSource wsTimeSource)
Copyright © 2019 JBoss by Red Hat. All rights reserved.