Click here to Skip to main content
16,004,761 members
Home / Discussions / C#
   

C#

 
GeneralIntellisense and multi file assembly Pin
VizOne25-Mar-03 23:32
VizOne25-Mar-03 23:32 
GeneralRe: Intellisense and multi file assembly Pin
S O S26-Mar-03 2:32
S O S26-Mar-03 2:32 
GeneralRe: Intellisense and multi file assembly Pin
VizOne26-Mar-03 8:40
VizOne26-Mar-03 8:40 
GeneralVisual Studio .NET desiger BUG Pin
eugenl25-Mar-03 22:59
eugenl25-Mar-03 22:59 
QuestionRuntime type casting? Pin
Thomas W25-Mar-03 21:36
Thomas W25-Mar-03 21:36 
AnswerRe: Runtime type casting? Pin
Don_s25-Mar-03 22:03
Don_s25-Mar-03 22:03 
GeneralRe: Runtime type casting? Pin
Thomas W25-Mar-03 22:21
Thomas W25-Mar-03 22:21 
GeneralPublisherIdentityPermission question Pin
Anonymous25-Mar-03 21:29
Anonymous25-Mar-03 21:29 
We intend to give our Assembly out side our group and it'll be used in any .NET application including ASPX and ASMX.

To restrict unauthorized use of this Assembly, it will demand a X509 certificate through PublisherIdentityPermission.



We want to handle distribution process in the following way.

1. Sign the Assembly which we want to give out side our group with a Certificate.

2. We will also sign caller assembly/application with the same Certificate, there by authorizing them to use our assembly.

3. Callers will Assert PublisherIdentityPermission before making actual call to our assembly (to stop the stack-walk as any upstream apps do not need to be signed), See sample code at the end.



As far as the choice between PublisherIdentityPermission Vs StrongNameIdentityPermission, we decided to go with PublisherIdentityPermission.

Because we felt it’s easy to work with certificates.



If someone could validate our thoughts, that would be great.


Sample Code Snippets



OurAssembly.dll Code

namespace Microsoft.MSCOM.MemberServices.Samples.PublisherIdentityAssembly {
[PublisherIdentityPermissionAttribute(SecurityAction.Demand, CertFile="ramCertificate.cer")]
public class ModuleClass {
public void ModuleMethod() {
Console.WriteLine("PONG: from ModuleMethod in myModule.");
}
}
}


CallerAssembly.dll Code

namespace Microsoft.MSCOM.MemberServices.Samples.PublisherIdentityCaller {

public class CallerAssemblyClass {

public void AssemblyMethod() {

X509Certificate cert = X509Certificate.CreateFromSignedFile("CallerAssembly.dll");

PublisherIdentityPermission pip = new PublisherIdentityPermission (cert);
pip.Assert();

ModuleClass mod = new ModuleClass();
mod.ModuleMethod();

Console.WriteLine("Reverting Assert.");
CodeAccessPermission.RevertAssert();
}
}
}
GeneralXML object in C# Pin
novice.NET25-Mar-03 20:11
novice.NET25-Mar-03 20:11 
GeneralRe: XML object in C# Pin
Don_s25-Mar-03 22:12
Don_s25-Mar-03 22:12 
Generalcascading treeview checkbox changes Pin
vlusardi25-Mar-03 20:10
vlusardi25-Mar-03 20:10 
GeneralRe: cascading treeview checkbox changes Pin
Don_s25-Mar-03 22:23
Don_s25-Mar-03 22:23 
GeneralRe: cascading treeview checkbox changes Pin
vlusardi26-Mar-03 5:48
vlusardi26-Mar-03 5:48 
GeneralNeed some informations Pin
franck_alain25-Mar-03 11:09
franck_alain25-Mar-03 11:09 
QuestionVirutal Functions - new or override? Pin
monrobot1325-Mar-03 6:38
monrobot1325-Mar-03 6:38 
AnswerRe: Virutal Functions - new or override? Pin
Marc Clifton25-Mar-03 7:09
mvaMarc Clifton25-Mar-03 7:09 
AnswerRe: Virutal Functions - new or override? Pin
Paul Riley25-Mar-03 7:52
Paul Riley25-Mar-03 7:52 
AnswerRe: Virutal Functions - new or override? Pin
monrobot1325-Mar-03 8:31
monrobot1325-Mar-03 8:31 
Generalvirtual, not virutal Pin
leppie25-Mar-03 10:40
leppie25-Mar-03 10:40 
General.NET Wrapper for SharePoint Portal Pin
kaschimer25-Mar-03 3:53
kaschimer25-Mar-03 3:53 
GeneralRe: .NET Wrapper for SharePoint Portal Pin
David Stone26-Mar-03 12:47
sitebuilderDavid Stone26-Mar-03 12:47 
GeneralDoubt Regarding grid in .NET Pin
shankara_raman25-Mar-03 0:48
shankara_raman25-Mar-03 0:48 
GeneralFTP Uploads Pin
MrEyes25-Mar-03 0:25
MrEyes25-Mar-03 0:25 
GeneralLinking several .net modules into one .dll Pin
VizOne25-Mar-03 0:06
VizOne25-Mar-03 0:06 
GeneralRe: Linking several .net modules into one .dll Pin
Daniel Turini25-Mar-03 2:37
Daniel Turini25-Mar-03 2:37 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.