public async Task VerifyReturnsFalseIfSignatureIsNull() { var base64Content = "Hello World!".ToBase64Url(); var content = new AttachmentContent { Base64 = base64Content }; var result = await content.VerifyJsonWebSignature(); Assert.False(result); }
public async Task CanVerifySignedAttachmentContent() { var base64Content = "Hello World!".ToBase64Url(); var content = new AttachmentContent { Base64 = base64Content }; var key = await Crypto.CreateKeyAsync(_agent.Wallet, "{}"); await content.SignWithJsonWebSignature(_agent.Wallet, key); var result = await content.VerifyJsonWebSignature(); Assert.True(result); }
public async Task VerifyReturnsFalseWithWrongSignature() { var base64Content = "Hello World!".ToBase64Url(); var content = new AttachmentContent { Base64 = base64Content }; var key = await Crypto.CreateKeyAsync(_agent.Wallet, "{}"); await content.SignWithJsonWebSignature(_agent.Wallet, key); content.Base64 = "Changed content".ToBase64Url(); var result = await content.VerifyJsonWebSignature(); Assert.False(result); }