Closed VitorMascarenhas closed 3 years ago
Hi
That's a lot of (poorly formatted) code... I haven't read it all... Anyway, the exception message should be helpful, no?
If the SigningCertificate
property in the signed file is correct - i.e. it only contains certificates that are part of the expected certificate path - could your CertificateValidationProvider
be returning less/other certificates than the ones that are part of the certificate path? This could cause the error.
It's also possible that the signature in the signed file is not correctly formed. Can you post the contents of the SigningCertificate
property?
Hi
Hi
That's a lot of (poorly formatted) code... I haven't read it all... Anyway, the exception message should be helpful, no?
If the SigningCertificate property in the signed file is correct - i.e. it only contains certificates that are part of the expected certificate path - could your CertificateValidationProvider be returning less/other certificates than the ones that are part of the certificate path? This could cause the error.
@luisgoncalves
Owner luisgoncalves commented 3 days ago It's also possible that the signature in the signed file is not correctly formed. Can you post the contents of the SigningCertificate property?
@VitorMascarenhas
Author VitorMascarenhas commented 5 minutes ago Hi
xades:SigningCertificate xades:Cert xades:CertDigest
ds:DigestValuepY1yWia4eT3Y0o+u7m1AKLXTWnK2B2aHVF8Ebk2HAvM=</ds:DigestValue> </xades:CertDigest> xades:IssuerSerial ds:X509IssuerNameCN=MULTICERT Trust Services Certification Authority 002, OU=Certification Authority, O=MULTICERT - Serviços de Certificação Electrónica S.A., C=PT</ds:X509IssuerName> ds:X509SerialNumber151509000615619905591926071863597790011</ds:X509SerialNumber> </xades:IssuerSerial> </xades:Cert> xades:Cert xades:CertDigest
ds:DigestValueYE0y0DaJWu07/vrrcnwAnsDys836QqHHFzDmpyw76dQ=</ds:DigestValue> </xades:CertDigest> xades:IssuerSerial ds:X509IssuerNameCN=MULTICERT Root Certification Authority 01, O=MULTICERT - Serviços de Certificação Electrónica S.A., C=PT</ds:X509IssuerName> ds:X509SerialNumber6074693700342339162</ds:X509SerialNumber> </xades:IssuerSerial> </xades:Cert> xades:Cert xades:CertDigest
ds:DigestValuegs/a46cLbjdalu08/JEugaAgEEqLqIYnK1ljreyiRBE=</ds:DigestValue> </xades:CertDigest> xades:IssuerSerial ds:X509IssuerNameCN=MULTICERT Root Certification Authority 01, O=MULTICERT - Serviços de Certificação Electrónica S.A., C=PT</ds:X509IssuerName> ds:X509SerialNumber7394183213738552410</ds:X509SerialNumber> </xades:IssuerSerial> </xades:Cert> </xades:SigningCertificate>
this problem also occurs when testing the signature validation of signed xml files, some of them are in the test folder of your project, this is what I base myself on so that the problem is in my code and not in the signature.
once again thank you for your willingness to help me with this problem
At first glance, it seems that the SigningCertificate
property reference two certificates issued by "MULTICERT Root Certification Authority 01". Could it be that only one of them belongs to the certification path of the certificate/key used for the signature?
What's the expected certification path, from the top-level CA to the signing certificate?
Any progress?
Hi
No not yet. I will continue to try and if I get something I post the solution.
Thanks.
Reopen if you need more help.
Good Morning
i want to validate a signed xml file in bes xades and i am not getting it, give me the following exception, my code:
public class TestXades {
}
public class MyKeySelectorResult implements KeySelectorResult{ private Key key; private X509Certificate certificate;
}
public class CertificateValidationProviderWithX509 implements CertificateValidationProvider {
}
public class X509KeySelector extends KeySelector {
}
public class X509KeySelectorXades {
}
xades4j.verification.SigningCertificateCertsNotInCertPathException: Exception in thread "main" xades4j.verification.SigningCertificateCertsNotInCertPathException: Verification failed for property 'SigningCertificate': SigningCertificate property contains one or more certificates that are not part of the certification path. at xades4j.verification.SigningCertificateVerifier.verify(SigningCertificateVerifier.java:113) at xades4j.verification.SigningCertificateVerifier.verify(SigningCertificateVerifier.java:35) at xades4j.verification.QualifyingPropertiesVerifierImpl.verifyProperties(QualifyingPropertiesVerifierImpl.java:59) at xades4j.verification.XadesVerifierImpl.verify(XadesVerifierImpl.java:212) at xxx.XXXXMLDigitalSignature.TestXades.main(TestXades.java:71) Process exited. Debugger disconnected from local process.
I am trying to validate a duly signed file, I also tested it with files found in the unit tests of the xades4j project and the exception is the same.