
Security News
/Research
Wallet-Draining npm Package Impersonates Nodemailer to Hijack Crypto Transactions
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
电子签章GWS SDK,调用前需确保已安装GZCA数字证书客户端并启动,支持TypeScript。
Install with npm
npm install gws-seal --save
Install with yarn
yarn add gws-seal
Install with pnpm
pnpm add gws-seal
使用包管理器
import { GwsService } from "gws-seal";
const gwsService = new GwsService(gwsServiceConfig);
import { createService } from "gws-seal";
async function foo() {
const gwsService = await createService(gwsServiceConfig);
}
使用本地文件
import { GwsService } from "./index.es.js"; // SDK文件地址
const gzcaService = new GwsService(gwsServiceConfig);
import { createService } from "./index.es.js"; // SDK文件地址
async function foo() {
const gwsService = await createService(gwsServiceConfig);
}
<script src="./index.umd.js"></script>
const gzcaService = new GWS_SEAL.GwsService(gwsServiceConfig);
async function foo() {
const gwsService = await GWS_SEAL.createService(gwsServiceConfig);
}
属性 | 说明 | 类型 | 默认值 |
---|---|---|---|
appKey | 必填,appKey | String | -- |
secret | 必填,应用密钥 | String | -- |
baseUrl | 必填,服务器地址 | String | -- |
onOpen | 可选,签章服务端socket连接成功回调 | (event: Event) => void | -- |
onError | 可选,签章服务端socket错误时回调 | (event: Event) => void | -- |
onClose | 可选,签章服务端socket关闭时回调 | (event: Event) => void | -- |
onMessage | 可选,签章服务端socket收到消息时回调 | (data: Record<string, any>) => void | -- |
onRequestError | 可选,http请求错误时回调 | (data: Record<string, any>) => void | -- |
theme | 可选,弹窗主题色 | String | #409eff |
gwsClientConfig | 可选,gws-client实例化参数 | Object | -- |
属性 | 说明 | 类型 | 默认值 |
---|---|---|---|
isRememberPin | 可选,是否记住pin码 | Boolean | false |
pinPolicy | 可选,口令安全策略 | 0 | 1 | 2 | 3 | 0 |
onOpen | 可选,客户端socket连接成功回调 | (event: Event) => void | -- |
onError | 可选,客户端socket错误时回调 | (event: Event) => void | -- |
onClose | 可选,客户端socket关闭时回调 | (event: Event) => void | -- |
onMessage | 可选,客户端socket收到消息时回调 | (data: Record<string, any>) => void | -- |
onUkeyChange | 可选,Ukey插入拔出时回调 | (event: {type: 'remove' | 'insert', data: CertType}) => void | -- |
链式调用
// 位置签章
import { createService } from "gws-seal";
createService(gwsServiceConfig).then((gwsService) => {
gzcaService
.positionSealing(params)
.then((res) => {
console.log("签章文件url", res);
})
.catch((error) => {
console.log("签章失败原因", error);
});
});
同步调用
// 位置签章
import { createService } from "gws-seal";
async function positionSealing() {
try {
const gzcaService = await createService(gwsServiceConfig);
const res = await gzcaService.positionSealing(params);
console.log("签章文件url", res);
} catch (error) {
console.log("签章失败原因", error);
}
}
断开socket连接
destroy
type Destroy = () => void;
重新连接socket,可重新传入新配置
restart
type Restart = (config?: GwsServiceConfig) => void;
位置签章,返回签章文件url
positionSealing
type PositionSealing = (params: {
fileType: string;
fileData?: string;
filePath?: string;
page?: number;
height?: number;
width?: number;
x: number;
y: number;
}) => Promise<string>;
属性 | 说明 | 类型 | 默认值 |
---|---|---|---|
fileType | 必填,文件类型 | PDF | OFD | -- |
fileData | 可选,与filePath二选一,待签章文件(Base64) | String | -- |
filePath | 可选,与fileData二选一,签章系统能访问的URL地址 | String | -- |
page | 必填,位置签章页,第一页从0开始 | Number | -- |
height | 可选,图片高度(毫米) | Number | -- |
width | 可选,图片宽度(毫米) | Number | -- |
x | 必填,位置签章坐标,表示签章后的X的位置。起始点为左下角 | Number | -- |
y | 必填,位置签章坐标,表示签章后的Y的位置。起始点为左下角 | Number | -- |
关键字签章,返回签章文件url
keywordSealing
type KeywordSealing = (params: {
fileType: string;
fileData?: string;
filePath?: string;
height?: number;
width?: number;
keyword: string;
offX?: number;
offY?: number;
}) => Promise<string>;
属性 | 说明 | 类型 | 默认值 |
---|---|---|---|
fileType | 必填,文件类型 | PDF | OFD | -- |
fileData | 可选,与filePath二选一,待签章文件(Base64) | String | -- |
filePath | 可选,与fileData二选一,签章系统能访问的URL地址 | String | -- |
height | 可选,图片高度(毫米) | Number | -- |
width | 可选,图片宽度(毫米) | Number | -- |
keyword | 必填,关键字 | String | -- |
offX | 可选,关键字签章x偏移量,正数向右,负数向左 | Number | 0 |
offY | 可选,关键字签章y偏移量,正数向上,负数向下 | Number | 0 |
骑缝章签章,返回签章文件url
connectiveSealing
type ConnectiveSealing = (params: {
fileType: string;
fileData?: string;
filePath?: string;
height?: number;
width?: number;
connOff?: number;
}) => Promise<string>;
属性 | 说明 | 类型 | 默认值 |
---|---|---|---|
fileType | 必填,文件类型 | PDF | OFD | -- |
fileData | 可选,与filePath二选一,待签章文件(Base64) | String | -- |
filePath | 可选,与fileData二选一,签章系统能访问的URL地址 | String | -- |
height | 可选,图片高度(毫米) | Number | -- |
width | 可选,图片宽度(毫米) | Number | -- |
connOff | 可选,偏移量,正数向上,负数向下。默认在右侧的中心为0 | Number | 0 |
多处位置签章,返回签章文件url
multiplePositionSealing
type multiplePositionSealing = (params: {
fileType: string;
fileData?: string;
filePath?: string;
pictureList: PositionType[];
}) => Promise<string>;
type PositionType = {
height?: number;
width?: number;
page: number;
x: number;
y: number;
};
属性 | 说明 | 类型 | 默认值 |
---|---|---|---|
fileType | 必填,文件类型 | PDF | OFD | -- |
fileData | 可选,与filePath二选一,待签章文件(Base64) | String | -- |
filePath | 可选,与fileData二选一,签章系统能访问的URL地址 | String | -- |
pictureList | 必填,批量位置对象,对象内容如下 | PositionType[] | -- |
属性 | 说明 | 类型 | 默认值 |
---|---|---|---|
page | 必填,位置签章页,第一页从0开始 | Number | -- |
height | 可选,图片高度(毫米) | Number | -- |
width | 可选,图片宽度(毫米) | Number | -- |
x | 必填,位置签章坐标,表示签章后的X的位置。起始点为左下角 | Number | -- |
y | 必填,位置签章坐标,表示签章后的Y的位置。起始点为左下角 | Number | -- |
FAQs
gws-seal
The npm package gws-seal receives a total of 1 weekly downloads. As such, gws-seal popularity was classified as not popular.
We found that gws-seal demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.