RE: StrongNameIdentityPermission LinkDemand error "mscorlib" ??
From: Abelardo Vacca (AbelardoVacca_at_discussions.microsoft.com)
Date: 02/01/05
- Next message: Abelardo Vacca: "Protecting assemblies from being used outside a company/group/team"
- Previous message: lelteto: "RE: Problems with public key decryption with RSA"
- In reply to: Abelardo Vacca: "StrongNameIdentityPermission LinkDemand error "mscorlib" ??"
- Next in thread: Nicole Calinoiu: "Re: StrongNameIdentityPermission LinkDemand error "mscorlib" ??"
- Reply: Nicole Calinoiu: "Re: StrongNameIdentityPermission LinkDemand error "mscorlib" ??"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Date: Tue, 1 Feb 2005 05:05:02 -0800
Ok, I found out my problem, so I am going to answer myself.
The command "sn -tp myKey.snk" was not actually returning the public key.
To get the public key I had to extract the public key first:
sn -p myKey.snk myPublicKey.snk
And then visualize the public key like this:
sn -tp myPublicKey.snk
I still do not know why this procedure returns a different public key than
using the original command: sn -tp myKey.snk
I find it odd specially since it is documented this way on the OReilly .NET
Security book (page 22), I wonder if I misunderstood the book or if it is
their mistake.
Thank you
"Abelardo Vacca" wrote:
> Hello,
>
> I am new to CAS.
>
> I am trying to protect my assemblies so they cannot be called by other
> assemblies not signed by our company.
>
> I create a company key pair using: sn -k myKey.snk
> I read the public key with: sn -tp myKey.snk
> I demand ask for StrongNameIdentityPermission before the class to protect
> like this:
> [StrongNameIdentityPermission(SecurityAction.LinkDemand, PublicKey:="4353bb
> ... whatever ... 423a")]
>
> But then I get a Security Exception when running the application:
> Request for the permission of type
> System.Security.Permissions.StrongNameIdentityPermission, mscorlib,
> Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 failed.
>
> Is mscorlib calling calling my class?
> Why am I getting this error
>
> I tried to follow a previous topic by Carel Lotz, he had exactly the same
> problem... but I did not find any solution there.
>
> Help please
>
>
- Next message: Abelardo Vacca: "Protecting assemblies from being used outside a company/group/team"
- Previous message: lelteto: "RE: Problems with public key decryption with RSA"
- In reply to: Abelardo Vacca: "StrongNameIdentityPermission LinkDemand error "mscorlib" ??"
- Next in thread: Nicole Calinoiu: "Re: StrongNameIdentityPermission LinkDemand error "mscorlib" ??"
- Reply: Nicole Calinoiu: "Re: StrongNameIdentityPermission LinkDemand error "mscorlib" ??"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|