def init_save_key(key_size, key_dir, keyname='key-certbot.pem'):
 try:
  key_pem = make_key(key_size)
 except ValueError as err:
  logger.exception(err)
  raise err
 config = zope.component.getUtility(interfaces.IConfig)
 util.make_or_verify_dir(key_dir, 448, os.geteuid(), config.strict_permissions)
 (key_f, key_path) = util.unique_file(os.path.join(key_dir, keyname), 384, 'wb')
 with key_f:
  key_f.write(key_pem)
 logger.info('Generating key (%d bits): %s', key_size, key_path)
 return util.Key(key_path, key_pem)

def init_save_key ( key_size , key_dir , keyname = 'key-certbot.pem' ) : try : key_pem = make_key ( key_size ) except ValueError as err : logger . exception ( err ) raise err config = zope . component . getUtility ( interfaces . IConfig ) util . make_or_verify_dir ( key_dir , 448 , os . geteuid ( ) , config . strict_permissions ) ( key_f , key_path ) = util . unique_file ( os . path . join ( key_dir , keyname ) , 384 , 'wb' ) with key_f : key_f . write ( key_pem ) logger . info ( 'Generating key (%d bits): %s' , key_size , key_path ) return util . Key ( key_path , key_pem )
initializes and saves a privkey .