ms-types 0.3.29 → 0.3.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/types/cryptoUtils.d.ts +6 -16
package/package.json
CHANGED
package/types/cryptoUtils.d.ts
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
declare namespace cryptoUtils {
|
|
2
2
|
/// 使用AES ECB模式加密数据 默认使用PKCS7填充
|
|
3
3
|
/// - Parameters:
|
|
4
|
-
/// - aesKey: AES密钥
|
|
5
4
|
/// - data: 要加密的数据
|
|
5
|
+
/// - aesKey: AES密钥 支持16位、24位、32位字符串
|
|
6
6
|
/// - noPadding: 是否禁用填充,默认为false, 默认使用PKCS7填充
|
|
7
7
|
/// - Returns: 加密后的数据
|
|
8
8
|
function encryptWithAES_ECB(
|
|
9
|
-
aesKey: string,
|
|
10
9
|
data: string,
|
|
10
|
+
aesKey: string,
|
|
11
11
|
noPadding?: boolean
|
|
12
12
|
): string;
|
|
13
13
|
|
|
14
14
|
/// 使用AES ECB模式解密数据 默认使用PKCS7填充
|
|
15
15
|
/// - Parameters:
|
|
16
|
-
/// - aesKey: AES密钥 32位16进制字符串
|
|
17
16
|
/// - data: 要解密的数据
|
|
17
|
+
/// - aesKey: AES密钥 支持16位、24位、32位字符串
|
|
18
18
|
/// - noPadding: 是否禁用填充,默认为false, 默认使用PKCS7填充
|
|
19
19
|
/// - Returns: 解密后的数据
|
|
20
20
|
function decryptWithAES_ECB(
|
|
21
|
-
aesKey: string,
|
|
22
21
|
data: string,
|
|
22
|
+
aesKey: string,
|
|
23
23
|
noPadding?: boolean
|
|
24
24
|
): string;
|
|
25
25
|
|
|
@@ -27,25 +27,15 @@ declare namespace cryptoUtils {
|
|
|
27
27
|
/// - Parameters:
|
|
28
28
|
/// - data: 要加密的数据
|
|
29
29
|
/// - rsaPublicKey: RSA公钥
|
|
30
|
-
/// - keySize: RSA密钥位数
|
|
31
30
|
/// - Returns: 加密后的数据
|
|
32
|
-
function encryptWithRSA(
|
|
33
|
-
data: string,
|
|
34
|
-
rsaPublicKey: string,
|
|
35
|
-
keySize: number
|
|
36
|
-
): string;
|
|
31
|
+
function encryptWithRSA(data: string, rsaPublicKey: string): string;
|
|
37
32
|
|
|
38
33
|
/// 使用RSA私钥解密数据 默认使用PKCS1填充
|
|
39
34
|
/// - Parameters:
|
|
40
35
|
/// - data: 要解密的数据
|
|
41
36
|
/// - rsaPrivateKey: RSA私钥
|
|
42
|
-
/// - keySize: RSA密钥位数
|
|
43
37
|
/// - Returns: 解密后的数据
|
|
44
|
-
function decryptWithRSA(
|
|
45
|
-
data: string,
|
|
46
|
-
rsaPrivateKey: string,
|
|
47
|
-
keySize: number
|
|
48
|
-
): string;
|
|
38
|
+
function decryptWithRSA(data: string, rsaPrivateKey: string): string;
|
|
49
39
|
|
|
50
40
|
/// 计算MD5值
|
|
51
41
|
/// - Parameters:
|