feat(tsl-api-reference): expand API and module coverage

This commit is contained in:
csh
2026-08-14 17:12:55 +08:00
parent 8f1056130d
commit 3d3036ebe1
571 changed files with 47842 additions and 14458 deletions
@@ -6,13 +6,13 @@
提供 RSA 非对称加密、解密和签名能力的内置对象
<!-- tags: Object TRSA 非对称加密 对象 实例 RSA -->
<!-- tags: Object TRSA 非对称加密 对象 实例 RSA 创建 生成 构造函数 实例化 new -->
### `create()`
声明:function
创建 TRSA 实例
无参数构造函数。创建 TRSA 实例
<!-- tags: Object TRSA 非对称加密 创建 生成 对象 实例 -->
@@ -29,8 +29,8 @@
可见性:public
| 参数 | 类型 | 说明 |
| --- | --- | --- |
| `s` | any | s |
| ---- | ---- | ---- |
| `s` | any | s |
返回:string
@@ -45,8 +45,8 @@
可见性:public
| 参数 | 类型 | 说明 |
| --- | --- | --- |
| `s` | any | s |
| ---- | ---- | ---- |
| `s` | any | s |
返回:string
@@ -61,8 +61,8 @@
可见性:public
| 参数 | 类型 | 说明 |
| --- | --- | --- |
| `s` | any | s |
| ---- | ---- | ---- |
| `s` | any | s |
返回:string
@@ -77,14 +77,14 @@
可见性:public
| 参数 | 类型 | 说明 |
| --- | --- | --- |
| `s` | any | s |
| ---- | ---- | ---- |
| `s` | any | s |
返回:string
### `GenerateKey`
### `generateKey(bits)`
声明:property
声明:function
生成指定位数的公钥和私钥,位数必须是256的正整数倍,最大4096
@@ -92,9 +92,20 @@
可见性:public
类型:any
| 参数 | 类型 | 说明 |
| ------ | ------- | -------------------------------------------- |
| `bits` | integer | 密钥位数,必须是 256 的正整数倍且不超过 4096 |
访问:read/write
#### 示例
范例01:生成 1024 位密钥
```tsl
obj := new TRSA();
obj.generateKey(1024);
return length(obj.publicKey) > 0;
// 输出:1
```
### `PrivateKey`