/** * Creates a Username token. * * The method prepares and initializes a WSSec UsernameToken structure after * the relevant information was set. A Before calling * <code>prepare()</code> all parameters such as user, password, * passwordType etc. must be set. A complete <code>UsernameToken</code> is * constructed. * * @param doc The SOAP envelope as W3C document */ public void prepare(Document doc) { ut = new UsernameToken(getWsConfig().isPrecisionInMilliSeconds(), doc, getWsConfig().getCurrentTime(), passwordType); ut.setPasswordsAreEncoded(passwordsAreEncoded); ut.setName(user); if (useDerivedKey) { saltValue = ut.addSalt(doc, saltValue, useMac); ut.addIteration(doc, iteration); } else { ut.setPassword(password); } if (nonce) { ut.addNonce(doc); } if (created) { ut.addCreated(getWsConfig().isPrecisionInMilliSeconds(), getWsConfig().getCurrentTime(), doc); } ut.setID(getWsConfig().getIdAllocator().createId("UsernameToken-", ut)); }
/** * Creates a Username token. * * The method prepares and initializes a WSSec UsernameToken structure after * the relevant information was set. A Before calling * <code>prepare()</code> all parameters such as user, password, * passwordType etc. must be set. A complete <code>UsernameToken</code> is * constructed. * * @param doc The SOAP envelope as W3C document */ public void prepare(Document doc) { ut = new UsernameToken(getWsConfig().isPrecisionInMilliSeconds(), doc, getWsConfig().getCurrentTime(), passwordType); ut.setPasswordsAreEncoded(passwordsAreEncoded); ut.setName(user); if (useDerivedKey) { saltValue = ut.addSalt(doc, saltValue, useMac); ut.addIteration(doc, iteration); } else { ut.setPassword(password); } if (nonce) { ut.addNonce(doc); } if (created) { ut.addCreated(getWsConfig().isPrecisionInMilliSeconds(), getWsConfig().getCurrentTime(), doc); } ut.setID(getWsConfig().getIdAllocator().createId("UsernameToken-", ut)); }