Beispiel #1
0
        public void GenerateFunctionKeyValue_GeneratesCorrectSecret()
        {
            // This is how the preliminary system key seed was generated.
            // "Functi01" can be used as the next string literal if this seed
            // is versioned. The bytes are reversed in an attempt to retain a
            // common prefix (left-hand data value) for the the seed if changed.
            ulong expectedSeed = BitConverter.ToUInt64(Encoding.ASCII.GetBytes("Functi00").Reverse().ToArray());

            Assert.Equal(expectedSeed, SecretGenerator.FunctionKeySeed);

            string secret = SecretGenerator.GenerateFunctionKeyValue();

            ValidateSecret(secret, SecretGenerator.FunctionKeySeed);
        }