def create_temporary_ca_path(anchor_list, folder):
 try:
  if (not os.path.isdir(folder)):
   os.makedirs(folder)
 except:
  return None
 l = len(anchor_list)
 if (l == 0):
  return None
 fmtstr = ('%%0%sd.pem' % math.ceil(math.log(l, 10)))
 i = 0
 try:
  for a in anchor_list:
   fname = os.path.join(folder, (fmtstr % i))
   f = open(fname, 'w')
   s = a.output(fmt='PEM')
   f.write(s)
   f.close()
   i += 1
 except:
  return None
 (r, w) = popen2.popen2(('c_rehash %s' % folder))
 r.close()
 w.close()
 return l

def create_temporary_ca_path ( anchor_list , folder ) : try : if ( not os . path . isdir ( folder ) ) : os . makedirs ( folder ) except : return None l = len ( anchor_list ) if ( l == 0 ) : return None fmtstr = ( '%%0%sd.pem' % math . ceil ( math . log ( l , 10 ) ) ) i = 0 try : for a in anchor_list : fname = os . path . join ( folder , ( fmtstr % i ) ) f = open ( fname , 'w' ) s = a . output ( fmt = 'PEM' ) f . write ( s ) f . close ( ) i += 1 except : return None ( r , w ) = popen2 . popen2 ( ( 'c_rehash %s' % folder ) ) r . close ( ) w . close ( ) return l
create a ca path folder as defined in openssl terminology .