Get the public key of the calling assembly

G

Guest

Hello all
I want to make sure that methods calling a cryptographic assembly of mine have been written by an authorized individual. My plan is to sign assemblies with my public / private key pair (sn.exe). So I want to be able to call the GetPublicKey() method of the AssemblyName class in the System.Reflection namespace. Where I am stuck is how to get the assembly information of the caller

Thanks all.
 
R

Rob Teixeira [MVP]

Dim an As AssemblyName
Dim pubKey As Byte()
an = AssemblyName.GetAssemblyName([Assembly].GetCallingAssembly().Location)
pubKey = an.GetPublicKey()

-Rob Teixeira [MVP]

Ed C. said:
Hello all,
I want to make sure that methods calling a cryptographic assembly of
mine have been written by an authorized individual. My plan is to sign
assemblies with my public / private key pair (sn.exe). So I want to be able
to call the GetPublicKey() method of the AssemblyName class in the
System.Reflection namespace. Where I am stuck is how to get the assembly
information of the caller.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top