I have a compactJWE that I want to decrypt using a key. I read the key from a .pem file and create a JWK with "RSA-OAEP" algorithm. I have the code below in a routine (.mac) file.
decryptJWE
#include %msqls file = ##class(%Stream.FileBinary).%New()
s file.Filename = "mycert.pem"s rsaKey = file.Read($$$MaxLocalLength)
zw rsaKey
s compactJWE = "en.cry.pted.jwe"s jwk = ##class(%Net.JSON.JWK).%New()
s jwkStatus = jwk.Create("RSA-OAEP", rsaKey , .privJWK, .pubJWK)
zw jwkStatus
s jwks = ##class(%Net.JSON.JWKS).%New()
s jwksStatus =
.jpg)
.png)
.jpg)
.png)



