public void AlgorithmEqualsHmacSha512Signature() { var options = OptionsTestHelper.CreateBackendOptionsMock(); var provider = new JwtCryptoProvider(options.Object); provider.Algorithm .Should() .Be( SecurityAlgorithms.HmacSha512Signature, because: "this is the chosen security algorithm"); }
public void SecurityKeyIsSymmetricKeyProvidedInOptions() { var options = OptionsTestHelper.CreateBackendOptionsMock(); var provider = new JwtCryptoProvider(options.Object); provider.SecurityKey .Should() .BeOfType <SymmetricSecurityKey>(because: "we use a symettric security key"); var symmetricalKey = (SymmetricSecurityKey)provider.SecurityKey; symmetricalKey.Key.Should() .BeEquivalentTo( Encoding.UTF8.GetBytes(options.Object.CurrentValue.AuthNR.JWTSigningKey), because: "this is the key configured in the options"); }