I have a requirement to have a restriction in an assembly such that only assemblies that are signed with a given key can use it. I am inexperienced, but what I understand is signing is done to help identify who created the assembly. Hence, just signing this assembly should not be enough to ensure that all calling assemblies are signed. Probably the reverse is true, i.e. if an assembly is signed, all the assemblies it depends on should be signed(by the same key perhaps). What would be the way to meet the requirement?
Share
You can use PublisherIdentityPermissionAttribute.
If you apply PublisherIdentityPermissionAttribute to MyClass class then only classes in assemblies signed by the
mycert.cercertificate can use your class. You need to putSecurityAction.DemandUse like
You can also use it on assembly level to protect entire assembly (however assembly level security will not work since .Net 4.0 unless you set
<NetFx40_LegacySecurityPolicy enabled="true"/>in configuration).