保护和保护.NET中的类或DLL不被IronPython使用

时间:2023-01-18 10:09:44

I want to use ironpython inside my C# App, but I am afraid that it will cause a security issue, I don't want the end user to use all the available DLLs of my App, instead I want to provide custom classes that user can use in python.

我想在我的C#App中使用ironpython,但我担心它会导致安全问题,我不希望最终用户使用我的应用程序的所有可用DLL,而是我想提供用户可以使用的自定义类在python中使用。

My question is how to secure my dlls from being used in ironpython. the end user may addReference of the dll, I want to secure most of the classes from being used.

我的问题是如何确保我的dlls不被用于ironpython。最终用户可能会添加dll的参考,我想保护大多数类不被使用。

1 个解决方案

#1


0  

The trick is to run IronPython in its own AppDomain and only provide the assemblies you want the user to be able to call to that AppDomain, and then set the security policy to prevent them from referencing more.

诀窍是在自己的AppDomain中运行IronPython,只提供您希望用户能够调用该AppDomain的程序集,然后设置安全策略以防止它们引用更多。

#1


0  

The trick is to run IronPython in its own AppDomain and only provide the assemblies you want the user to be able to call to that AppDomain, and then set the security policy to prevent them from referencing more.

诀窍是在自己的AppDomain中运行IronPython,只提供您希望用户能够调用该AppDomain的程序集,然后设置安全策略以防止它们引用更多。