本文整理了Java中org.apache.wss4j.dom.WSDocInfo
类的一些代码示例,展示了WSDocInfo
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WSDocInfo
类的具体详情如下:
包路径:org.apache.wss4j.dom.WSDocInfo
类名称:WSDocInfo
暂无
代码示例来源:origin: org.apache.cxf/cxf-rt-ws-security
wsDocInfo = new WSDocInfo(secHeader.getSecurityHeaderElement().getOwnerDocument());
代码示例来源:origin: org.apache.wss4j/wss4j-ws-security-dom
Element foundElement = data.getWsDocInfo().getTokenElement(id);
if (elem.equals(foundElement)) {
WSSecurityEngineResult result = data.getWsDocInfo().getResult(id);
return java.util.Collections.singletonList(result);
} else if (foundElement != null) {
data.getWsDocInfo().addTokenElement(elem);
WSSecurityEngineResult result = null;
if (samlAssertion.isSigned()) {
data.getWsDocInfo().addResult(result);
return java.util.Collections.singletonList(result);
代码示例来源:origin: org.apache.wss4j/wss4j-ws-security-dom
WSDocInfo wsDocInfo = new WSDocInfo(securityHeader.getOwnerDocument());
CallbackLookup callbackLookupToUse = callbackLookup;
if (callbackLookupToUse == null) {
callbackLookupToUse = new DOMCallbackLookup(securityHeader.getOwnerDocument());
wsDocInfo.setCallbackLookup(callbackLookupToUse);
wsDocInfo.setCrypto(requestData.getSigVerCrypto());
wsDocInfo.setSecurityHeader(securityHeader);
requestData.setWsDocInfo(wsDocInfo);
new WSHandlerResult(requestData.getActor(), returnResults, wsDocInfo.getActionResults());
wsDocInfo.clear();
代码示例来源:origin: org.apache.wss4j/wss4j-ws-security-dom
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);
}
代码示例来源:origin: holodeck-b2b/Holodeck-B2B
final WSDocInfo wsDocInfo = new WSDocInfo(securityHeader.getOwnerDocument());
wsDocInfo.setCrypto(requestData.getSigVerCrypto());
wsDocInfo.setSecurityHeader(securityHeader);
final WSSConfig wssConfig = requestData.getWssConfig();
代码示例来源:origin: org.apache.wss4j/wss4j-ws-security-dom
WSDocInfo wsDocInfo = new WSDocInfo(getDocument());
super.setWsDocInfo(wsDocInfo);
cryptoType.setAlias(issuerKeyName);
certs = issuerCrypto.getX509Certificates(cryptoType);
getWsDocInfo().setCrypto(issuerCrypto);
} else {
publicKey = samlKeyInfo.getPublicKey();
certs = samlKeyInfo.getCerts();
getWsDocInfo().setCrypto(userCrypto);
elem.appendChild(keyId);
getWsDocInfo().addTokenElement(secRefSaml.getElement(), false);
configureKeyInfo(secRef, cert, iCrypto != null ? iCrypto : uCrypto, samlAssertion);
getWsDocInfo().addTokenElement(samlToken, false);
代码示例来源:origin: org.apache.wss4j/wss4j-ws-security-dom
WSDocInfo wsDocInfo = getWsDocInfo();
if (wsDocInfo == null) {
wsDocInfo = new WSDocInfo(getDocument());
super.setWsDocInfo(wsDocInfo);
wsDocInfo.setCrypto(cr);
代码示例来源:origin: org.apache.wss4j/wss4j-ws-security-dom
public void prepare() throws WSSecurityException {
super.prepare();
wsDocInfo = new WSDocInfo(getDocument());
sig = null;
wsDocInfo.addTokenElement(secRef.getElement(), false);
KeyInfoFactory keyInfoFactory = signatureFactory.getKeyInfoFactory();
keyInfo =
代码示例来源:origin: org.apache.wss4j/wss4j-ws-security-dom
data.getWsDocInfo().getResultsByTag(WSConstants.SIGN);
SignatureUtils.verifySignedElement(elem, signedResults);
String uri = retrievalMethodElement.getAttributeNS(null, "URI");
uri = XMLUtils.getIDFromReference(uri);
WSSecurityEngineResult result = data.getWsDocInfo().getResult(uri);
if (result != null) {
byte[] symmKey = (byte[])result.get(WSSecurityEngineResult.TAG_SECRET);
result.put(WSSecurityEngineResult.TAG_ID, encryptedDataId);
data.getWsDocInfo().addResult(result);
data.getWsDocInfo().addTokenElement(elem);
代码示例来源:origin: org.apache.wss4j/wss4j-ws-security-dom
WSSecurityEngineResult result = data.getWsDocInfo().getResult(id);
if (result != null
&& WSConstants.ENCR == (Integer)result.get(WSSecurityEngineResult.TAG_ACTION)
result.put(WSSecurityEngineResult.TAG_PUBLIC_KEY, publicKey);
data.getWsDocInfo().addResult(result);
data.getWsDocInfo().addTokenElement(elem);
return Collections.singletonList(result);
代码示例来源:origin: org.apache.wss4j/wss4j-ws-security-dom
private Element findMatchingExpandedElement(Element element) {
Element matchingElement = null;
if (element.hasAttributeNS(WSConstants.WSU_NS, "Id")) {
String id = element.getAttributeNS(WSConstants.WSU_NS, "Id");
matchingElement = wsDocInfo.getTokenElement(id);
}
if (matchingElement == null && element.hasAttributeNS(null, "Id")) {
String id = element.getAttributeNS(null, "Id");
matchingElement = wsDocInfo.getTokenElement(id);
}
// Check the Elements are the same
if (matchingElement != null && matchingElement.getNamespaceURI().equals(element.getNamespaceURI())
&& matchingElement.getLocalName().equals(element.getLocalName())) {
return matchingElement;
}
return null;
}
代码示例来源:origin: org.apache.wss4j/wss4j-ws-security-dom
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);
}
代码示例来源:origin: org.apache.wss4j/wss4j-ws-security-dom
Element token = docInfo.getTokenElement(id);
if (token != null) {
return token;
代码示例来源:origin: apache/cxf
wsDocInfo = new WSDocInfo(secHeader.getSecurityHeaderElement().getOwnerDocument());
代码示例来源:origin: org.apache.wss4j/wss4j-ws-security-dom
Element foundElement = data.getWsDocInfo().getTokenElement(id);
if (elem.equals(foundElement)) {
WSSecurityEngineResult result = data.getWsDocInfo().getResult(id);
return java.util.Collections.singletonList(result);
} else if (foundElement != null) {
data.getWsDocInfo().addTokenElement(elem);
if (!"".equals(id)) {
result.put(WSSecurityEngineResult.TAG_ID, id);
data.getWsDocInfo().addResult(result);
return java.util.Collections.singletonList(result);
代码示例来源:origin: org.apache.wss4j/wss4j-ws-security-dom
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);
}
代码示例来源:origin: holodeck-b2b/Holodeck-B2B
final Element encryptionMethod = (Element) wss4jDocInfo.getTokenElement(
(String) decResult.get(WSSecurityEngineResult.TAG_ID))
.getFirstChild();
代码示例来源:origin: apache/cxf
private List<WSSecurityEngineResult> processToken(Element tokenElement, final SoapMessage message)
throws WSSecurityException {
RequestData data = new CXFRequestData();
Object o = SecurityUtils.getSecurityPropertyValue(SecurityConstants.CALLBACK_HANDLER, message);
try {
data.setCallbackHandler(SecurityUtils.getCallbackHandler(o));
} catch (Exception ex) {
throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, ex);
}
data.setMsgContext(message);
data.setWssConfig(WSSConfig.getNewInstance());
WSDocInfo wsDocInfo = new WSDocInfo(tokenElement.getOwnerDocument());
data.setWsDocInfo(wsDocInfo);
BinarySecurityTokenProcessor p = new BinarySecurityTokenProcessor();
return p.handleToken(tokenElement, data);
}
代码示例来源:origin: org.apache.wss4j/wss4j-ws-security-dom
Element foundElement = data.getWsDocInfo().getTokenElement(id);
if (elem.equals(foundElement)) {
WSSecurityEngineResult result = data.getWsDocInfo().getResult(id);
return java.util.Collections.singletonList(result);
} else if (foundElement != null) {
data.getWsDocInfo().addTokenElement(elem);
data.getWsDocInfo().addResult(result);
return java.util.Collections.singletonList(result);
代码示例来源:origin: org.apache.wss4j/wss4j-ws-security-dom
data.getWsDocInfo().addTokenElement(elem);
data.getWsDocInfo().addResult(result);
return java.util.Collections.singletonList(result);
内容来源于网络,如有侵权,请联系作者删除!