private String setupUTDerivedKey(UsernameToken sigToken) throws WSSecurityException { boolean useMac = hasSignedPartsOrElements(); WSSecUsernameToken usernameToken = addDKUsernameToken(sigToken, useMac); String id = usernameToken.getId(); byte[] secret = usernameToken.getDerivedKey(); Instant created = Instant.now(); Instant expires = created.plusSeconds(WSS4JUtils.getSecurityTokenLifetime(message) / 1000L); SecurityToken tempTok = new SecurityToken(id, usernameToken.getUsernameTokenElement(), created, expires); tempTok.setSecret(secret); tokenStore.add(tempTok); return id; }
private String setupUTDerivedKey(UsernameToken sigToken) throws WSSecurityException { boolean useMac = hasSignedPartsOrElements(); WSSecUsernameToken usernameToken = addDKUsernameToken(sigToken, useMac); String id = usernameToken.getId(); byte[] secret = usernameToken.getDerivedKey(); Instant created = Instant.now(); Instant expires = created.plusSeconds(WSS4JUtils.getSecurityTokenLifetime(message) / 1000L); SecurityToken tempTok = new SecurityToken(id, usernameToken.getUsernameTokenElement(), created, expires); tempTok.setSecret(secret); tokenStore.add(tempTok); return id; }
ret.add(new SupportingToken(token, utBuilder, null)); if (encryptedToken) { WSEncryptionPart part = new WSEncryptionPart(utBuilder.getId(), "Element"); part.setElement(utBuilder.getUsernameTokenElement()); encryptedTokensList.add(part); SecurityConstants.ALWAYS_ENCRYPT_UT, true)) { WSEncryptionPart part = new WSEncryptionPart(utBuilder.getId(), "Element"); part.setElement(utBuilder.getUsernameTokenElement()); encryptedTokensList.add(part);
ret.add(new SupportingToken(token, utBuilder, null)); if (encryptedToken) { WSEncryptionPart part = new WSEncryptionPart(utBuilder.getId(), "Element"); part.setElement(utBuilder.getUsernameTokenElement()); encryptedTokensList.add(part); SecurityConstants.ALWAYS_ENCRYPT_UT, true)) { WSEncryptionPart part = new WSEncryptionPart(utBuilder.getId(), "Element"); part.setElement(utBuilder.getUsernameTokenElement()); encryptedTokensList.add(part);
String id = utBuilder.getId();
String id = utBuilder.getId();
part = new WSEncryptionPart(unt.getId()); part.setElement(unt.getUsernameTokenElement()); } else if (tempTok instanceof BinarySecurity) {
part = new WSEncryptionPart(unt.getId()); part.setElement(unt.getUsernameTokenElement()); } else if (tempTok instanceof BinarySecurity) {
String id = usernameToken.getId(); byte[] secret = usernameToken.getDerivedKey();
String id = usernameToken.getId(); byte[] secret = usernameToken.getDerivedKey();
sign.setCustomTokenId(builder.getId()); sign.setSecretKey(builder.getDerivedKey()); sign.setKeyIdentifierType(WSConstants.CUSTOM_SYMM_SIGNING);