PassFruit.Security.Cryptography.HmacSha256.Compute C# (CSharp) Méthode

Compute() public méthode

public Compute ( byte message, byte key ) : byte[]
message byte
key byte
Résultat byte[]
        public byte[] Compute(byte[] message, byte[] key)
        {
            return PlatformSpecificCompute(message, key);
        }

Usage Example

Exemple #1
0
 /// <summary>
 /// A message is generated by encrypting a hard coded value with the provided Master Key and 
 /// Initialization Vector.
 /// The message is then passed to the hashing function and the key used is the provided Master Key.
 /// </summary>
 public Authorization(MasterKey masterKey, byte[] initializationVector, Aes aes, HmacSha256 hmacSha256)
 {
     InitializationVector = initializationVector;
     var ciphertext = aes.Encrypt(AuthorizedMessage, masterKey.SecretKey, initializationVector);
     Hmac = hmacSha256.Compute(ciphertext, masterKey.SecretKey);
 }