@Override public byte[] getAssertionKeyInfoSecret(Crypto signatureCrypto, TokenCallbackHandler tokenCallbackHandler) throws WSSecurityException { RequestData requestData = new RequestData(); requestData.setCallbackHandler(tokenCallbackHandler); requestData.setSigCrypto(signatureCrypto); WSDocInfo docInfo = new WSDocInfo(assertion.getDOM().getOwnerDocument()); // TODO Improve .. // TODO change this to use SAMLAssertion parameter once wss4j conversion is done .... SAMLKeyInfo samlKi = SAMLUtil.getCredentialFromSubject(assertion, requestData, docInfo, true); return samlKi.getSecret(); }
WSDocInfo wsDocInfo = new WSDocInfo(securityHeader.getOwnerDocument()); wsDocInfo.setCallbackLookup(callbackLookup); wsDocInfo.setCrypto(requestData.getSigCrypto());
WSDocInfo wsDocInfo = new WSDocInfo(securityHeader.getOwnerDocument()); wsDocInfo.setCallbackLookup(callbackLookup); wsDocInfo.setCrypto(requestData.getSigCrypto());
/** * Decrypts the EncryptedKey element and returns the secret that was used. * @param callbackHandler Callback handler to pass to WSS4J framework. * @param crypto To get private key information. * @param encryptedKeyElement The encrypted Key element. * @return The secret as a byte stream. * @throws WSSecurityException If an error is occurred while decrypting the element. */ public static byte[] getDecryptedBytes(CallbackHandler callbackHandler, Crypto crypto, Node encryptedKeyElement) throws WSSecurityException { EncryptedKeyProcessor encryptedKeyProcessor = new EncryptedKeyProcessor(); RequestData requestData = new RequestData(); requestData.setCallbackHandler(callbackHandler); requestData.setDecCrypto(crypto); final WSSConfig cfg = WSSConfig.getNewInstance(); requestData.setWssConfig(cfg); WSDocInfo docInfo = new WSDocInfo(encryptedKeyElement.getOwnerDocument()); List<WSSecurityEngineResult> resultList; resultList = encryptedKeyProcessor.handleToken((Element) encryptedKeyElement, requestData, docInfo); WSSecurityEngineResult wsSecurityEngineResult = resultList.get(0); return (byte[]) wsSecurityEngineResult.get(WSSecurityEngineResult.TAG_SECRET); }
public void prepare(Document doc, WSSecHeader secHeader) throws WSSecurityException, ConversationException { super.prepare(doc); wsDocInfo = new WSDocInfo(doc); securityHeader = secHeader.getSecurityHeader(); sig = null;
public void prepare(Document doc, WSSecHeader secHeader) throws WSSecurityException, ConversationException { super.prepare(doc); wsDocInfo = new WSDocInfo(doc); securityHeader = secHeader.getSecurityHeader(); sig = null;
wsDocInfo = new WSDocInfo(doc); wsDocInfo.setCrypto(cr); securityHeader = secHeader.getSecurityHeader();
wsDocInfo = new WSDocInfo(doc); wsDocInfo.setCrypto(cr); securityHeader = secHeader.getSecurityHeader();
wsDocInfo = new WSDocInfo(doc);
wsDocInfo = new WSDocInfo(doc);