System.Reflection.AssemblyName.SetPublicKeyToken Method

Sets the public key token, which is the last 8 bytes of the SHA-1 hash of the public key under which the application or assembly is signed.

Syntax

public void SetPublicKeyToken (byte[] publicKeyToken)

Parameters

publicKeyToken
A byte array containing the public key token of the assembly.

Remarks

When you set the public key by calling the AssemblyName.SetPublicKey(Byte[]) method, you must also use the AssemblyName.SetPublicKeyToken(Byte[]) method to provide a public key token. Otherwise, a System.Security.SecurityException is thrown when the AssemblyName.GetPublicKey method is called.

Requirements

Namespace: System.Reflection
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0