def import_csr_file(csrfile, data):
 for (form, typ) in (('der', OpenSSL.crypto.FILETYPE_ASN1), ('pem', OpenSSL.crypto.FILETYPE_PEM)):
  try:
   domains = get_names_from_csr(data, typ)
  except OpenSSL.crypto.Error:
   logger.debug('CSR parse error (form=%s, typ=%s):', form, typ)
   logger.debug(traceback.format_exc())
   continue
  return (typ, util.CSR(file=csrfile, data=data, form=form), domains)
 raise errors.Error('Failed to parse CSR file: {0}'.format(csrfile))

def import_csr_file ( csrfile , data ) : for ( form , typ ) in ( ( 'der' , OpenSSL . crypto . FILETYPE_ASN1 ) , ( 'pem' , OpenSSL . crypto . FILETYPE_PEM ) ) : try : domains = get_names_from_csr ( data , typ ) except OpenSSL . crypto . Error : logger . debug ( 'CSR parse error (form=%s, typ=%s):' , form , typ ) logger . debug ( traceback . format_exc ( ) ) continue return ( typ , util . CSR ( file = csrfile , data = data , form = form ) , domains ) raise errors . Error ( 'Failed to parse CSR file: {0}' . format ( csrfile ) )
import a csr file .