Get the public key of the calling assembly

  • Thread starter Thread starter Guest
  • Start date Start date
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.
 
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.
 
Back
Top