-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDecrypt.xsl
41 lines (34 loc) · 1.53 KB
/
Decrypt.xsl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet
version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:dp="http://www.datapower.com/extensions"
xmlns:dpconfig="http://www.datapower.com/param/config"
xmlns:apim="http://www.ibm.com/apimanagement"
xmlns:webapi="http://www.ibm.com/apimanagement"
xmlns:func="http://exslt.org/functions"
xmlns:wxsl="http://www.w3.org/1999/XSL/TransformAlias"
xmlns:exsl="http://exslt.org/common"
extension-element-prefixes="dp dpconfig exsl apim"
exclude-result-prefixes="wxsl func dp">
<xsl:template match="/">
<xsl:variable name="vAlgorithm" select="'http://www.w3.org/2001/04/xmlenc#aes256-cbc'"/>
<xsl:variable name="vKey" select="'name:EncryptDecryptKey'"/>
<xsl:variable name="vEncryptedText" select="//*[local-name()='EncryptedText']"/>
<xsl:message>****Encrypted Text: <xsl:value-of select="$vEncryptedText"/>
</xsl:message>
<xsl:message>****Algorithm: <xsl:value-of select="$vAlgorithm"/>
</xsl:message>
<!-- The console log for the text and key are commented out to ensure the logs will not capture the plain text or key, but you may uncomment for debugging. -->
<!--<xsl:message>****Key: <xsl:value-of select="$vKey"/>
</xsl:message>-->
<xsl:variable name="vDecrypt">
<xsl:value-of select="dp:decrypt-data($vAlgorithm,$vKey,$vEncryptedText)"/>
</xsl:variable>
<decryptedResponse>
<decryptedText>
<xsl:value-of select="$vDecrypt"/>
</decryptedText>
</decryptedResponse>
</xsl:template>
</xsl:stylesheet>