xlang v4.0 Release
程序设计语言基础库文档
载入中...
搜索中...
未找到
Crypto.xcs
浏览该文件的文档.
1
5@Declare
6class Crypto{
7 static const int NoPadding = 0,
8 PKCS1Padding = 1,
9 PKCS5Padding = 2,
10 SSLV23Padding = 3,
11 ZerosPadding = 4;
15 static long Md5Init();
16
26 static void Md5Update(long hmd5, byte [] buffer, int pos, int length);
27
28
33 static void MD5Final(long hmd5);
34
39 static byte[] MD5Get(long hmd5);
40
41
46 static void MD5Close(long hmd5);
47
51 static long SHA1Init();
52
62 static void SHA1Update(long hsha1, byte [] buffer, int pos, int length);
63
64
69 static void SHA1Final(long hsha1);
70
75 static byte[] SHA1Get(long hsha1);
76
77
82 static void SHA1Close(long hsha1);
83
87 static long RSA1Init();
88
98 static bool RSALoadFromPublicKey(long hrsa, byte [] buffer, int pos, int length);
99
109 static bool RSALoadFromPrivateKey(long hrsa, byte [] buffer, int pos, int length);
110
117 static bool RSACreate(long hrsa, int length);
118
130 static byte[] RSAPublicEncrypto(long hrsa, byte [] buffer, int pos, int length, int padding);
131
143 static byte[] RSAPublicEncrypto(long hrsa, byte [] buffer, int pos, int length, int padding);
144
156 static byte[] RSAPrivateEncrypto(long hrsa, byte [] buffer, int pos, int length, int padding);
157
169 static byte[] RSAPublicDecrypto(long hrsa, byte [] buffer, int pos, int length, int padding);
170
171
177 static byte [] RSAGetPrivateKey(long hrsa);
178
184 static byte [] RSAGetPublicKey(long hrsa);
185
190 static int RSADecryptoMaxSize(long hrsa);
191
196 static int RSAEncryptoMaxSize(long hrsa);
197
202 static void RSAClose(long hrsa);
203};
密码处理类
static const int SSLV23Padding
static long Md5Init()
创建 一个MD5加密的对象句柄
static bool RSALoadFromPrivateKey(long hrsa, byte [] buffer, int pos, int length)
使用私钥初始化一个RSA对象
static int RSADecryptoMaxSize(long hrsa)
获取可以解密的密文的最大数据长度
static byte [] RSAPrivateEncrypto(long hrsa, byte [] buffer, int pos, int length, int padding)
使用私钥加密数据
static void RSAClose(long hrsa)
关闭RSA对象
static const int PKCS1Padding
static int RSAEncryptoMaxSize(long hrsa)
获取可以加密的密文的最大数据长度
static const int ZerosPadding
static void SHA1Final(long hsha1)
SHA1更新结束
static bool RSACreate(long hrsa, int length)
产生一个模为length位的密钥对 创建RSA对象
static byte [] RSAGetPrivateKey(long hrsa)
获取私钥
static const int NoPadding
static byte [] RSAPublicDecrypto(long hrsa, byte [] buffer, int pos, int length, int padding)
使用公钥解密数据
static const int PKCS5Padding
static long RSA1Init()
创建 一个RSA加密的对象句柄
static void MD5Final(long hmd5)
MD5更新结束
static byte [] RSAPublicEncrypto(long hrsa, byte [] buffer, int pos, int length, int padding)
使用公钥加密数据
static void Md5Update(long hmd5, byte [] buffer, int pos, int length)
更新MD5内容
static byte [] RSAGetPublicKey(long hrsa)
获取公钥
static bool RSALoadFromPublicKey(long hrsa, byte [] buffer, int pos, int length)
使用公钥初始化一个RSA对象
static long SHA1Init()
创建 一个SHA1加密的对象句柄
static byte [] MD5Get(long hmd5)
获取MD5结果
static void SHA1Close(long hsha1)
关闭SHA1对象句柄
static void MD5Close(long hmd5)
关闭MD5对象句柄
static void SHA1Update(long hsha1, byte [] buffer, int pos, int length)
更新SHA1内容
static byte [] SHA1Get(long hsha1)
获取SHA1结果