def GPGKeyCheck(value):
 value = value.replace(' ', '').replace(' DCTB ', '').strip()
 if (value in ('!CREATE', '!PASSWORD')):
  return value
 try:
  if (len(value) not in (8, 16, 40)):
   raise ValueError(_('Not a GPG key ID or fingerprint'))
  if (re.match('^[0-9A-F]+$', value.upper()) is None):
   raise ValueError(_('Not a GPG key ID or fingerprint'))
 except ValueError:
  try:
   return EmailCheck(value)
  except ValueError:
   raise ValueError(_('Not a GPG key ID or fingerprint'))
 return value.upper()

def GPGKeyCheck ( value ) : value = value . replace ( ' ' , '' ) . replace ( ' DCTB ' , '' ) . strip ( ) if ( value in ( '!CREATE' , '!PASSWORD' ) ) : return value try : if ( len ( value ) not in ( 8 , 16 , 40 ) ) : raise ValueError ( _ ( 'Not a GPG key ID or fingerprint' ) ) if ( re . match ( '^[0-9A-F]+$' , value . upper ( ) ) is None ) : raise ValueError ( _ ( 'Not a GPG key ID or fingerprint' ) ) except ValueError : try : return EmailCheck ( value ) except ValueError : raise ValueError ( _ ( 'Not a GPG key ID or fingerprint' ) ) return value . upper ( )
strip a gpg fingerprint of all spaces .