
s PublicKeyFile="c:/key/pem/certself.pem"
Set filestream=##class(%FileCharacterStream).%New()
Set filestream.Filename=PublicKeyFile
Set PublicKeyStr=filestream.Read(.len)
s Plaintext="1"
Set Ciphertext=##class(%SYSTEM.Encryption).RSAEncrypt(Plaintext,PublicKeyStr)
w ##class(%SYSTEM.Encryption).RSAGetLastError(),!
Set Ciphertext=##class(%SYSTEM.Encryption).Base64Encode(Ciphertext)
w Ciphertext,!
- Log in to post comments