I use the following code to grab 509 certificate and show private key :
set x509 = ##class(%SYS.X509Credentials).GetByAlias("foo")
write x509,!
write x509.OwnerList,!
write x509.PrivateKey,!It works perfectly fine under Studio (eg: when called from output window) :
29@%SYS.X509Credentials
-----BEGIN RSA PRIVATE KEY-----
MIIEpAIBAAKC...
However, it fails when called in the context of a CSP request. I got a stack trace when displaying content of PrivateKey :
6@%SYS.X509Credentials
0??%Admin_Secure:USE MYNAMESPACE?-e^zPrivateKeyGet+2^%SYS.X509Credentials.1^1e^^User.www.1^1B^zOnPage+7^User.www.

.png)

.png)
.png)
.png)
.png)
.png)
First of all, what is data anonymization?