public void Roundtrip(string text, TokenTypes types) { SecureTokenBuilder builder = new SecureTokenBuilder("p@ssw0rd", types); string token = builder.EncodeToken(text); string decoded = builder.DecodeToken(token); Assert.AreEqual(text, decoded); }
public void TamperWithAuthenticator() { SecureTokenBuilder builder = new SecureTokenBuilder("p@ssw0rd", TokenTypes.Hashed); string token = builder.EncodeToken("Hello world"); token = token.Substring(0, 4) + token.Substring(4, 8) + token.Substring(8); builder.DecodeToken(token); }