API Connect

API Connect

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.


#API Connect
#Applicationintegration
#APIConnect
 View Only
Expand all | Collapse all

RSA/ECB/OAEPWithSHA-512AndMGF1Padding Encryption using dp:encrypt-key()

  • 1.  RSA/ECB/OAEPWithSHA-512AndMGF1Padding Encryption using dp:encrypt-key()

    Posted 05/09/22 01:03 AM
    Edited by Jayprakash Yadav 05/09/22 06:13 AM
    RESOLVED


  • 2.  RE: RSA/ECB/OAEPWithSHA-512AndMGF1Padding Encryption using dp:encrypt-key()

    Posted 05/09/22 06:13 AM

    RESOLVED!!!!


    Script updated with below.

    <xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:dp="http://www.datapower.com/extensions"
    xmlns:func="http://exslt.org/functions"
    xmlns:apim="http://www.ibm.com/apimanagement" extension-element-prefixes="dp func apim">
    <xsl:import href="local:/isp/policy/apim.custom.xsl"/>
    <xsl:template match="/">
    <xsl:variable name="client-id" select="apim:getVariable('request.headers.cek')" />
                    <xsl:variable name="OAEPParameters" select="''" />
    <xsl:variable name="algorithm" select="'http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p'" />
                    <xsl:variable name="OAEPDigestAlgorithm" select="'http://www.w3.org/2001/04/xmlenc#sha512'" />
    <xsl:variable name="sessionKey" select="$client-id"/>
    <xsl:variable name="recipient" select="'name:bank'"/>
    <xsl:variable name="encryptOut">
    <xsl:value-of select="dp:encrypt-key($sessionKey, $recipient, $algorithm, $OAEPParameters, $OAEPDigestAlgorithm)"/>
    </xsl:variable>
    <EncryptedValue>
    <xsl:copy-of select="$encryptOut"/>
    </EncryptedValue>
    </xsl:template>
    </xsl:stylesheet>


    ------------------------------
    Jayprakash Yadav
    ------------------------------