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.
INTEGRATOR - SOAP Response with SIGNATURE
- Fabrice.geay
- Posts: 21
- Joined: Tue Dec 12, 2017 2:06 am
- Location: FRANCE
- Contact:
INTEGRATOR - SOAP Response with SIGNATURE
Best regard
Fabrice GEAY
Fabrice GEAY
- Fabrice.geay
- Posts: 21
- Joined: Tue Dec 12, 2017 2:06 am
- Location: FRANCE
- Contact:
Re: INTEGRATOR - SOAP Response with SIGNATURE
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)
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
Hi Fabrice,
I’m experiencing the same issue. Could you please share how you resolved it?
I’m experiencing the same issue. Could you please share how you resolved it?