Hi,
You need all necessary imports in UiPath (everything near ‘using’ statement should be in imports tab in UiPath)
Probably you also need import appropriate nuget for that (BouncyCastle).
make sure you have UiPath project with C# language. Otherwise it is possible to translate this code to VB.
If everything from above is ok then we need error message from invoke code activity to find the issue.