com.siashan.toolkit.crypt.symmetric.SM4 Maven / Gradle / Ivy
package com.siashan.toolkit.crypt.symmetric;
/**
* SM4实现
*
* @author siashan
* @since 1.0.7
*/
public class SM4 extends SymmetricCrypt{
private static final long serialVersionUID = 1L;
public SM4(){}
@Override
public SymmetricAlgorithm getAlgorithm() {
return SymmetricAlgorithm.SM4;
}
public SM4(Mode mode,Padding padding){
super(SymmetricAlgorithm.SM4,mode,padding);
}
/**
* 构建加密算法类
* 默认实现:SM4/CBC/PKCS5Padding
*
* @return 加密算法类
*/
public static SymmetricCrypt build(){
return build(Mode.CBC,Padding.PKCS5Padding);
}
/**
* 构建加密算法类
*
* @param mode 密码模式
* @param padding 填充模式
* @return 加密算法类
*/
public static SM4 build(Mode mode,Padding padding){
return new SM4(mode,padding);
}
}