· Aug 3, 2017

PGP encryption and decryption

 I like to know if COS has a PGP library for encryption and decryption messages received from an SFTP connection. We have  interfaces that we used BouncyCastle in C# but would like a native library for COS.

Discussion (6)1
Log in or sign up to continue

For an engineer this sounds like a quite challenging exercise to rewrite a PGP lib in COS.

But it seems more promising to wrap the existing (and hopefully well tested) code and consume it from Caché using one of the existing Gateways:

- Callout Gateway

- ActiveX Gateway

- or just  connect
over TCP/IP
or UDP
or a Pipe

I bet the community has even more ideas to reuse the existing code

No, there isn't.

What he meant is that Caché supports binding for other languages. But there isn't a native COS implementation for PGP.
The easiest way of achieving what you want is to use gpg using $zf (CallOut). Where you can emit a comand directly to the host OS.

Remember that by default Windows haven't a gpg command. But there's a version for it as well.

You can also use method ##class(%Net.Remote.Utility).RunCommandViaZF(cmd,,.output,,) for brevity. Where cmd should be your gpg command.