What is a partially trusted assembly/application/code/etc in .NET?

前端 未结 3 1882
陌清茗
陌清茗 2020-12-14 08:31

Could someone please explain? I couldn\'t find anything on the internet, everything talks about how to go about it in some way, but nothing says exactly what it is.

3条回答
  •  半阙折子戏
    2020-12-14 09:07

    A full-trust assembly has an unrestricted set of code access security permissions, which allows the code to access all resource types and perform privileged operations, subject only to operating system security. For example, if user Bob cannot access file Y, then neither can a full-trust assembly running in Bob's user space.

    A partial-trust assembly means that the code runs at less than full trust. The .NET Framework has several predefined trust levels that you can use directly or customise to meet your specific security requirements. For example, you can prevent an assembly from accessing SQL databases by denying SQLClientPermission.

    The trust level of an assembly can also be diminished by its origin. For example, code coming from a network share (in older versions of .NET) is trusted less than code coming from the local computer, and as a result is limited in its ability to perform privileged operations.

提交回复
热议问题