请帮助我解决此代码中的模棱两可的调用。
fac.newtransform()
并fac.new signedinfo()
给出错误说:
引用
newTransform
不明确,methodnewTransform(String,TransformParameterSpec)
inXMLSignatureFactory
和 methodnewTransform(String,XMLStructure)
in 都XMLSignatureFactory
匹配
我怎样才能调用实际的函数XMLSignatureFactory
?
XMLSignatureFactory fac =XMLSignatureFactory.getInstance("DOM",
(Provider) Class.forName(providerName).newInstance());
Reference ref =fac.newReference("",fac.newDigestMethod(DigestMethod.SHA1, null),
Collections.singletonList(fac.newTransform(Transform.ENVELOPED, null)),null, null);
SignedInfo si = fac.newSignedInfo
(fac.newCanonicalizationMethod
(CanonicalizationMethod.INCLUSIVE_WITH_COMMENTS,
null),
fac.newSignatureMethod(SignatureMethod.DSA_SHA1,
null),
Collections.singletonList(ref));