com.baidu.sapi2.security
类 EncryptHelper
java.lang.Object
com.baidu.sapi2.security.EncryptHelper
public class EncryptHelper
- extends Object
对所有接口(登陆、注册、补填用户名、注销等)中上行数据进行加密
先到pass请求证书,用RSA算法加密,其中包括一个随机生成的密钥,
pass返回的数据是通过AES加密的,我们用这个随机生成的密要解密
从类 java.lang.Object 继承的方法 |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
EncryptHelper
public EncryptHelper()
encrypt
public String encrypt(String cert,
String text)
throws CertificateException,
InvalidKeyException,
NoSuchAlgorithmException,
NoSuchPaddingException,
IllegalBlockSizeException,
BadPaddingException,
UnsupportedEncodingException
- 抛出:
CertificateException
InvalidKeyException
NoSuchAlgorithmException
NoSuchPaddingException
IllegalBlockSizeException
BadPaddingException
UnsupportedEncodingException
decrypt
public String decrypt(String decText)
throws Exception
- 抛出:
Exception
getAESKey
public String getAESKey()
setAESKey
public void setAESKey(String key)
Copyright © 2013. All Rights Reserved.