天堂国产午夜亚洲专区-少妇人妻综合久久蜜臀-国产成人户外露出视频在线-国产91传媒一区二区三区

當(dāng)前位置:主頁(yè) > 論文百科 > 期刊論文 >

nagle算法_RSA 數(shù)據(jù)加密,數(shù)字簽名算法

發(fā)布時(shí)間:2016-10-03 13:29

  本文關(guān)鍵詞:數(shù)字簽名算法,由筆耕文化傳播整理發(fā)布。


RSA 數(shù)據(jù)加密,數(shù)字簽名算法

java.math.BigInteger;
java.security.KeyFactory;
java.security.KeyPairGenerator;
java.security.PublicKey;
java.security.interfaces.RSAPrivateKey;
java.security.spec.PKCS8EncodedKeySpec;
java.util.HashMap;
javax.crypto.Cipher;

RSACryptUtil {
String KEY_ALGORITHM = "RSA";
String SIGNATURE_ALGORITHM = "MD5withRSA";
String PUBLIC_KEY = "RSAPublicKey";
String PRIVATE_KEY = "RSAPrivateKey";

String sign([] keyBytes = CryptUtil.decryptBASE64(privateKey);
PKCS8EncodedKeySpec pkcs8KeySpec = KeyFactory keyFactory = KeyFactory.getInstance(KEY_ALGORITHM);
PrivateKey priKey = keyFactory.generatePrivate(pkcs8KeySpec);
Signature signature = Signature.getInstance(SIGNATURE_ALGORITHM);

verify([] keyBytes = CryptUtil.decryptBASE64(publicKey);
X509EncodedKeySpec keySpec = KeyFactory keyFactory = KeyFactory.getInstance(KEY_ALGORITHM);
PublicKey pubKey = keyFactory.generatePublic(keySpec);
signature.verify(CryptUtil.decryptBASE64(sign));

[] decryptByPrivateKey([] keyBytes = CryptUtil.decryptBASE64(key);
PKCS8EncodedKeySpec pkcs8KeySpec = Cipher cipher = Cipher.getInstance(keyFactory.getAlgorithm());

[] decryptByPublicKey([] keyBytes = CryptUtil.decryptBASE64(key);
X509EncodedKeySpec x509KeySpec = Cipher cipher = Cipher.getInstance(keyFactory.getAlgorithm());

[] encryptByPublicKey([] keyBytes = CryptUtil.decryptBASE64(key);
X509EncodedKeySpec x509KeySpec = Cipher cipher = Cipher.getInstance(keyFactory.getAlgorithm());

[] encryptByPrivateKey([] keyBytes = CryptUtil.decryptBASE64(key);
PKCS8EncodedKeySpec pkcs8KeySpec = Cipher cipher = Cipher.getInstance(keyFactory.getAlgorithm());

String getPrivateKey(Map

  本文關(guān)鍵詞:數(shù)字簽名算法,,由筆耕文化傳播整理發(fā)布。



本文編號(hào):129871

資料下載
論文發(fā)表

本文鏈接:http://sikaile.net/wenshubaike/xingzhengshiwu/129871.html


Copyright(c)文論論文網(wǎng)All Rights Reserved | 網(wǎng)站地圖 |

版權(quán)申明:資料由用戶6d4d7***提供,本站僅收錄摘要或目錄,作者需要?jiǎng)h除請(qǐng)E-mail郵箱bigeng88@qq.com