本文整理汇总了Java中com.sun.org.apache.xml.internal.security.utils.XMLUtils.createElementInEncryption11Space方法的典型用法代码示例。如果您正苦于以下问题:Java XMLUtils.createElementInEncryption11Space方法的具体用法?Java XMLUtils.createElementInEncryption11Space怎么用?Java XMLUtils.createElementInEncryption11Space使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.sun.org.apache.xml.internal.security.utils.XMLUtils
的用法示例。
在下文中一共展示了XMLUtils.createElementInEncryption11Space方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: toElement
import com.sun.org.apache.xml.internal.security.utils.XMLUtils; //导入方法依赖的package包/类
Element toElement() {
Element result =
XMLUtils.createElementInEncryptionSpace(
contextDocument, EncryptionConstants._TAG_ENCRYPTIONMETHOD
);
result.setAttributeNS(null, EncryptionConstants._ATT_ALGORITHM, algorithm);
if (keySize > 0) {
result.appendChild(
XMLUtils.createElementInEncryptionSpace(
contextDocument, EncryptionConstants._TAG_KEYSIZE
).appendChild(contextDocument.createTextNode(String.valueOf(keySize))));
}
if (null != oaepParams) {
Element oaepElement =
XMLUtils.createElementInEncryptionSpace(
contextDocument, EncryptionConstants._TAG_OAEPPARAMS
);
oaepElement.appendChild(contextDocument.createTextNode(Base64.encode(oaepParams)));
result.appendChild(oaepElement);
}
if (digestAlgorithm != null) {
Element digestElement =
XMLUtils.createElementInSignatureSpace(contextDocument, Constants._TAG_DIGESTMETHOD);
digestElement.setAttributeNS(null, "Algorithm", digestAlgorithm);
result.appendChild(digestElement);
}
if (mgfAlgorithm != null) {
Element mgfElement =
XMLUtils.createElementInEncryption11Space(
contextDocument, EncryptionConstants._TAG_MGF
);
mgfElement.setAttributeNS(null, "Algorithm", mgfAlgorithm);
mgfElement.setAttributeNS(
Constants.NamespaceSpecNS,
"xmlns:" + ElementProxy.getDefaultPrefix(EncryptionConstants.EncryptionSpec11NS),
EncryptionConstants.EncryptionSpec11NS
);
result.appendChild(mgfElement);
}
Iterator<Element> itr = encryptionMethodInformation.iterator();
while (itr.hasNext()) {
result.appendChild(itr.next());
}
return result;
}