从 Java 7 升级到 Java 8 后签名引用失败

2024-03-13

我最近已将 Java 从 7 升级到 8,并且我面临使用 saml 请求的服务之一的问题。 我收到以下错误:

Jan 05, 2015 3:42:06 PM org.jcp.xml.dsig.internal.dom.DOMReference validate
FINE: Expected digest: oOGa8vH4D/IUG4rulEBiQMbc5as=
Jan 05, 2015 3:42:06 PM org.jcp.xml.dsig.internal.dom.DOMReference validate
FINE: Actual digest: 7JwuVaoeBca7IojrS0ULT3Fra0Y=
Jan 05, 2015 3:42:06 PM org.jcp.xml.dsig.internal.dom.DOMXMLSignature validate
FINE: Reference[#XID-44b4791a2aab445ea06a1ae7fd6676c2] is valid: false
Jan 05, 2015 3:42:06 PM org.jcp.xml.dsig.internal.dom.DOMXMLSignature validate
FINE: Couldn't validate the References
Jan 05, 2015 3:42:06 PM com.sun.xml.wss.impl.dsig.SignatureProcessor verify
SEVERE: WSS1315: Signature Verification Failed
Jan 05, 2015 3:42:06 PM com.sun.xml.wss.impl.dsig.SignatureProcessor verify
SEVERE: WSS1338: Error occured in verifying the signature

它以前可以与 Java 7 一起使用。 以下是示例请求...... 样品请求:

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
	<SOAP-ENV:Header xmlns:wsa="http://www.w3.org/2005/08/addressing">
		<wsa:To>someURL</wsa:To>
		<wsa:MessageID>XID-d0d2462194b6ced902422691850b50f3</wsa:MessageID>
		<wsa:Action>someAction</wsa:Action>
		<wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" SOAP-ENV:mustUnderstand="1">
			<wsse:BinarySecurityToken xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" 
EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary" 
ValueType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3" 
wsu:Id="XID-71380b994c47272f6c2e2c31a0a26eb6">MIIGxTCCBK2gAwIBAgIQdGS5YDDbSjiUuMCJUFIPKDANBgkqhkiG9w0BAQsFADBmMQswCQYDVQQGEwJOTDEgMB4GA1UECgwXS1BOIEN......</wsse:BinarySecurityToken>
			<ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
				<ds:SignedInfo>
					<ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#">
						<ds:InclusiveNamespaces xmlns="http://www.w3.org/2001/10/xml-exc-c14n#" PrefixList="wsse SOAP-ENV"/>
					</ds:CanonicalizationMethod>
					<ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/>
					<ds:Reference URI="#XID-0f11762f41a81b1c00fb6bc112c8d0a6">
						<ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
						<ds:DigestValue>V8ydrq8hUhYDYJKj2MTSwTqEX78=</ds:DigestValue>
						<ds:Transforms>
							<ds:Transform Algorithm="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#STR-Transform">
								<wsse:TransformationParameters>
									<ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
								</wsse:TransformationParameters>
							</ds:Transform>
						</ds:Transforms>
					</ds:Reference>
					<ds:Reference URI="#XID-b2710d2281c8eed3501a59da494fd8fb">
						<ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
						<ds:DigestValue>JYygH6jWBQ0mmKD0wALX4SwZGJg=</ds:DigestValue>
					</ds:Reference>
				</ds:SignedInfo>
				
<ds:SignatureValue>BBChEf5PWEQlgBXtuI+f6eVOvjDRv8IBsvieQR0oZV2/owShrZafL/xsqyUwaTHKKjiqA8UoStQs09/K4vihsQhxTxf90f6jfzd+UMMyPJzgbn51pS6Sqz6ZFIa1SD....</ds:SignatureValue>
				<ds:KeyInfo>
					<wsse:SecurityTokenReference xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" 
wsu:Id="XID-cfb3089f3308ae0aa8ff7bd399ff31c6">
						<wsse:Reference URI="#XID-71380b994c47272f6c2e2c31a0a26eb6" 
ValueType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3"/>
					</wsse:SecurityTokenReference>
				</ds:KeyInfo>
			</ds:Signature>
			<wsse:SecurityTokenReference xmlns:wsse11="http://docs.oasis-open.org/wss/oasis-wss-wssecurity-secext-1.1.xsd" 
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" 
wsse11:TokenType="http://docs.oasis-open.org/wss/oasis-wss-saml-token-profile-1.1#SAMLV2.0" wsu:Id="XID-0f11762f41a81b1c00fb6bc112c8d0a6">
				<wsse:KeyIdentifier 
ValueType="http://docs.oasis-open.org/wss/oasis-wss-saml-token-profile-1.0#SAMLAssertionID">XID-0f11762f41a81b1c00fb6bc112c8d0a6</wsse:KeyIdentif
ier>
			</wsse:SecurityTokenReference>
			<saml:Assertion xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion" xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema" ID="XID-0f11762f41a81b1c00fb6bc112c8d0a6" 
Version="2.0" IssueInstant="2014-12-23T14:53:27Z">
				<saml:Issuer>ABC</saml:Issuer>
				<ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
					<ds:SignedInfo>
						<ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
						<ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/>
						<ds:Reference URI="#XID-0f11762f41a81b1c00fb6bc112c8d0a6">
							<ds:Transforms>
								<ds:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/>
								<ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
							</ds:Transforms>
							<ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
							<ds:DigestValue>3RL5/9A9PnbcN1UQlYoex2wmB2I=</ds:DigestValue>
						</ds:Reference>
					</ds:SignedInfo>
					
<ds:SignatureValue>gNvBQlMs49fAZ02t4ng68LO6A0rh1MooT1qhhLoel5mt/a2A8xEl9Dr6diS+iv/cuINsEIlq8YMQKbMHE5mQgVQ2XFQPLeK9PX2nMdFzCglR3ZOyd8OsrhiDwb....</ds:SignatureValue>
					<ds:KeyInfo>
						<ds:X509Data/>
					</ds:KeyInfo>
				</ds:Signature>
				<saml:Subject>
					<saml:NameID>urn:app:NUM:693315908</saml:NameID>
					<saml:SubjectConfirmation Method="urn:oasis:names:tc:SAML:2.0:cm:sender-vouches"/>
				</saml:Subject>
				<saml:Conditions/>
				<saml:AuthnStatement AuthnInstant="2014-12-23T14:53:27Z">
					<saml:AuthnContext>
						<saml:AuthnContextClassRef>PasswordProtectedTransport</saml:AuthnContextClassRef>
						<saml:AuthenticatingAuthority>someAuthenticationAuthority</saml:AuthenticatingAuthority>
					</saml:AuthnContext>
				</saml:AuthnStatement>
			</saml:Assertion>
		</wsse:Security>
	</SOAP-ENV:Header>
	<SOAP-ENV:Body xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" wsu:Id="XID-b2710d2281c8eed3501a59da494fd8fb">
		//body goes here
	</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

None

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

从 Java 7 升级到 Java 8 后签名引用失败 的相关文章

  • 方法返回类型前的 是什么意思?

    下面的方法返回一个List组成T类型元素 public
  • 枚举的子类化

    有没有一种简单的方法来子类化Javaenum 我问这个问题是因为我有大约 10 个实现相同接口的对象 但它们对某些方法也有相同的实现 因此我想通过将所有相同的实现放置在扩展的中间对象中来重用代码Enum它也是我需要的所有其他类的超类 或许事
  • Jackson JSON + Java 泛型

    我正在尝试将以下 JSON 反序列化 映射到List
  • Android:如何暂停和恢复可运行线程?

    我正在使用 postDelayed 可运行线程 当我按下按钮时 我需要暂停并恢复该线程 请任何人帮助我 这是我的主题 protected void animation music6 music4 postDelayed new Runnab
  • Java LostFocus 和 InputVerifier,按反向制表符顺序移动

    我有一个 GUI 应用程序 它使用 InputVerifier 在产生焦点之前检查文本字段的内容 这都是很正常的 然而 昨天发现了一个问题 这似乎是一个错误 但我在任何地方都找不到任何提及它的地方 在我将其报告为错误之前 我想我应该问 我在
  • 什么是内部类的合成反向引用

    我正在寻找应用程序中的内存泄漏 我正在使用的探查器告诉我寻找这些类型的引用 但我不知道我在寻找什么 有人可以解释一下吗 Thanks Elliott 您可以对 OUTER 类进行合成反向引用 但不能对内部类实例进行合成 e g class
  • 无法使用 datastax java 驱动程序通过 UDT 密钥从 cassandra 检索

    我正在尝试使用用户定义的类型作为分区键将对象存储在 cassandra 中 我正在使用 datastax java 驱动程序进行对象映射 虽然我能够插入到数据库中 但无法检索该对象 如果我更改分区键以使用非 udt 例如文本 我就能够保存和
  • 使用 OkHttp 下载损坏的文件

    我编写的下载文件的方法总是会产生损坏的文件 public static String okDownloadToFileSync final String link final String fileName final boolean te
  • getCurrentSession 在网络中休眠

    我正在使用 hibernate 和 jsp servlet 编写一个基于 Web 的应用程序 我读过有关sessionFactory getCurrentSession and sessionFactory openSession方法 我知
  • ThreeTen 向后移植与 JSR-310 的比较

    由于某些原因 我们现在无法使用 java 8 我们仍然停留在 java 7 上 不过 我想使用新的JSR 310 date time APIs现在 使用官方向后移植 ThreeTen http www threeten org threet
  • 如何更改 Swagger-ui URL 前缀?

    我正在使用 Springfox Swagger2 和 Spring boot 1 5 9 我可以通过此链接访问 swagger UI http localhost 8090 swagger ui html http localhost 80
  • 使用 JDBC 连接到 PostgreSql 的本地实例

    我在 Linux 机器上有一个正在运行的 PostgreSql 本地实例 当我使用psql来自 shell 的命令我成功登录 没有任何问题 我需要通过 JDBC 连接到 PostgreSql 但我不知道我到底应该传递什么url参数为Driv
  • Android 认为我没有关闭数据库!为什么?

    我有一个 SQLiteDatabase 数据成员 我在 onCreate 中初始化它 并在 onPause onStop 和 onDestroy 中调用 close 它在 onResume 中重新初始化 它似乎运行得很好 但当我查看调试器时
  • 文本视图不显示全文

    我正在使用 TableLayout 和 TableRow 创建一个简单的布局 其中包含两个 TextView 这是代码的一部分
  • java实现excel价格、收益率函数[关闭]

    就目前情况而言 这个问题不太适合我们的问答形式 我们希望答案得到事实 参考资料或专业知识的支持 但这个问题可能会引发辩论 争论 民意调查或扩展讨论 如果您觉得这个问题可以改进并可能重新开放 访问帮助中心 help reopen questi
  • Android ScrollView,检查当前是否滚动

    有没有办法检查标准 ScrollView 当前是否正在滚动 方向是向上还是向下并不重要 我只需要检查它当前是否正在滚动 ScrollView当前形式不提供用于检测滚动事件的回调 有两种解决方法可用 1 Use a ListView并实施On
  • Java 中清除嵌套 Map 的好方法

    public class MyCache AbstractMap
  • 什么是 Java2D 处理程序线程?

    我创建了一个使用 Hibernate 的示例 java 应用程序 当我进行线程转储时 我观察到一个名为 Java2D Disposer 的奇怪线程 有人能告诉我该线程的功能吗 AWT 系统中的某些实体需要最终确定以释放资源 最突出的例子是j
  • 使用 DBCP 配置 Tomcat

    在闲置一段时间 几个小时 后 我们收到了 CommunicationsException 来自 DBCP 错误消息 在异常中 位于这个问题的末尾 但我没有看到任何配置文件中定义的 wait timeout 我们应该看哪里 在 tomcat
  • 设置 TreeSet 的大小

    有没有办法像数组一样对 Java 集合中的 TreeSet 进行大小限制 例如我们在数组中 anArray new int 10 数组具有固定长度 在创建数组时必须指定该长度 A TreeSet当您向其中添加元素时会自动增长 您无法设置其大

随机推荐