|
|
|
@ -1,11 +1,11 @@
|
|
|
|
|
package com.fanruan.api.security; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import com.fr.stable.CommonCodeUtils; |
|
|
|
|
import org.junit.Assert; |
|
|
|
|
import org.junit.Test; |
|
|
|
|
|
|
|
|
|
public class SecurityKitTest { |
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
public void passwordDecode() { |
|
|
|
|
Assert.assertEquals(SecurityKit.passwordDecode("1234"), CommonCodeUtils.passwordDecode("1234")); |
|
|
|
@ -18,7 +18,8 @@ public class SecurityKitTest {
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
public void aes() { |
|
|
|
|
String text = SecurityKit.aesEncrypt("zed", "IrgwAINYUSLqVxHL"); |
|
|
|
|
Assert.assertEquals("zed", SecurityKit.aesDecrypt(text, "IrgwAINYUSLqVxHL")); |
|
|
|
|
String seed = SecurityKit.createSeed(); |
|
|
|
|
String text = SecurityKit.aesEncrypt("zed", seed); |
|
|
|
|
Assert.assertEquals("zed", SecurityKit.aesDecrypt(text, seed)); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|