Hi Shah,
I've not tried this in API Connect, but this has worked for me in a MPGW so it is worth a try
<xsl:variable name="client-cert" select="normalize-space(dp:auth-info('ssl-client-cert'))"/>
See https://www.ibm.com/docs/en/datapower-gateway/10.5.0?topic=functions-dpauth-info
Best Regards,
Steve Linn
------------------------------
Steve Linn
Senior Consulting I/T Specialist
IBM
------------------------------
Original Message:
Sent: Fri August 25, 2023 08:27 AM
From: Shah Wajahat
Subject: Get Tls profile certificate in gatewayscript
Hi Steve:
Thanks for your response. Actually my problem is that I am working on encryption and decryption for this work I need to certificate for encrypt the key
here the function
dp:encrypt-key(sessionKey, recipient, keyTransportAlgorithm)
in recipient string that identifies the public key of the recipient. This key can be in a certificate.
This is used on xslt that's why i need this key on xslt
------------------------------
Shah Wajahat
------------------------------
Original Message:
Sent: Thu August 24, 2023 02:27 PM
From: Steve Linn
Subject: Get Tls profile certificate in gatewayscript
Hi Shah,
What certificate are you trying to retrieve? If a TLS Mutual Authentication request, the client side certificate information should be available in the API Gateway context. See https://www.ibm.com/docs/en/api-connect/10.0.5.x_lts?topic=reference-api-connect-context-variables#rapim_context_var__cert-variables. These are populated when you enable application authentication in your API, see https://www.ibm.com/docs/en/api-connect/10.0.5.x_lts?topic=definition-configuring-application-authentication-api.
Best Regards,
Steve Linn
------------------------------
Steve Linn
Senior Consulting I/T Specialist
IBM