Is there a way to noninteractively lookup and bulk import a list of gpg keys on a public keyserver?
I work in the IT department of a company and would like to use a command to import the public keys of all the email addresses associated with our domain without needing to select each key one at a time.
I've been able to lookup keys and import them one at a time using the gpg command:
gpg --keyserver pgp.mit.edu --search-keys '@domain.com'
Replacing 'domain.com' with our domain, obviously. Once the keyserver loads all the keys I am able to select multiple keys by typing in '1, 2, 3,...' for as many keys as I want. Kind of tedious, but not bad.
I haven't found a way to import them all, or if that is even possible.
I checked the gpg man page for any additional information but couldn't find any flags that would do what exactly what I wanted. I tried the above command in combination with
--receive-keys flag, however, it seems that you need to specify a key id in order to receive them. Which, again, results in needing to import the keys one at a time.
The thought has crossed my mind that maybe gpg does not have a mechanism to bulk import for security precautions which would make sense to a degree. If that's the case I would totally understand that but have not found anything documenting that.