Ask a Question related to ASP.NET Security, Design and Development.
-
Bob Rock #1
Reading the public key inside a strongly signed assembly from the assembly itself???
Hello,
is it possible to programmatically read (and how) the public key that is
embedded into an assembly that has been strongly signed???
What code would be needed???
Bob Rock
Bob Rock Guest
-
Problem using an assembly
I have a User Control that I created (.ascx & .ascx.vb file pair) that I am trying to put in a separate assembly. I know that the User Control works... -
Assembly acessing StrongNamed assembly getting "Access Denied" intermitently
I have an ASP.NET application that is using a code library our development team uses. The code library is a few web controls in a Strong Named... -
Signed assembly will not load in internet explorer
I've got an assembly that implements a class that inherits System.Windows.Forms.UserControl. This works wonderfully when I embed it in an ASP.NET... -
Strongly Named Assemblies - how do you create an installation that allows an assembly key to be trusted?
We are publishing Winform controls in some of our WebForms. Our Assembly is strongly named, and we would like to create an installation that would... -
GAC assembly with ASP.NET
There's no need to put your Class Library in the GAC, give it a strong name, etc., BTW. You can just put a copy of the DLL in the /bin folder of... -
Nicole Calinoiu #2
Re: Reading the public key inside a strongly signed assembly from the assembly itself???
Bob,
The method below returns the key (if one is found) from any type's assembly.
To use it to retrieve the current assembly's key, call it as follows
(assuming you're calling from the class in which the method is declared):
StrongNamePublicKeyBlob myKey = this.GetSigningKey(this.GetType());
HTH,
Nicole
public StrongNamePublicKeyBlob GetSigningKey(Type sourceType)
{
if (sourceType == null) throw new ArgumentNullException("sourceType");
StrongNamePublicKeyBlob retVal = null;
foreach (object test in sourceType.Assembly.Evidence)
{
if (test is StrongName)
{
retVal = ((StrongName)test).PublicKey;
break;
}
}
return retVal;
}
"Bob Rock" <nospam.yet_another_apprentice@hotmail.com> wrote in message
news:2gpreqF5hhuoU1@uni-berlin.de...> Hello,
>
> is it possible to programmatically read (and how) the public key that is
> embedded into an assembly that has been strongly signed???
> What code would be needed???
>
> Bob Rock
>
>
Nicole Calinoiu Guest
-
Michel Gallant #3
Re: Reading the public key inside a strongly signed assembly from the assembly itself???
AssemblyName assemname = Assembly.LoadFrom(<assemblyfile>).GetName() ;
byte[] pubkey = assemname.GetPublicKey() ;
- Mitch
"Bob Rock" <nospam.yet_another_apprentice@hotmail.com> wrote in message
news:2gpreqF5hhuoU1@uni-berlin.de...> Hello,
>
> is it possible to programmatically read (and how) the public key that is
> embedded into an assembly that has been strongly signed???
> What code would be needed???
>
> Bob Rock
>
>
Michel Gallant Guest



Reply With Quote

