Page 1 of 1

INTEGRATOR - SOAP Response with SIGNATURE

Posted: Mon Jul 06, 2020 6:10 pm
by Fabrice.geay
Hy,

I need to put the following fragment in a SOAP response, It was defined in the XSD:
<ds:Signature>
<ds:SignedInfo>
<ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
<ds:SignatureMethod Algorithm="http://www.w3.org/2001/04/xmldsig-more#rsa-sha256"/>
<ds:Reference URI="#_1fa877ec-1c7b-97be-67a1-8d3694963006">
<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/2001/04/xmlenc#sha256"/>
<ds:DigestValue>ecqx3Mh+8z9PU/KqG1A9CZqs/WK2sudl/6BGnctdDxg=</ds:DigestValue>
</ds:Reference>
<ds:Reference URI="#_1fa877ec-1c7b-97be-b413-8d3694963009">
<ds:Transforms>
<ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
</ds:Transforms>
<ds:DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"/>
<ds:DigestValue>ecqx3Mh+8z9PU/KqG1A9CZqs/WK2sudl/6BGnctdDxg=</ds:DigestValue>
</ds:Reference>
</ds:SignedInfo>
<ds:SignatureValue></ds:SignatureValue>
<ds:KeyInfo Id="_1fa877ec-1c7b-97be-b413-8d3694963009">
<ds:X509Data>
<ds:X509Certificate/>
</ds:X509Data>
</ds:KeyInfo>
</ds:Signature>

But I also need SignatureValue and X509Certificate values but I don't know how I can get this information using a certificat Store ?
I guess I will have to use JAVA.

Re: INTEGRATOR - SOAP Response with SIGNATURE

Posted: Tue Jul 07, 2020 11:25 pm
by Fabrice.geay
I have found how to set X509Certificate :

CertificateFactory cf = CertificateFactory.getInstance("X.509");
FileInputStream in = new FileInputStream("Path of my cer file");
java.security.cert.Certificate c = cf.generateCertificate(in);
in.close();

t = (X509Certificate) c;
byte[] encodedCertificate = t.getEncoded();
t.checkValidity();
System.out.println("Ce Certificat est valide " + t.getNotAfter() );

String Certif64 = Base64.getEncoder().withoutPadding().encodeToString(encodedCertificate);
System.out.println("Certificat = " + Certif64);

But now i need set "SignatureValue". I have found examples with Input Xml SIGNATURE but not just the "SignatureValue" (A byte array that contains the signature value of the current SignedXml object)

Re: INTEGRATOR - SOAP Response with SIGNATURE

Posted: Thu Aug 29, 2024 3:30 pm
by lhyeak
Hi Fabrice,

I’m experiencing the same issue. Could you please share how you resolved it?