if(log.isLoggable(Level.WARNING)){
log.log(Level.WARNING, "None of the specified Encryption Parts found in the Message");
}
}
EncryptedKey _encryptedKey = null;
ReferenceListHeaderBlock _ekReferenceList = null;
ReferenceListHeaderBlock _standaloneReferenceList = null;
if (_keyEncryptor != null && !skbX509TokenInserted) {
try {
if(!dktSender){
_encryptedKey = _keyEncryptor.encryptKey(secureMsg.getSOAPPart(), _symmetricKey);
} else{
_encryptedKey = _keyEncryptor.encryptKey(secureMsg.getSOAPPart(), originalKey);
}
_encryptedKey.setId(ekId);
ekCache.put(x509TokenId, ekId);
KeyInfoHeaderBlock keyInfoBlock = new KeyInfoHeaderBlock(secureMsg.getSOAPPart());
if (samlTokenRef != null) {
keyInfoBlock.addSecurityTokenReference(samlTokenRef);
} else if(_x509Cert != null){
keyInfoStrategy.insertKey(keyInfoBlock, secureMsg, x509TokenId);
}else if(keyEncSK != null){
//keyInfoStrategy.insertKey(keyInfoBlock, secureMsg,null);
keyInfoBlock.addKeyName(symmetricKeyName);
}
KeyInfo keyInfo = keyInfoBlock.getKeyInfo(); /*new KeyInfo(keyInfoBlock.getAsSoapElement(), null); */
_encryptedKey.setKeyInfo(keyInfo);
} catch (Exception xe) {
log.log(Level.SEVERE, "WSS1223.unableto.set.KeyInfo.EncryptedKey", xe);
//xe.printStackTrace();
throw new XWSSecurityException(xe);