| 构造器和说明 |
|---|
C12() |
| 限定符和类型 | 方法和说明 |
|---|---|
static byte |
asc_to_bcd(byte asc) |
static byte[] |
ASCII_To_BCD(byte[] ascii,
int asc_len)
ASCII码转BCD码
|
static String |
bcd2Str(byte[] bytes)
BCD转字符串
|
static String |
c7(String data,
RSAPrivateKey privateKey)
私钥加密
|
static String |
d4(String data,
RSAPublicKey publicKey)
公钥解密
|
static String |
e5(String data,
RSAPrivateKey privateKey)
私钥解密
|
static String |
e8(String data,
RSAPublicKey publicKey)
公钥加密
|
static byte[][] |
splitArray(byte[] data,
int len)
拆分数组
|
static String[] |
splitString(String string,
int len)
拆分字符串
|
static RSAPrivateKey |
x1(String modulus,
String exponent)
使用模和指数生成RSA私钥
注意:【此代码用了默认补位方式,为RSA/None/PKCS1Padding,不同JDK默认的补位方式可能不同,如Android默认是RSA
/None/NoPadding】
|
static RSAPublicKey |
x2(String modulus,
String exponent)
使用模和指数生成RSA公钥
注意:【此代码用了默认补位方式,为RSA/None/PKCS1Padding,不同JDK默认的补位方式可能不同,如Android默认是RSA
/None/NoPadding】
|
static HashMap<String,Object> |
x3()
生成公钥和私钥
|
public static HashMap<String,Object> x3() throws NoSuchAlgorithmException
public static RSAPublicKey x2(String modulus, String exponent)
modulus - 模exponent - 指数public static RSAPrivateKey x1(String modulus, String exponent)
modulus - 模exponent - 指数public static String e8(String data, RSAPublicKey publicKey) throws Exception
data - publicKey - Exceptionpublic static String c7(String data, RSAPrivateKey privateKey) throws Exception
data - publicKey - Exceptionpublic static String d4(String data, RSAPublicKey publicKey) throws Exception
data - privateKey - Exceptionpublic static String e5(String data, RSAPrivateKey privateKey) throws Exception
data - privateKey - Exceptionpublic static byte[] ASCII_To_BCD(byte[] ascii,
int asc_len)
public static byte asc_to_bcd(byte asc)
public static String bcd2Str(byte[] bytes)
public static byte[][] splitArray(byte[] data,
int len)
Copyright © 2019. All rights reserved.