You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
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"));
|
|
|
|
}
|
|
|
|
|
|
|
|
@Test
|
|
|
|
public void passwordEncode() {
|
|
|
|
Assert.assertEquals(SecurityKit.passwordEncode("1234"), CommonCodeUtils.passwordEncode("1234"));
|
|
|
|
}
|
|
|
|
|
|
|
|
@Test
|
|
|
|
public void aes() {
|
|
|
|
String text = SecurityKit.aesEncrypt("zed", "IrgwAINYUSLqVxHL");
|
|
|
|
Assert.assertEquals("zed", SecurityKit.aesDecrypt(text, "IrgwAINYUSLqVxHL"));
|
|
|
|
}
|
|
|
|
}
|