xml-signature

Java & XMLDSig: Reference with no URI

橙三吉。 提交于 2021-02-18 19:32:53
问题 I'm trying to sign some text using XMLDSig with javax.xml.crypto.dsig.* package. I need to make a reference to some content being signed. And according to project requirements this reference should not have any URI, it means not <Reference URI="">...</Reference>, but <Reference>...</Reference>. I haven't found any info whether it is possible and correct, but requirement says that XMLDSig allows such references, maximum one per signature. Have someone faced the same problem? What can be done

Java & XMLDSig: Reference with no URI

ぃ、小莉子 提交于 2021-02-18 19:32:08
问题 I'm trying to sign some text using XMLDSig with javax.xml.crypto.dsig.* package. I need to make a reference to some content being signed. And according to project requirements this reference should not have any URI, it means not <Reference URI="">...</Reference>, but <Reference>...</Reference>. I haven't found any info whether it is possible and correct, but requirement says that XMLDSig allows such references, maximum one per signature. Have someone faced the same problem? What can be done

unsupported SignatureMethod algorithm, but the algorithm is listed as available Service by BC-Provider

我是研究僧i 提交于 2021-02-08 05:34:32
问题 to keep it short, my problem is as follows: I add the BC-Provider at the beginning of my function: Security.addProvider(new BouncyCastleProvider()); when i List all Services BouncyCastleProvider().getServices(); the List contains "RIPEMD160WITHECDSA" on the last line of this codesnippet: XMLSignatureFactory factory = XMLSignatureFactory.getInstance("DOM"); DOMValidateContext valContext = new DOMValidateContext(pubkeys[i], sigElement); valContext.setURIDereferencer(new FileDereferencer(

Get the sha1-hashed value from XML signature value

寵の児 提交于 2021-02-07 10:50:30
问题 I need someone to help me understand XML digital signature method rsa-sha1 . I suppose the signature value = RSA-encrypt(sha1(signedInfo), privatekey). Note Base64.encode(sha1(signedInfo)) contains 28 characters. So I think Base64.encode(RSA-decrypt(signaturevalue), publickey) should return 28 characters as well. However, I actually got a 48-character string. Base64 base64 = new Base64(); byte[] encrypted = base64.decode(signatureValue); try { Cipher cipher = Cipher.getInstance("RSA"); cipher

Is there an easier way to sign an XML document in Java?

痴心易碎 提交于 2021-02-06 08:38:28
问题 I'm trying to digitally sign an XML document using Java. I've got an implementation working with some references I've found that use various implementations in the javax.xml.crypto.dsig package. However, my current implementation is like many of the examples I've looked at - it's rather verbose and involves using no less than 23 different API classes from the java.xml.crypto.dsig , javax.xml.transform , and java.security packages, among others. It feels like I've entered factory factory

Library to manage XAdES signatures in Java [closed]

吃可爱长大的小学妹 提交于 2021-02-05 20:30:47
问题 Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 2 years ago . Improve this question I'm looking for a Java library that allows the creation and verification of XAdES signatures (the more formats, the better: XAdES-BES, XAdES-C, XAdES-X-L, etc.). The most interesting implementations I found are: Java XML Digital Signature API (JSR 105) (= the one

Library to manage XAdES signatures in Java [closed]

爷,独闯天下 提交于 2021-02-05 20:29:26
问题 Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 2 years ago . Improve this question I'm looking for a Java library that allows the creation and verification of XAdES signatures (the more formats, the better: XAdES-BES, XAdES-C, XAdES-X-L, etc.). The most interesting implementations I found are: Java XML Digital Signature API (JSR 105) (= the one

Library to manage XAdES signatures in Java [closed]

给你一囗甜甜゛ 提交于 2021-02-05 20:27:55
问题 Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 2 years ago . Improve this question I'm looking for a Java library that allows the creation and verification of XAdES signatures (the more formats, the better: XAdES-BES, XAdES-C, XAdES-X-L, etc.). The most interesting implementations I found are: Java XML Digital Signature API (JSR 105) (= the one

How to verify the digital signature of downloaded xml file in java

南楼画角 提交于 2021-01-01 09:22:30
问题 I have an XML file, given below <OfflinePaperlessKyc referenceId="686820201209011401091"> <UidData> <Poi dob="21-01-1945" e="bd05902a34b7b9e4d92230ac6b0asded072c1c0945190ad357f9ceec387f6fd6" gender="M" m="ed4eeb1376575c1b59096cf5c41243re5f3d4146e0c63eb4cc08a6c22fa9afe5" name="Reepak Sangid"/> <Poa careof="S/O John Uncle" country="India" dist="Jaipur" house="1134 - B" landmark="80 Feet Road 200 Feet Baypass ke pass" loc="Heerapura Ajmer Road" pc="302024" po="" state="Kerala" street="Heera

Purpose of KeyInfo in XML signature

こ雲淡風輕ζ 提交于 2020-07-10 07:31:48
问题 I am reading about XML signature from w3 page As per my understanding, to Sign an XML: Create a Canonical XML of the XML Data to be signed. Create a hash (digest) of the Canonicalised XML Data using an algorithm mentioned in <DigestMethod/> . Hash will go inside <DigestValue> Encrypt above has using algorithm mentioned in <SignatureMethod/> . This algorithm will take Sender's private key as an input. Signature will go inside <SignatureValue> To Verify (at receiver's end): Use the public key