def get_secret_key(request, profile=None):
 if (not profile):
  if request.user.username:
   profile = request.user.profile
 if profile:
  params = request.GET.copy()
  if ('secret' in params):
   del params['secret']
  hash = hashlib.sha224()
  hash.update(unicode(params))
  hash.update(unicode(profile.id))
  hash.update(unicode(profile.user.date_joined))
  key = ((unicode(profile.id) + '.') + hash.hexdigest())
  return key
 return ''

def get_secret_key ( request , profile = None ) : if ( not profile ) : if request . user . username : profile = request . user . profile if profile : params = request . GET . copy ( ) if ( 'secret' in params ) : del params [ 'secret' ] hash = hashlib . sha224 ( ) hash . update ( unicode ( params ) ) hash . update ( unicode ( profile . id ) ) hash . update ( unicode ( profile . user . date_joined ) ) key = ( ( unicode ( profile . id ) + '.' ) + hash . hexdigest ( ) ) return key return ''
get a key from the gpg keychain keyid the key id of the key to be retrieved .