public void should_detect_a_base64_fake_signature() { const string message = "message to sign"; var simpleRsa = new SimpleRSA(); var pair = simpleRsa.GeneratePair(); var signed = "fake signature".ToByteArray().ToBase64String(); var verification = simpleRsa.Verify(message, signed, pair.PublicKey); verification.Should().Be(false); }
public void should_sign_and_verify_a_message_with_KeyPair() { const string message = "message to sign"; var simpleRsa = new SimpleRSA(); var pair = simpleRsa.GeneratePair(); var signed = simpleRsa.Sign(message, pair.PrivateKey); var verification = simpleRsa.Verify(message, signed, pair.PublicKey); verification.Should().Be(true); }