File tree Expand file tree Collapse file tree 1 file changed +3
-0
lines changed
test/NETCore.Encrypt.Tests Expand file tree Collapse file tree 1 file changed +3
-0
lines changed Original file line number Diff line number Diff line change @@ -241,6 +241,7 @@ public void Rsa_SignAndVerify_Test()
241
241
{
242
242
//Act
243
243
var rawStr = "123456" ;
244
+ var rawStr1 = "123457" ;
244
245
245
246
var rsaKey = EncryptProvider . CreateRsaKey ( ) ;
246
247
var privateKey = rsaKey . PrivateKey ;
@@ -249,10 +250,12 @@ public void Rsa_SignAndVerify_Test()
249
250
var signStr = EncryptProvider . RSASign ( rawStr , privateKey ) ;
250
251
251
252
var result = EncryptProvider . RSAVerify ( rawStr , signStr , publicKey ) ;
253
+ var errorResult = EncryptProvider . RSAVerify ( rawStr1 , signStr , publicKey ) ;
252
254
253
255
//Assert
254
256
Assert . NotEmpty ( signStr ) ;
255
257
Assert . True ( result ) ;
258
+ Assert . False ( errorResult ) ;
256
259
}
257
260
258
261
[ Theory ( DisplayName = "Rsa to pem test" ) ]
You can’t perform that action at this time.
0 commit comments