Ported remaining functions to support GPG