We (https://summitto.com) open-sourced a C++17 based PGP packet library. Using the library, you can create packets, encode and decode packet data and create a PGP key from e.g. a raw elliptic curve point. We've seen quite a lot of bad publicity for PGP lately, but we hope this helps those who are stillf using it. Lo and behold:
https://github.com/summitto/pgp-packet-library