Cryptography.get(String) 추가

master
mjkhan21 4 months ago
parent dce94b45db
commit 2f12fbcba7

@ -19,6 +19,15 @@ import cokr.xit.foundation.data.JSON;
* @author mjkhan
*/
public abstract class Cryptography extends AbstractComponent {
/**(xit-crypto.conf) Cryptography .
* @param name
* @return Cryptography
*/
public static Cryptography get(String name) {
CryptoDef def = Config.conf.getCryptoDef(name);
return def.newCrypto();
}
/** 암복호화 설정정보 */
protected CryptoDef def;
protected String charset;

@ -7,10 +7,8 @@ import org.apache.commons.beanutils.PropertyUtils;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import cokr.xit.base.crypto.bean.ARIA;
import cokr.xit.base.crypto.bean.DGuard;
import cokr.xit.base.crypto.bean.Echelon;
import cokr.xit.base.crypto.bean.XitAria;
public class CryptographyTest /* extends TestSupport */ {
private String
@ -37,7 +35,7 @@ public class CryptographyTest /* extends TestSupport */ {
@Test
void aria() {
String name = "aria";
Cryptography aria = new ARIA(name);
Cryptography aria = Cryptography.get(name);
Assertions.assertEquals(name, aria.name());
String encrypted = aria.encrypt(text),
@ -54,7 +52,7 @@ public class CryptographyTest /* extends TestSupport */ {
@Test
void xitAria() {
String name = "xit-aria";
Cryptography aria = new XitAria(name);
Cryptography aria = Cryptography.get(name);
String str = "7011102177320",
encrypted = aria.encrypt(str),

Loading…
Cancel
Save