Comments (8)
Hi,
At a first glance the signature looks ok. I'll try to reproduce the issue later.
Original comment by luis.fgoncalv
on 10 Aug 2011 at 8:52
from xades4j.
I'm waiting for your comments.
Thanks again.
Original comment by [email protected]
on 11 Aug 2011 at 10:23
from xades4j.
I was able to sign the document and produce a signature identical to yours with
the following code (uses helper methods on the lib test classes):
class TestAlgsProvider extends DefaultAlgorithmsProvider
{
@Override
public String getDigestAlgorithmForDataObjsReferences()
{
return MessageDigestAlgorithm.ALGO_ID_DIGEST_SHA1;
}
@Override
public String getSignatureAlgorithm(String keyAlgorithmName) throws UnsupportedAlgorithmException
{
return XMLSignature.ALGO_ID_SIGNATURE_RSA_SHA1;
}
}
/***************************************************************************/
XadesBesSigningProfile profile = new XadesBesSigningProfile(keyingProviderMy);
profile.withSignaturePropertiesProvider(new SignaturePropertiesProvider()
{
@Override
public void provideProperties(SignaturePropertiesCollector signedPropsCol)
{
signedPropsCol.setSigningTime(new SigningTimeProperty());
signedPropsCol.setSignerRole(new SignerRoleProperty("Test Role"));
}
})
.withAlgorithmsProvider(TestAlgsProvider.class);
Enveloped env = new Enveloped(profile.newSigner());
Document doc = getDocument("test.xml");
env.sign(doc.getDocumentElement());
outputDocument(doc, "test_signed.xml");
/***********************************************************************/
XadesVerificationProfile verifProfile = new XadesVerificationProfile(VerifierTestBase.validationProviderMySigs);
XadesVerifier verifier = verifProfile.newVerifier();
doc = getDocument("test_signed.xml");
Element signatureNode = VerifierTestBase.getSigElement(doc);
verifier.verify(signatureNode, null);
If, on your scenario, the reference's digest changed, something is probably
changing the dom tree after signature production.. How are you writing the
signed file to disk?
Original comment by luis.fgoncalv
on 14 Aug 2011 at 9:50
Attachments:
from xades4j.
I was using my own xml save method. When i changed to your outputDocument and
getDocument methods the problem was solved.
Thanks a lot for your help :)
Original comment by [email protected]
on 15 Aug 2011 at 4:14
from xades4j.
Original comment by luis.fgoncalv
on 16 Aug 2011 at 8:46
- Changed state: Invalid
from xades4j.
Hi;
I use xades4j for signing xml docs.
I'm signing the face_f0900032774003A699D2F.xml(attached) with xades4j with Xades-BES Enveloped type and produce face_f0900032774003A699D2F_signed.xml (attached).
But when my provider verifying xml signnature, show me this:
xades4j.verification.ReferenceValueException: Reference '#xmldsig-7786ae15-dcbf-46ff-94c6-d9c6834b9b25-keyinfo' cannot be validated
Please help!!!
face_f0900032774003A699D2F.zip
from xades4j.
Thank you very much. I made the same mistake (with writing signed xml to disk). This thread let me understand what I was doing wrong.
from xades4j.
@santipineda Llegaste a solucionarlo?
from xades4j.
Related Issues (20)
- On verify TBES signature the excepion "invalid token signature" is thrown HOT 1
- Problem validating sign in https://ec.europa.eu/cefdigital/DSS/webapp-demo/validation HOT 5
- NoClassDefFoundError with XadesSigningProfile HOT 2
- Have you installed xades4j's dependencies? The missing class is from Guice, a library used by xades4j. Is Guice available in the classpath of your application? The same applies to Apache XML Security and Bouncy Castle.
- Edit and add attributes in nodes of xadesBES according to especific format HOT 8
- Key store has more than one private key entry HOT 1
- Bump xmlsec to at least 2.3.0 HOT 3
- JAXBException with newSigner method HOT 11
- signature invalid HOT 2
- BindingSourceRestriction uses some methods missing in Java implementation for Android HOT 4
- SignatureAppendingStrategy issue with XPath transform HOT 2
- Invalid hash when signing HOT 27
- Invalid Signature produced by Xades4j HOT 10
- Migrating from Xades4j 1.7.0 to Xades4j 2.2.0 HOT 1
- Transform nodes in a Signature Policy HOT 6
- Upgrade Apache Santuario to version 4.X.X HOT 3
- Add code-formatting configuration.
- Support explicit security Provider HOT 5
- Is there a maintained java 8 version of the library HOT 1
- How to Manually Set DigestValue for SignaturePolicyIdentifier in xades4j HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from xades4j.