protected List<Integer> getSigEncrActions(List<WSSecurityEngineResult> results) { List<Integer> sigEncrActions = new ArrayList<Integer>(); for (WSSecurityEngineResult result : results) { Integer action = (Integer) (result) .get(WSSecurityEngineResult.TAG_ACTION); if (WSConstants.SIGN == action || WSConstants.ENCR == action) { sigEncrActions.add(action); } } return sigEncrActions; }
public WSSecurityEngineResult( int act, byte[] decryptedKey, byte[] encryptedKeyBytes, List<WSDataRef> dataRefUris ) { put(TAG_ACTION, Integer.valueOf(act)); put(TAG_SECRET, decryptedKey); put(TAG_ENCRYPTED_EPHEMERAL_KEY, encryptedKeyBytes); put(TAG_DATA_REF_URIS, dataRefUris); put(TAG_VALIDATED_TOKEN, Boolean.FALSE); }
encrKeyResults = encrKeyProc.handleToken(encryptedKeyElement, request, wsDocInfo); byte[] symmKey = (byte[])encrKeyResults.get(0).get(WSSecurityEngineResult.TAG_SECRET); key = WSSecurityUtil.prepareSecretKey(symEncAlgo, symmKey); } else { new WSSecurityEngineResult(WSConstants.ENCR, Collections.singletonList(dataRef)); String encryptedDataId = elem.getAttributeNS(null, "Id"); if (!"".equals(encryptedDataId)) { result.put(WSSecurityEngineResult.TAG_ID, encryptedDataId);
public List<WSSecurityEngineResult> handleToken( Element elem, RequestData data, WSDocInfo wsDocInfo ) throws WSSecurityException { if (log.isDebugEnabled()) { log.debug("Found reference list element"); } List<WSDataRef> dataRefs = handleReferenceList(elem, data, wsDocInfo); WSSecurityEngineResult result = new WSSecurityEngineResult(WSConstants.ENCR, dataRefs); String tokenId = elem.getAttributeNS(null, "Id"); if (!"".equals(tokenId)) { result.put(WSSecurityEngineResult.TAG_ID, tokenId); } wsDocInfo.addTokenElement(elem); wsDocInfo.addResult(result); return java.util.Collections.singletonList(result); }
engineResult = new WSSecurityEngineResult(WSConstants.UT, principal, null, null, null);
WSSecurityEngineResult wser = (WSSecurityEngineResult) wsSecEngineResults .get(j); if (wser.getAction() == WSConstants.UT && wser.getPrincipal() != null) { .getPrincipal();
for (int j = 0; j < res.getResults().size(); j++) { WSSecurityEngineResult secRes = (WSSecurityEngineResult) res.getResults().get(j); int action = secRes.getAction();
WSSecurityEngineResult result = wsDocInfo.getResult(id); if (result != null && WSConstants.ENCR == (Integer)result.get(WSSecurityEngineResult.TAG_ACTION) ) { return java.util.Collections.singletonList(result); decryptedBytes, data); WSSecurityEngineResult result = new WSSecurityEngineResult( WSConstants.ENCR, decryptedBytes, certs ); result.put( WSSecurityEngineResult.TAG_ENCRYPTED_KEY_TRANSPORT_METHOD, encryptedKeyTransportMethod String tokenId = elem.getAttributeNS(null, "Id"); if (!"".equals(tokenId)) { result.put(WSSecurityEngineResult.TAG_ID, tokenId); result.put(WSSecurityEngineResult.TAG_X509_REFERENCE_TYPE, strParser.getCertificatesReferenceType()); wsDocInfo.addResult(result); wsDocInfo.addTokenElement(elem);
public List<WSSecurityEngineResult> handleToken( Element elem, RequestData data, WSDocInfo wsDocInfo ) throws WSSecurityException { if (log.isDebugEnabled()) { log.debug("Found reference list element"); } List<WSDataRef> dataRefs = handleReferenceList(elem, data, wsDocInfo); WSSecurityEngineResult result = new WSSecurityEngineResult(WSConstants.ENCR, dataRefs); String tokenId = elem.getAttributeNS(null, "Id"); if (!"".equals(tokenId)) { result.put(WSSecurityEngineResult.TAG_ID, tokenId); } wsDocInfo.addTokenElement(elem); wsDocInfo.addResult(result); return java.util.Collections.singletonList(result); }
engineResult = new WSSecurityEngineResult(WSConstants.UT, principal, null, null, null);
protected List<WSSecurityEngineResult> getResults(List<WSSecurityEngineResult> results, int action) { List<WSSecurityEngineResult> list = new ArrayList<WSSecurityEngineResult>(); for (WSSecurityEngineResult result : results) { // Check the result of every action whether it matches the given // action Integer actInt = (Integer) result.get(WSSecurityEngineResult.TAG_ACTION); if (actInt == action) { list.add(result); } } return list; }
encrKeyResults = encrKeyProc.handleToken(encryptedKeyElement, request, wsDocInfo); byte[] symmKey = (byte[])encrKeyResults.get(0).get(WSSecurityEngineResult.TAG_SECRET); key = WSSecurityUtil.prepareSecretKey(symEncAlgo, symmKey); } else { new WSSecurityEngineResult(WSConstants.ENCR, Collections.singletonList(dataRef)); String encryptedDataId = elem.getAttributeNS(null, "Id"); if (!"".equals(encryptedDataId)) { result.put(WSSecurityEngineResult.TAG_ID, encryptedDataId);
new WSSecurityEngineResult(WSConstants.SC, sigConf); if (!"".equals(id)) { result.put(WSSecurityEngineResult.TAG_ID, id);
public WSSecurityEngineResult( int act, byte[] decryptedKey, byte[] encryptedKeyBytes, List<WSDataRef> dataRefUris ) { put(TAG_ACTION, Integer.valueOf(act)); put(TAG_SECRET, decryptedKey); put(TAG_ENCRYPTED_EPHEMERAL_KEY, encryptedKeyBytes); put(TAG_DATA_REF_URIS, dataRefUris); put(TAG_VALIDATED_TOKEN, Boolean.FALSE); }
engineResult = new WSSecurityEngineResult(WSConstants.UT, principal, null, null, null);
/** * Fetch the result of a given action from a given result list * * @param resultList The result list to fetch an action from * @param action The action to fetch * @return The last result fetched from the result list, null if the result * could not be found */ public static WSSecurityEngineResult fetchActionResult( List<WSSecurityEngineResult> resultList, int action ) { WSSecurityEngineResult returnResult = null; for (WSSecurityEngineResult result : resultList) { // // Check the result of every action whether it matches the given action // int resultAction = ((java.lang.Integer)result.get(WSSecurityEngineResult.TAG_ACTION)).intValue(); if (resultAction == action) { returnResult = result; } } return returnResult; }
WSSecurityEngineResult result = wsDocInfo.getResult(id); if (result != null && WSConstants.ENCR == (Integer)result.get(WSSecurityEngineResult.TAG_ACTION) ) { return java.util.Collections.singletonList(result); decryptedBytes, data); WSSecurityEngineResult result = new WSSecurityEngineResult( WSConstants.ENCR, decryptedBytes, certs ); result.put( WSSecurityEngineResult.TAG_ENCRYPTED_KEY_TRANSPORT_METHOD, encryptedKeyTransportMethod String tokenId = elem.getAttributeNS(null, "Id"); if (!"".equals(tokenId)) { result.put(WSSecurityEngineResult.TAG_ID, tokenId); result.put(WSSecurityEngineResult.TAG_X509_REFERENCE_TYPE, strParser.getCertificatesReferenceType()); wsDocInfo.addResult(result); wsDocInfo.addTokenElement(elem);
new WSSecurityEngineResult(WSConstants.SC, sigConf); if (!"".equals(id)) { result.put(WSSecurityEngineResult.TAG_ID, id);
engineResult = new WSSecurityEngineResult(WSConstants.UT, principal, null, null, null);