public WSSecurityEngineResult( int act, byte[] decryptedKey, byte[] encryptedKeyBytes, List<WSDataRef> dataRefUris ) { put(TAG_ACTION, act); put(TAG_SECRET, decryptedKey); put(TAG_ENCRYPTED_EPHEMERAL_KEY, encryptedKeyBytes); put(TAG_DATA_REF_URIS, dataRefUris); put(TAG_VALIDATED_TOKEN, Boolean.FALSE); }
public WSSecurityEngineResult(int act) { put(TAG_ACTION, act); }
public WSSecurityEngineResult( int act, Principal princ, X509Certificate[] certs, byte[] sv ) { put(TAG_ACTION, act); put(TAG_PRINCIPAL, princ); put(TAG_X509_CERTIFICATES, certs); put(TAG_SIGNATURE_VALUE, sv); if (certs != null) { put(TAG_X509_CERTIFICATE, certs[0]); } put(TAG_VALIDATED_TOKEN, Boolean.FALSE); }
public WSSecurityEngineResult(int act, BinarySecurity token, X509Certificate[] certs) { put(TAG_ACTION, act); put(TAG_BINARY_SECURITY_TOKEN, token); put(TAG_X509_CERTIFICATES, certs); if (certs != null) { put(TAG_X509_CERTIFICATE, certs[0]); } put(TAG_VALIDATED_TOKEN, Boolean.FALSE); put(TAG_TOKEN_ELEMENT, token.getElement()); }
public WSSecurityEngineResult( int act, byte[] decryptedKey, byte[] encryptedKeyBytes, List<WSDataRef> dataRefUris, X509Certificate[] certs ) { put(TAG_ACTION, act); put(TAG_SECRET, decryptedKey); put(TAG_ENCRYPTED_EPHEMERAL_KEY, encryptedKeyBytes); put(TAG_DATA_REF_URIS, dataRefUris); put(TAG_X509_CERTIFICATES, certs); if (certs != null) { put(TAG_X509_CERTIFICATE, certs[0]); } put(TAG_VALIDATED_TOKEN, Boolean.FALSE); }
public List<WSSecurityEngineResult> handleToken( Element elem, RequestData data ) throws WSSecurityException { LOG.debug("Found reference list element"); List<WSDataRef> dataRefs = handleReferenceList(elem, data); WSSecurityEngineResult result = new WSSecurityEngineResult(WSConstants.ENCR, dataRefs); String tokenId = elem.getAttributeNS(null, "Id"); if (!"".equals(tokenId)) { result.put(WSSecurityEngineResult.TAG_ID, tokenId); } data.getWsDocInfo().addTokenElement(elem); data.getWsDocInfo().addResult(result); return Collections.singletonList(result); }
private void storeResults(UsernameTokenPrincipal principal, Subject subject, SoapMessage message) { List<WSSecurityEngineResult> v = new ArrayList<>(); int action = WSConstants.UT; if (principal.getPassword() == null) { action = WSConstants.UT_NOPASSWORD; } WSSecurityEngineResult result = new WSSecurityEngineResult(action, principal, null, null, null); if (subject != null) { result.put(WSSecurityEngineResult.TAG_SUBJECT, subject); } v.add(0, result); List<WSHandlerResult> results = CastUtils.cast((List<?>)message .get(WSHandlerConstants.RECV_RESULTS)); if (results == null) { results = new ArrayList<>(); message.put(WSHandlerConstants.RECV_RESULTS, results); } WSHandlerResult rResult = new WSHandlerResult(null, v, Collections.singletonMap(action, v)); results.add(0, rResult); assertTokens(message, principal, false); }
private void storeResults(UsernameTokenPrincipal principal, Subject subject, SoapMessage message) { List<WSSecurityEngineResult> v = new ArrayList<>(); int action = WSConstants.UT; if (principal.getPassword() == null) { action = WSConstants.UT_NOPASSWORD; } WSSecurityEngineResult result = new WSSecurityEngineResult(action, principal, null, null, null); if (subject != null) { result.put(WSSecurityEngineResult.TAG_SUBJECT, subject); } v.add(0, result); List<WSHandlerResult> results = CastUtils.cast((List<?>)message .get(WSHandlerConstants.RECV_RESULTS)); if (results == null) { results = new ArrayList<>(); message.put(WSHandlerConstants.RECV_RESULTS, results); } WSHandlerResult rResult = new WSHandlerResult(null, v, Collections.singletonMap(action, v)); results.add(0, rResult); assertTokens(message, principal, false); }
public List<WSSecurityEngineResult> handleToken( Element elem, RequestData data ) throws WSSecurityException { LOG.debug("Found SignatureConfirmation list element"); // // Decode SignatureConfirmation, just store in result // SignatureConfirmation sigConf = new SignatureConfirmation(elem, data.getBSPEnforcer()); WSSecurityEngineResult result = new WSSecurityEngineResult(WSConstants.SC, sigConf); String tokenId = sigConf.getID(); if (!"".equals(tokenId)) { result.put(WSSecurityEngineResult.TAG_ID, tokenId); } data.getWsDocInfo().addResult(result); data.getWsDocInfo().addTokenElement(elem); return java.util.Collections.singletonList(result); }
if (samlAssertion.isSigned()) { result = new WSSecurityEngineResult(WSConstants.ST_SIGNED, samlAssertion); result.put(WSSecurityEngineResult.TAG_DATA_REF_URIS, dataRefs); } else { result = new WSSecurityEngineResult(WSConstants.ST_UNSIGNED, samlAssertion); result.put(WSSecurityEngineResult.TAG_ID, id); result.put(WSSecurityEngineResult.TAG_VALIDATED_TOKEN, Boolean.TRUE); if (credential.getTransformedToken() != null) { result.put( WSSecurityEngineResult.TAG_TRANSFORMED_TOKEN, credential.getTransformedToken() ); if (credential.getPrincipal() != null) { result.put(WSSecurityEngineResult.TAG_PRINCIPAL, credential.getPrincipal()); } else { SAMLTokenPrincipalImpl samlPrincipal = new SAMLTokenPrincipalImpl(credential.getTransformedToken()); result.put(WSSecurityEngineResult.TAG_PRINCIPAL, samlPrincipal); result.put(WSSecurityEngineResult.TAG_PRINCIPAL, credential.getPrincipal()); } else { result.put(WSSecurityEngineResult.TAG_PRINCIPAL, new SAMLTokenPrincipalImpl(samlAssertion)); result.put(WSSecurityEngineResult.TAG_SUBJECT, credential.getSubject());
result.put(WSSecurityEngineResult.TAG_VALIDATED_TOKEN, Boolean.TRUE); String tokenId = sct.getID(); if (!"".equals(tokenId)) { result.put(WSSecurityEngineResult.TAG_ID, tokenId); result.put(WSSecurityEngineResult.TAG_SECRET, returnedCredential.getSecretKey()); } else { String id = sct.getID(); secret = getSecret(data.getCallbackHandler(), id); result.put(WSSecurityEngineResult.TAG_ID, sct.getID()); result.put(WSSecurityEngineResult.TAG_SECRET, secret);
public List<WSSecurityEngineResult> handleToken( Element elem, RequestData data ) throws WSSecurityException { LOG.debug("Found Timestamp list element"); // // Decode Timestamp, add the found time (created/expiry) to result // Timestamp timestamp = new Timestamp(elem, data.getBSPEnforcer()); Credential credential = new Credential(); credential.setTimestamp(timestamp); WSSecurityEngineResult result = new WSSecurityEngineResult(WSConstants.TS, timestamp); String tokenId = timestamp.getID(); if (!"".equals(tokenId)) { result.put(WSSecurityEngineResult.TAG_ID, tokenId); } Validator validator = data.getValidator(WSConstants.TIMESTAMP); if (validator != null) { validator.validate(credential, data); result.put(WSSecurityEngineResult.TAG_VALIDATED_TOKEN, Boolean.TRUE); } data.getWsDocInfo().addTokenElement(elem); data.getWsDocInfo().addResult(result); return java.util.Collections.singletonList(result); }
String tokenId = token.getID(); if (!"".equals(tokenId)) { result.put(WSSecurityEngineResult.TAG_ID, tokenId); result.put(WSSecurityEngineResult.TAG_SECRET, secretKey); result.put(WSSecurityEngineResult.TAG_VALIDATED_TOKEN, Boolean.TRUE); if (credential.getTransformedToken() != null) { result.put( WSSecurityEngineResult.TAG_TRANSFORMED_TOKEN, credential.getTransformedToken() ); if (credential.getPrincipal() != null) { result.put(WSSecurityEngineResult.TAG_PRINCIPAL, credential.getPrincipal()); } else { SAMLTokenPrincipalImpl samlPrincipal = new SAMLTokenPrincipalImpl(credential.getTransformedToken()); result.put(WSSecurityEngineResult.TAG_PRINCIPAL, samlPrincipal); result.put(WSSecurityEngineResult.TAG_PRINCIPAL, credential.getPrincipal()); } else { WSUsernameTokenPrincipalImpl principal = principal.setCreatedTime(token.getCreated()); principal.setPasswordType(token.getPasswordType()); result.put(WSSecurityEngineResult.TAG_PRINCIPAL, principal); result.put(WSSecurityEngineResult.TAG_SUBJECT, credential.getSubject());
String tokenId = dkt.getID(); if (!"".equals(tokenId)) { result.put(WSSecurityEngineResult.TAG_ID, tokenId); result.put(WSSecurityEngineResult.TAG_DERIVED_KEY_TOKEN, dkt); result.put(WSSecurityEngineResult.TAG_SECRET, secret); result.put(WSSecurityEngineResult.TAG_TOKEN_ELEMENT, dkt.getElement()); data.getWsDocInfo().addResult(result); return Collections.singletonList(result);