@_restore_ownership
def receive_keys(keyserver=None, keys=None, user=None, gnupghome=None):
 ret = {'res': True, 'changes': {}, 'message': []}
 gpg = _create_gpg(user, gnupghome)
 if (not keyserver):
  keyserver = 'pgp.mit.edu'
 if isinstance(keys, six.string_types):
  keys = keys.split(',')
 recv_data = gpg.recv_keys(keyserver, *keys)
 for result in recv_data.results:
  if ('ok' in result):
   if (result['ok'] == '1'):
    ret['message'].append('Key {0} added to keychain'.format(result['fingerprint']))
   elif (result['ok'] == '0'):
    ret['message'].append('Key {0} already exists in keychain'.format(result['fingerprint']))
  elif ('problem' in result):
   ret['message'].append('Unable to add key to keychain')
 return ret

@ _restore_ownership def receive_keys ( keyserver = None , keys = None , user = None , gnupghome = None ) : ret = { 'res' : True , 'changes' : { } , 'message' : [ ] } gpg = _create_gpg ( user , gnupghome ) if ( not keyserver ) : keyserver = 'pgp.mit.edu' if isinstance ( keys , six . string_types ) : keys = keys . split ( ',' ) recv_data = gpg . recv_keys ( keyserver , * keys ) for result in recv_data . results : if ( 'ok' in result ) : if ( result [ 'ok' ] == '1' ) : ret [ 'message' ] . append ( 'Key {0} added to keychain' . format ( result [ 'fingerprint' ] ) ) elif ( result [ 'ok' ] == '0' ) : ret [ 'message' ] . append ( 'Key {0} already exists in keychain' . format ( result [ 'fingerprint' ] ) ) elif ( 'problem' in result ) : ret [ 'message' ] . append ( 'Unable to add key to keychain' ) return ret
receive key(s) from keyserver and add them to keychain keyserver keyserver to use for searching for gpg keys .