n20-common-lib 2.12.1 → 2.12.2
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
CHANGED
|
@@ -96,12 +96,12 @@ export async function getSign(plain, dn = getDN()) {
|
|
|
96
96
|
|
|
97
97
|
// 获取并验证证书信息
|
|
98
98
|
const checkRes = await getCertInfo(dn)
|
|
99
|
-
|
|
99
|
+
|
|
100
100
|
// 证书验证错误处理
|
|
101
101
|
const errorMessages = {
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
102
|
+
dnListEmpty: '没有匹配到证书!',
|
|
103
|
+
dnIsEmpty: 'DN参数为空!',
|
|
104
|
+
Empty: '当前Ukey不匹配!'
|
|
105
105
|
}
|
|
106
106
|
|
|
107
107
|
if (checkRes === -1 || Object.keys(errorMessages).includes(checkRes)) {
|
|
@@ -117,7 +117,7 @@ export async function getSign(plain, dn = getDN()) {
|
|
|
117
117
|
closeOnClickModal: false,
|
|
118
118
|
inputType: 'password'
|
|
119
119
|
})
|
|
120
|
-
|
|
120
|
+
|
|
121
121
|
return await performSign(plainText, pin)
|
|
122
122
|
} catch (error) {
|
|
123
123
|
return Promise.reject(error)
|
|
@@ -133,9 +133,7 @@ export async function getCertInfo(dn) {
|
|
|
133
133
|
return new Promise((resolve, reject) => {
|
|
134
134
|
// 获取证书列表
|
|
135
135
|
IWSASkfGetCertList(
|
|
136
|
-
process.env.VUE_APP_NetSign_ARG ||
|
|
137
|
-
window.VUE_APP_NetSign_ARG ||
|
|
138
|
-
'WTSKFInterface.dll',
|
|
136
|
+
process.env.VUE_APP_NetSign_ARG || window.VUE_APP_NetSign_ARG || 'WTSKFInterface.dll',
|
|
139
137
|
(CertListData, errorCode) => {
|
|
140
138
|
if (errorCode) {
|
|
141
139
|
Message.error(codeDate[errorCode])
|
|
@@ -157,7 +155,12 @@ export async function getCertInfo(dn) {
|
|
|
157
155
|
*/
|
|
158
156
|
async function performSign(plainText, value) {
|
|
159
157
|
return new Promise((resolve, reject) => {
|
|
160
|
-
|
|
158
|
+
let code = 'SM3'
|
|
159
|
+
// 有色信创国产系统 需要传入SHA1
|
|
160
|
+
if (window.VUE_APP_NetSign_ARG === '/opt/apps/cn.win-trust.usertool/files/bin/libSKFInterface.so') {
|
|
161
|
+
code = 'SHA1'
|
|
162
|
+
}
|
|
163
|
+
IWSASkfSignData(plainText, 0, value, code, (errorCode, signedData) => {
|
|
161
164
|
if (errorCode === 0 || errorCode === '0') {
|
|
162
165
|
resolve(signedData)
|
|
163
166
|
} else {
|