Skip to content

Commit

Permalink
update sign and verify test
Browse files Browse the repository at this point in the history
  • Loading branch information
myloveCc committed Aug 30, 2019
1 parent ae4de01 commit 534afa3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions test/NETCore.Encrypt.Tests/RSA_Tests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,7 @@ public void Rsa_SignAndVerify_Test()
{
//Act
var rawStr = "123456";
var rawStr1 = "123457";

var rsaKey = EncryptProvider.CreateRsaKey();
var privateKey = rsaKey.PrivateKey;
Expand All @@ -249,10 +250,12 @@ public void Rsa_SignAndVerify_Test()
var signStr = EncryptProvider.RSASign(rawStr, privateKey);

var result = EncryptProvider.RSAVerify(rawStr, signStr, publicKey);
var errorResult = EncryptProvider.RSAVerify(rawStr1, signStr, publicKey);

//Assert
Assert.NotEmpty(signStr);
Assert.True(result);
Assert.False(errorResult);
}

[Theory(DisplayName = "Rsa to pem test")]
Expand Down

0 comments on commit 534afa3

Please sign in to comment.