本文整理了Java中org.apache.ws.security.WSEncryptionPart.<init>()
方法的一些代码示例,展示了WSEncryptionPart.<init>()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WSEncryptionPart.<init>()
方法的具体详情如下:
包路径:org.apache.ws.security.WSEncryptionPart
类名称:WSEncryptionPart
方法名:<init>
[英]Constructor to initialize part structure with element id. This constructor initializes the parts structure to lookup for a an element with the given Id to encrypt or sign.
[中]构造函数初始化具有元素id的部件结构。此构造函数初始化部件结构以查找具有给定id的元素以进行加密或签名。
代码示例来源:origin: org.apache.rampart/rampart-core
/**
* @param namespace
* The namespace of the part.
* @param element
* The part's element name.
*/
public void setEncryptedParts(String namespace, String element) {
WSEncryptionPart wep = new WSEncryptionPart(element, namespace,
"Element");
encryptedParts.add(wep);
}
代码示例来源:origin: org.apache.rampart/rampart-core
/**
* @param namespace
* The namespace of the part.
* @param element
* The part's element name.
*/
public void addSignedPart(String namespace, String element) {
WSEncryptionPart wep = new WSEncryptionPart(element, namespace,
"Content");
signedParts.add(wep);
}
代码示例来源:origin: org.apache.rampart/rampart-core
/**
* @param namespace
* The namespace of the part.
* @param element
* The part's element name.
* @param modifier
* The type of encryption
* Element,Content,Header
*/
public void setEncryptedParts(String namespace, String element,
String modifier) {
WSEncryptionPart wep = new WSEncryptionPart(element, namespace,
modifier);
encryptedParts.add(wep);
}
代码示例来源:origin: org.apache.rampart/rampart-core
/**
* @param tokenMap
* @param sigParts
* @throws RampartException
*/
protected List<WSEncryptionPart> addSignatureParts(HashMap tokenMap, List<WSEncryptionPart> sigParts)
throws RampartException {
Set entrySet = tokenMap.entrySet();
for (Object anEntrySet : entrySet) {
Object tempTok = ((Entry) anEntrySet).getValue();
WSEncryptionPart part = null;
if (tempTok instanceof org.apache.rahas.Token) {
part = new WSEncryptionPart(
((org.apache.rahas.Token) tempTok).getId());
} else if (tempTok instanceof WSSecSignature) {
WSSecSignature tempSig = (WSSecSignature) tempTok;
if (tempSig.getBSTTokenId() != null) {
part = new WSEncryptionPart(tempSig.getBSTTokenId());
}
} else {
throw new RampartException("UnsupportedTokenInSupportingToken");
}
sigParts.add(part);
}
return sigParts;
}
代码示例来源:origin: org.apache.rampart/rampart-core
/**
* Creates an encryption part. Could be a part or could be an element pointed through xpath expression.
* @param name Name of the element.
* @param id The id of the element
* @param namespace Namespace of the element.
* @param modifier Modifier "Content" or "Element"
* @param xPath The xPath expression
* @return A WSEncryptionPart
*/
public static WSEncryptionPart createEncryptionPart(String name, String id,
String namespace, String modifier,String xPath) {
// The part name must not be null !!
assert name != null;
WSEncryptionPart wsEncryptionPart = new WSEncryptionPart(name, namespace, modifier);
wsEncryptionPart.setId(id);
wsEncryptionPart.setXpath(xPath);
return wsEncryptionPart;
}
代码示例来源:origin: org.apache.ws.security/wss4j
new WSEncryptionPart(partDef[0].trim(),
reqData.getSoapConstants().getEnvelopeURI(),
"Content");
);
encPart = new WSEncryptionPart(element, nmSpace, mode);
} else {
throw new WSSecurityException("WSHandler: wrong part definition: " + tmpS);
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.wss4j
new WSEncryptionPart(partDef[0].trim(),
reqData.getSoapConstants().getEnvelopeURI(),
"Content");
);
encPart = new WSEncryptionPart(element, nmSpace, mode);
} else {
throw new WSSecurityException("WSHandler: wrong part definition: " + tmpS);
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.wss4j
public Document build(Document doc, WSSecHeader secHeader)
throws WSSecurityException, ConversationException {
//
// Setup the encrypted key
//
prepare(doc);
envelope = doc.getDocumentElement();
//
// prepend elements in the right order to the security header
//
prependDKElementToHeader(secHeader);
String soapNamespace = WSSecurityUtil.getSOAPNamespace(envelope);
if (parts == null) {
parts = new ArrayList<WSEncryptionPart>(1);
WSEncryptionPart encP =
new WSEncryptionPart(
WSConstants.ELEM_BODY,
soapNamespace,
"Content"
);
parts.add(encP);
}
Element externRefList = encryptForExternalRef(null, parts);
addExternalRefElement(externRefList, secHeader);
return doc;
}
代码示例来源:origin: org.apache.ws.security/wss4j
public Document build(Document doc, WSSecHeader secHeader)
throws WSSecurityException, ConversationException {
//
// Setup the encrypted key
//
prepare(doc);
envelope = doc.getDocumentElement();
//
// prepend elements in the right order to the security header
//
prependDKElementToHeader(secHeader);
String soapNamespace = WSSecurityUtil.getSOAPNamespace(envelope);
if (parts == null) {
parts = new ArrayList<WSEncryptionPart>(1);
WSEncryptionPart encP =
new WSEncryptionPart(
WSConstants.ELEM_BODY,
soapNamespace,
"Content"
);
parts.add(encP);
}
Element externRefList = encryptForExternalRef(null, parts);
addExternalRefElement(externRefList, secHeader);
return doc;
}
代码示例来源:origin: org.apache.ws.security/wss4j
parts = new ArrayList<WSEncryptionPart>(1);
WSEncryptionPart encP =
new WSEncryptionPart(
WSConstants.ELEM_BODY,
soapNamespace,
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.wss4j
parts = new ArrayList<WSEncryptionPart>(1);
WSEncryptionPart encP =
new WSEncryptionPart(
WSConstants.ELEM_BODY,
soapNamespace,
代码示例来源:origin: org.apache.rampart/rampart-core
sigParts.add(new WSEncryptionPart(this.mainSigId));
sigParts.add(new WSEncryptionPart(tok.getId()));
if (rmd.getPolicyData().isTokenProtection() &&
sig.getBSTTokenId() != null) {
sigParts.add(new WSEncryptionPart(sig.getBSTTokenId()));
代码示例来源:origin: org.apache.ws.security/wss4j
String soapNamespace = WSSecurityUtil.getSOAPNamespace(doc.getDocumentElement());
WSEncryptionPart encP =
new WSEncryptionPart(
WSConstants.ELEM_BODY,
soapNamespace,
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.wss4j
String soapNamespace = WSSecurityUtil.getSOAPNamespace(doc.getDocumentElement());
WSEncryptionPart encP =
new WSEncryptionPart(
WSConstants.ELEM_BODY,
soapNamespace,
代码示例来源:origin: org.apache.ws.security/wss4j
byte[] sigVal = (byte[]) wsr.get(WSSecurityEngineResult.TAG_SIGNATURE_VALUE);
wsc.build(doc, sigVal, reqData.getSecHeader());
signatureParts.add(new WSEncryptionPart(wsc.getId()));
signatureParts.add(new WSEncryptionPart(wsc.getId()));
代码示例来源:origin: be.e_contract.mycarenet/mycarenet-ehealth-common
SOAPConstants soapConstants = WSSecurityUtil.getSOAPConstants(soapPart
.getDocumentElement());
signParts.add(new WSEncryptionPart(soapConstants.getBodyQName()
.getLocalPart(), soapConstants.getEnvelopeURI(), "Content"));
signParts.add(new WSEncryptionPart(wsSecTimeStamp.getId()));
List<Reference> referenceList = wsSecSignature.addReferencesToSign(
signParts, wsSecHeader);
代码示例来源:origin: be.e_contract.mycarenet/mycarenet-ehealth-saml-sts
SOAPConstants soapConstants = WSSecurityUtil.getSOAPConstants(soapPart
.getDocumentElement());
signParts.add(new WSEncryptionPart(soapConstants.getBodyQName()
.getLocalPart(), soapConstants.getEnvelopeURI(), "Content"));
signParts.add(new WSEncryptionPart(bstId));
signParts.add(new WSEncryptionPart(wsSecTimeStamp.getId()));
List<Reference> referenceList = sign.addReferencesToSign(signParts,
wsSecHeader);
代码示例来源:origin: org.apache.rampart/rampart-core
RampartUtil.appendChildToSecHeader(rmd, wsc.getSignatureConfirmationElement());
if (sigParts != null) {
sigParts.add(new WSEncryptionPart(wsc.getId()));
RampartUtil.appendChildToSecHeader(rmd, wsc.getSignatureConfirmationElement());
if(sigParts != null) {
sigParts.add(new WSEncryptionPart(wsc.getId()));
代码示例来源:origin: org.apache.rampart/rampart-core
supportingSigParts.add(new WSEncryptionPart(supportingSig.getBSTTokenId()));
代码示例来源:origin: CyberSource/cybersource-sdk-java
WSEncryptionPart msgBodyPart = new WSEncryptionPart(WSConstants.ELEM_BODY, WSConstants.URI_SOAP11_ENV, "");
sign.setParts(Collections.singletonList(msgBodyPart));
try {
内容来源于网络,如有侵权,请联系作者删除!