com.baidu.sapi2.share
类 NativeCrypto
java.lang.Object
com.baidu.sapi2.share.NativeCrypto
public class NativeCrypto
- extends Object
加解密工具,基于AES-CBC-128位加密,密匙由native层提供
- 作者:
- yuankai02
从类 java.lang.Object 继承的方法 |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
NativeCrypto
public NativeCrypto()
destroy
public static void destroy()
throws Throwable
- 抛出:
Throwable
encrypt
public static String encrypt(android.content.Context context,
String string)
throws Throwable
- 字符串加密,包内可见
- 参数:
string
- 待加密的明文
- 返回:
- 加密后的字符串,如果输入参数不合法则返回空
- 抛出:
Throwable
decrypt
public static String decrypt(android.content.Context context,
String string)
throws Throwable
- 字符串解密,包内可见
- 参数:
string
- 待解密的密文
- 返回:
- 解密后的字符串,如果输入参数不合法或字符串不合法返回null
- 抛出:
Throwable
Copyright © 2013. All Rights Reserved.