Hi,
I need to call an API that have a security process that i need to do, with the Datapower i have done with the code above in XSL:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:dp="http://www.datapower.com/extensions"
extension-element-prefixes="dp" exclude-result-prefixes="dp"
version="1.0">
<xsl:template match="/">
<xsl:variable name="input-xml" select="."/>
<xsl:variable name="sign-algorithm">
<xsl:text>http://www.w3.org/2001/04/xmldsig-more#rsa-sha256</xsl:text>
</xsl:variable>
<xsl:variable name="hash-algorithm">
<xsl:text>http://www.w3.org/2001/04/xmlenc#sha256</xsl:text>
</xsl:variable>
<xsl:variable name="certKey" select="dp:variable('var://context/jwt/cerKey')"/>
<xsl:variable name="cerKey" select="concat('name:', $certKey)"/>
<xsl:variable name="hash-signedinfo" select="dp:hash($hash-algorithm, dp:variable('var://context/jwt/arquivoRequest'))"/>
<xsl:message> Inicio Assinar msg </xsl:message>
<xsl:variable name="signed-data">
<xsl:value-of select="dp:sign($sign-algorithm, $hash-signedinfo, $cerKey)"/>
</xsl:variable>
<xsl:message> Fim Assinar msg </xsl:message>
<SignatureValue>
<xsl:value-of select="$signed-data"/>
</SignatureValue>
<dp:set-variable name="'var://context/jwt/arquivoRequest'" value="$signed-data"/>
<xsl:copy-of select="$signed-data"/>
</xsl:template>
</xsl:stylesheet>
But now i need to do the same thing with Broadcom Gateway i see that i can hash the string with the assertions "Generate Security Hash" using SHA-256.
My problem is that i dont know how to sign that hash with the certificate using RSA SHA 256, i have read somewhere to use Enconde JWT assertion but i dont want to create a JWT i need to sign the hash string, how can i do it?