本文整理了Java中javax.xml.crypto.dsig.Reference.getURI
方法的一些代码示例,展示了Reference.getURI
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Reference.getURI
方法的具体详情如下:
包路径:javax.xml.crypto.dsig.Reference
类名称:Reference
方法名:getURI
暂无
代码示例来源:origin: org.apache.poi/poi-ooxml
public int compare(Reference o1, Reference o2) {
return o1.getURI().compareTo(o2.getURI());
}
});
代码示例来源:origin: es.gob.afirma/afirma-crypto-ooxml
private static boolean alreadyContains(final List<Reference> references, final Reference reference) {
if (reference == null || references == null) {
return true;
}
for (final Reference r : references) {
if (r.getURI().equals(reference.getURI())) {
return true;
}
}
return false;
}
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.poi
public int compare(Reference o1, Reference o2) {
return o1.getURI().compareTo(o2.getURI());
}
});
代码示例来源:origin: be.fedict.eid-applet/eid-applet-service-signer
private Reference findReferenceFromURI(List<Reference> refs, String referenceURI) {
for (Reference ref : refs) {
if (ref.getURI().equals(referenceURI)) {
LOG.debug("Found \"" + referenceURI + "\" ds:reference");
return ref;
}
}
return null;
}
代码示例来源:origin: net.java.xades/jxades
public InvalidSignatureReason(Reference reference)
{
invalidSignature = InvalidSignature.BAD_REFERENCE;
StringBuilder sb = new StringBuilder();
sb.append("Bad reference");
String id = reference.getId();
if (id != null && (id = id.trim()).length() > 0)
sb.append(" with Id '").append(id).append("'");
String uri = reference.getURI();
if (uri != null && (uri = uri.trim()).length() > 0)
{
if (id != null && id.length() > 0)
sb.append(" and URI = '");
else
sb.append(" with URI = '");
sb.append(uri).append("'");
}
reason = sb.toString();
}
代码示例来源:origin: be.fedict.eid-dss/eid-dss-document-odf
private void checkIntegrity(XMLSignature xmlSignature, byte[] document,
byte[] originalDocument) throws IOException {
if (null != originalDocument) {
throw new IllegalArgumentException(
"cannot perform original document verifications");
}
Set<String> dsReferenceUris = new HashSet<String>();
SignedInfo signedInfo = xmlSignature.getSignedInfo();
@SuppressWarnings("unchecked")
List<Reference> references = signedInfo.getReferences();
for (Reference reference : references) {
String referenceUri = reference.getURI();
dsReferenceUris.add(referenceUri);
}
ZipInputStream odfZipInputStream = new ZipInputStream(
new ByteArrayInputStream(document));
ZipEntry zipEntry;
while (null != (zipEntry = odfZipInputStream.getNextEntry())) {
if (false == ODFUtil.isToBeSigned(zipEntry)) {
continue;
}
String uri = zipEntry.getName().replaceAll(" ", "%20");
if (false == dsReferenceUris.contains(uri)) {
LOG.warn("no ds:Reference for ODF entry: " + zipEntry.getName());
throw new RuntimeException("no ds:Reference for ODF entry: "
+ zipEntry.getName());
}
}
}
}
代码示例来源:origin: be.fedict.eid-dss/eid-dss-spi-utils
@SuppressWarnings("unchecked")
public static String findReferenceUri(XMLSignature xmlSignature, String type) {
SignedInfo signedInfo = xmlSignature.getSignedInfo();
List<Reference> references = signedInfo.getReferences();
for (Reference reference : references) {
if (type.equals(reference.getType())) {
return reference.getURI();
}
}
return null;
}
代码示例来源:origin: org.apache.santuario/xmlsec
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (!(o instanceof Reference)) {
return false;
}
Reference oref = (Reference)o;
boolean idsEqual = id == null ? oref.getId() == null
: id.equals(oref.getId());
boolean urisEqual = uri == null ? oref.getURI() == null
: uri.equals(oref.getURI());
boolean typesEqual = type == null ? oref.getType() == null
: type.equals(oref.getType());
boolean digestValuesEqual =
Arrays.equals(digestValue, oref.getDigestValue());
return digestMethod.equals(oref.getDigestMethod()) && idsEqual &&
urisEqual && typesEqual &&
allTransforms.equals(oref.getTransforms()) && digestValuesEqual;
}
代码示例来源:origin: com.hynnet/xws-security
private static Data getData(Reference reference,DOMValidateContext context) throws Exception{
final String uri = reference.getURI();
URIReference uriRef = new URIReference(){
public String getURI(){
return uri;
}
public String getType(){
return null;
}
};
Data inputData = DSigResolver.getInstance().dereference(uriRef, context);
if(inputData instanceof AttachmentData){
return inputData;
}
List transformList = reference.getTransforms();
Iterator itr = transformList.iterator();
while(itr.hasNext()){
Transform transform = (Transform)itr.next();
inputData = getData(transform,inputData,context);
}
return inputData;
}
代码示例来源:origin: org.picketlink/picketlink-fed
for (Reference ref : references)
log.trace("[Ref id=" + ref.getId() + ":uri=" + ref.getURI() + "]validity status:"
+ ref.validate(valContext));
代码示例来源:origin: org.picketlink/picketlink-fed-core
for (Reference ref : references)
log.trace("[Ref id=" + ref.getId() + ":uri=" + ref.getURI() + "]validity status:"
+ ref.validate(valContext));
代码示例来源:origin: org.apache.ws.security/wss4j
Reference reference = (Reference)refObject;
if ("".equals(reference.getURI())
|| reference.getURI().equals(samlAssertion.getId())
|| reference.getURI().equals("#" + samlAssertion.getId())) {
WSDataRef ref = new WSDataRef();
ref.setWsuId(reference.getURI());
ref.setProtectedElement(token);
ref.setAlgorithm(signatureMethod);
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.wss4j
Reference reference = (Reference)refObject;
if ("".equals(reference.getURI())
|| reference.getURI().equals(samlAssertion.getId())
|| reference.getURI().equals("#" + samlAssertion.getId())) {
WSDataRef ref = new WSDataRef();
ref.setWsuId(reference.getURI());
ref.setProtectedElement(token);
ref.setAlgorithm(signatureMethod);
代码示例来源:origin: org.apache.wss4j/wss4j-ws-security-dom
Reference reference = (Reference)refObject;
if ("".equals(reference.getURI())
|| reference.getURI().equals(samlAssertion.getId())
|| reference.getURI().equals("#" + samlAssertion.getId())) {
WSDataRef ref = new WSDataRef();
ref.setWsuId(reference.getURI());
ref.setProtectedElement(token);
ref.setAlgorithm(signatureMethod);
代码示例来源:origin: org.apache.ws.security/wss4j
String uri = reference.getURI();
Element element = callbackLookup.getElement(uri, null, true);
if (element == null) {
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.wss4j
String uri = reference.getURI();
Element element = callbackLookup.getElement(uri, null, true);
if (element == null) {
代码示例来源:origin: com.hynnet/xws-security
public void constructSignaturePolicy(SignedInfo signedInfo, boolean isBSP,SignaturePolicy policy){
List referencesList = signedInfo.getReferences();
//SignatureMethod sm = signedInfo.getSignatureMethod();
CanonicalizationMethod cm = signedInfo.getCanonicalizationMethod();
policy.isBSP(isBSP);
SignaturePolicy.FeatureBinding featureBinding = (SignaturePolicy.FeatureBinding )policy.getFeatureBinding();
featureBinding.setCanonicalizationAlgorithm(cm.getAlgorithm());
Iterator itr = referencesList.iterator();
while(itr.hasNext()){
Reference ref = (Reference) itr.next();
SignatureTarget.Transform transform = getSignatureTransform(ref);
SignatureTarget target = new SignatureTarget();
target.isBSP(isBSP);
if(transform != null){
target.addTransform(transform);
}
target.setDigestAlgorithm(ref.getDigestMethod().getAlgorithm());
if(ref.getURI().length() >0){
target.setValue(SecurableSoapMessage.getIdFromFragmentRef(ref.getURI()));
}else{
target.setValue(ref.getURI());
}
target.setType(SignatureTarget.TARGET_TYPE_VALUE_URI);
featureBinding.addTargetBinding(target);
}
}
代码示例来源:origin: org.picketlink/picketlink-federation
logger.trace("[Ref id=" + ref.getId() + ":uri=" + ref.getURI() + "]validity status:" + ref.validate(valContext));
代码示例来源:origin: org.picketlink/picketlink-core
logger.trace("[Ref id=" + ref.getId() + ":uri=" + ref.getURI() + "]validity status:" + ref.validate(valContext));
代码示例来源:origin: org.picketlink/picketlink-common
logger.trace("[Ref id=" + ref.getId() + ":uri=" + ref.getURI() + "]validity status:" + ref.validate(valContext));
内容来源于网络,如有侵权,请联系作者删除!