def _ssl_dn_extract_info(dn_string):
 search_string = re.search('/emailAddress=(.*)@([^/]+)', dn_string)
 if search_string:
  user = search_string.group(1)
  email = ('%s@%s' % (user, search_string.group(2)))
 else:
  raise ValueError
 search_string = re.search('/CN=([^/]+)/', dn_string)
 if search_string:
  fullname = search_string.group(1)
 else:
  raise ValueError
 return (user, email, fullname)

def _ssl_dn_extract_info ( dn_string ) : search_string = re . search ( '/emailAddress=(.*)@([^/]+)' , dn_string ) if search_string : user = search_string . group ( 1 ) email = ( '%s@%s' % ( user , search_string . group ( 2 ) ) ) else : raise ValueError search_string = re . search ( '/CN=([^/]+)/' , dn_string ) if search_string : fullname = search_string . group ( 1 ) else : raise ValueError return ( user , email , fullname )
extract username .