Any software that needs to encrypt data using OpenPGP, or to verify an OpenPGP signature on data, should use the stateless OpenPGP interface, or SOP, which is provided for a number of OpenPGP implementations. Using any other interface is going to lock in the software to that implementation.
Also, SOP is lovely to use from another program. It's designed to be nice to use from a program.

Stateless OpenPGP ("SOP")
Stateless OpenPGP (SOP) # The “Stateless OpenPGP Command Line Interface” is an evolving specification of a vendor-agnostic way to use OpenPGP. The SOP specification outlines a “generic stateless command-line interface for dealing with OpenPGP messages, certificates, and secret key material”. Many tools, based on a wide range of OpenPGP libraries, implement the SOP standard. In this text we will often use SOP tools to explore OpenPGP concepts, since they are (by design) both easy to use and easy to reason about.