資源簡介
是RSA工具類,包括分段加密、分段解密、公私鑰對生成,是一份完整的工具類。
代碼片段和文件信息
package?com.hyb.restful.util;
import?java.math.BigInteger;
import?java.io.ByteArrayOutputStream;?
import?java.security.KeyFactory;
import?java.security.KeyPair;
import?java.security.KeyPairGenerator;
import?java.security.NoSuchAlgorithmException;
import?java.security.interfaces.RSAPrivateKey;
import?java.security.interfaces.RSAPublicKey;
import?java.security.spec.InvalidKeySpecException;
import?java.security.spec.PKCS8EncodedKeySpec;
import?java.security.spec.RSAPrivateKeySpec;
import?java.security.spec.RSAPublicKeySpec;
import?java.security.spec.X509EncodedKeySpec;
import?java.util.HashMap;
import?java.util.Map;
import?javax.crypto.Cipher;
import?org.apache.log4j.Logger;
import?org.bouncycastle.util.encoders.base64;
public?class?RsaUtils?{
private?static?final?Logger?logger?=?Logger
- 上一篇:Javaweb在線支付模塊源代碼支持網銀接口
- 下一篇:ATM系統連接數據庫
評論
共有 條評論