if (id != null && id.length() > 0)
setId(id);
Element child = Util.getFirstChildElement(element);
if (child == null || ! Constants.WSSE_NS.equals(child.getNamespaceURI()) || ! "Username".equals(child.getLocalName()))
throw new WSSecurityException("Username child expected in UsernameToken element");
this.username = XMLUtils.getFullTextChildrenFromElement(child);
child = Util.getNextSiblingElement(child);
if (child == null || ! Constants.WSSE_NS.equals(child.getNamespaceURI()) || ! "Password".equals(child.getLocalName()))
throw new WSSecurityException("Password child expected in UsernameToken element");
this.password = XMLUtils.getFullTextChildrenFromElement(child);
String passwordType = child.getAttribute("Type");
this.digest = Constants.PASSWORD_DIGEST_TYPE.equals(passwordType);
Iterator<Element> itNonce = DOMUtils.getChildElements(element, new QName(Constants.WSSE_NS, "Nonce"));
if (itNonce != null && itNonce.hasNext())
{
Element elem = itNonce.next();
String encodingType = elem.getAttribute("EncodingType");
if (encodingType != null && encodingType.length() > 0 && !Constants.BASE64_ENCODING_TYPE.equalsIgnoreCase(encodingType))
throw new WSSecurityException("Unsupported nonce encoding type: " + encodingType);
this.nonce = XMLUtils.getFullTextChildrenFromElement(elem);
}
Iterator<Element> itCreated = DOMUtils.getChildElements(element, new QName(Constants.WSU_NS, "Created"));
if (itCreated != null && itCreated.hasNext())