An entity represents GPG public + private key information. The ReadKeyRing
function allows ReadKeyRing
to read a list of GPG keys.
The documentation for the Entity.Serialize function says:
Serialize writes the open part of this object to w. (Material with a private key will not be output).
Since this is only the public part of the object, you can create a new object with serialized data as the public key.
WriteKeyRing
really does not exist. It would go through a list of objects and extract the public keys into an array.
source share