Пример #1
0
 /// <summary>
 /// Gets the public key token
 /// </summary>
 /// <returns></returns>
 public byte[] GetPublicKeyToken()
 {
     if (publicKeyToken == null && publicKey != null)
     {
         try {
             publicKeyToken = AssemblyHasher.CreatePublicKeyToken(publicKey);
         }
         catch (IOException) { }
     }
     return(publicKeyToken);
 }
Пример #2
0
 /// <summary>
 /// Gets the public key token
 /// </summary>
 /// <returns></returns>
 public byte[]? GetPublicKeyToken()
 {
     if (publicKeyToken is null && !(publicKey is null))
     {
         try {
             publicKeyToken = AssemblyHasher.CreatePublicKeyToken(publicKey);
         }
         catch (IOException) { }
     }
     return(publicKeyToken);
 }
Пример #3
0
        public static byte[] Hash(byte[] data, DmdAssemblyHashAlgorithm hashAlgo)
        {
            if (data == null)
            {
                return(null);
            }

            using (var asmHash = new AssemblyHasher(hashAlgo)) {
                asmHash.Hash(data);
                return(asmHash.ComputeHash());
            }
        }