|
Oracle Security Developer Tools Web Services Security Java API Reference 10g (10.1.4.0.1) B28177-01 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
oracle.security.xmlsec.util.XMLNode
oracle.security.xmlsec.util.XMLElement
oracle.security.xmlsec.wss.WSSElement
oracle.security.xmlsec.wss.username.UsernameToken
Represents a WSS UsernameToken
element.
Field Summary | |
static java.lang.String |
PASSWORD_DIGEST Specifies that the type of password is a digest of the password. |
static java.lang.String |
PASSWORD_TEXT Specifies that the type of password is a plaintext password, derived password or a password hash. |
Fields inherited from class oracle.security.xmlsec.util.XMLNode |
node, systemId |
Constructor Summary | |
UsernameToken(org.w3c.dom.Document owner) Create a new UsernameToken instance. |
|
UsernameToken(org.w3c.dom.Element element) Create a new UsernameToken instance from the given XML element. |
|
UsernameToken(org.w3c.dom.Element element, java.lang.String systemId) Create a new UsernameToken instance from the given XML element. |
Method Summary | |
static void |
addKeyDerivator(KeyDerivator resolver) Register a KeyDerivatorResolver instance for use in key identifier resolver operations. |
static void |
addPasswordRetriever(PasswordRetriever resolver) Register a PasswordRetriever instance to lookup the password. |
byte[] |
computePasswordDigest(byte[] nonce, WSUCreated created, char[] passwd) Creates the SHA-1 digest of the the given password and optionally nonce and/or creation timpstamp. |
byte[] |
createSecretKey() Creates a secret key for HMAC signature from this Username token. |
byte[] |
createSecretKey(char[] passwd) Creates a secret key for HMAC signature from this Username token. |
WSUCreated |
getCreated() Returns the token creation timestamp. |
oracle.security.crypto.core.SymmetricKey |
getKey() Get the cryptographic key corresponding to the token contents. |
byte[] |
getNonce() Returns the nonce. |
char[] |
getPassword() Gets the plaintext password (or password equivalent) stored in the Password child element in this structure. |
byte[] |
getPasswordDigest() Gets the digest of the password and optionally nonce and/or creation timestamp stored in the Password child element in this structure. |
java.lang.String |
getPasswordType() Returns the type of password. |
java.lang.Object |
getToken() Get the token contents. |
oracle.security.xmlsec.util.QName |
getTokenName() Returns the token name. |
java.lang.String |
getUsername() Returns the username value. |
boolean |
isValid() Checks if the information stored in this token is valid. |
boolean |
isValid(java.lang.String userName, char[] passwd) Checks if the information stored in this token is valid against the given user name and password pair. |
void |
setCreated(WSUCreated created) Set the token creation timestamp. |
void |
setNonce(byte[] nonce) Sets the Nonce element with the specified value and the default Base64 encoding. |
void |
setNonce(byte[] nonce, java.lang.String encType) Sets the Nonce element with the specified value and encoding type of the nonce. |
void |
setPassword(char[] passwd) Sets the Password element with the plain text text password (or password equivalent) of the user. |
void |
setPassword(char[] password, java.lang.String passwordType) Sets the Password element. |
void |
setUsername(java.lang.String userName) Sets the username value. |
Methods inherited from class oracle.security.xmlsec.wss.WSSElement |
getId, getWsuId, setId, setWsuId |
Methods inherited from class oracle.security.xmlsec.util.XMLElement |
addNSPrefixAttr, addNSPrefixAttr, addNSPrefixAttrDefault, addNSPrefixAttrDefault, getAttribute, getAttributeNode, getAttributeNodeNS, getAttributeNS, getChildElementsByTagName, getChildElementsByTagName, getChildElementsByTagNameNS, getChildElementsByTagNameNS, getDefaultNSPrefix, getElementsByTagName, getElementsByTagNameNS, getTagName, hasAttribute, hasAttributeNS, removeAttribute, removeAttributeNode, removeAttributeNS, setAttribute, setAttributeNode, setAttributeNodeNS, setAttributeNS, setDefaultNSPrefix |
Methods inherited from class oracle.security.xmlsec.util.XMLNode |
appendChild, appendChild, appendTo, cloneNode, getAttributes, getChildNodes, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNode, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, getSystemId, hasAttributes, hasChildNodes, insertBefore, insertBefore, isSupported, normalize, removeChild, removeChild, replaceChild, replaceChild, setNodeValue, setPrefix, setSystemId, toBytesXML, toStringXML |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface oracle.security.xmlsec.wss.WSSecurityToken |
getNode |
Field Detail |
public static final java.lang.String PASSWORD_TEXT
public static final java.lang.String PASSWORD_DIGEST
Constructor Detail |
public UsernameToken(org.w3c.dom.Element element)
UsernameToken
instance from the given XML element.element
- A wsse:UsernameToken element.public UsernameToken(org.w3c.dom.Element element, java.lang.String systemId)
UsernameToken
instance from the given XML element.element
- A wsse:UsernameToken element.systemId
- The URI string system ID for this element.public UsernameToken(org.w3c.dom.Document owner)
UsernameToken
instance.owner
- A XML Document to be used as the owner document of this structure.Method Detail |
public void setUsername(java.lang.String userName)
userName
- The username string.public java.lang.String getUsername()
public void setNonce(byte[] nonce)
Nonce
element with the specified value and the default Base64 encoding.nonce
- The nonce bytes.public void setNonce(byte[] nonce, java.lang.String encType)
Nonce
element with the specified value and encoding type of the nonce.nonce
- The nonce bytes.encType
- The encoding type of the nonce.public byte[] getNonce()
public void setCreated(WSUCreated created)
created
- The creation timestamp.public WSUCreated getCreated()
public void setPassword(char[] passwd)
Password
element with the plain text text password (or password equivalent) of the user.passwd
- The clear text password (or password equivalent) of the user.public void setPassword(char[] password, java.lang.String passwordType)
Password
element. The actual value stored in this element depends on the password type provided.password
- The clear text password (or password equivalent) of the user. If the password is null
, the PasswordRetriever will be used to lookup the passwd.passwordType
- The value for the Type
attribute which specifies the type of password being provided in this token.public java.lang.String getPasswordType()
public char[] getPassword()
Password
child element in this structure. Returns null if PasswordDigest
type is used.public byte[] getPasswordDigest()
Password
child element in this structure. Returns null if PasswordDigest type is not used.public boolean isValid()
true
if the supplied credentials match the token credentials or false
otherwise.public boolean isValid(java.lang.String userName, char[] passwd)
userName
- The user name value.passwd
- The password value. If the password is null
, the PasswordRetriever will be used to lookup the passwd.true
if the supplied credentials match the token credentials or false
otherwise.public byte[] createSecretKey()
null
if the Password child element is not available.public byte[] createSecretKey(char[] passwd)
passwd
- The password to use in the secret key generation. If the password is null
, the PasswordRetriever will be used to lookup the passwd.null
.public byte[] computePasswordDigest(byte[] nonce, WSUCreated created, char[] passwd)
nonce
- The nonce bytes.created
- The token creation timestamppasswd
- The password bytes. If the password is null
, the PasswordRetriever will be used to lookup the passwd.public oracle.security.xmlsec.util.QName getTokenName()
getTokenName
in interface WSSecurityToken
public java.lang.Object getToken()
Returns a java.lang.String containing the Username from the Username token.
getToken
in interface WSSecurityToken
public oracle.security.crypto.core.SymmetricKey getKey() throws WSSException
Returns the secret HMAC or Key byte[]
derived from the supplied password.
WSSException
public static void addPasswordRetriever(PasswordRetriever resolver)
PasswordRetriever
instance to lookup the password.resolver
- The resolver to use to lookup the password.public static void addKeyDerivator(KeyDerivator resolver)
KeyDerivatorResolver
instance for use in key identifier resolver operations.resolver
- The resolver to use for key derivation.
|
Oracle Security Developer Tools Web Services Security Java API Reference 10g (10.1.4.0.1) B28177-01 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |