[CryptoAPI] I´m geeting an error when I try to encypt

Forge Component
(26)
Published on 3 Mar by Ricardo Silva
26 votes
Published on 3 Mar by Ricardo Silva

Hello!

I did a basic implementation in order to test the encryption:



But when I fill the data and call the Action I got an error:



Could you help me understanding the cause?

Hi,

Did you follow the demo on this? I was able to test this one using the demo.

https://www.outsystems.com/forge/component-overview/4554/cryptoapi-demo

Regards,

JC

Hi Leo Santos,


You need to use action RSA_GetPublicKey and pass a PrivateKey to get the PublicKey before you call the action RSA_Encrypt and pass the PublicKey.


Please see example below:


SyntaxEditor Code Snippet

RSA_Encrypt(RSA_GetPublicKey(PrivateKey),Data)