@toolspack/ttd-common 0.5.2 → 0.5.4
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/README.md +3 -1
- package/lib/ttd-common.common.js +228 -209
- package/lib/ttd-common.umd.js +228 -209
- package/lib/ttd-common.umd.min.js +1 -1
- package/package.json +2 -2
- package/src/packages/ukey/SignNew.vue +20 -1
- package/src/packages/ukey/Ukey.vue +35 -2
- package/src/packages/ukey/WZHforChrome.js +9 -18
- package/src/packages/ukey/WzhSign.vue +30 -25
- package/src/packages/ukey/WzhSignChrome.vue +7 -16
- package/src/packages/ukey/CheckUkeyMethods.js +0 -38
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
export default {
|
|
2
|
-
methods: {
|
|
3
|
-
// 消息签名, 生成Base64 编码的 PKCS#7 签名结果
|
|
4
|
-
SignOnClick() {
|
|
5
|
-
let errorDesc = ''
|
|
6
|
-
this.sourceData = `${new Date().getTime() }`
|
|
7
|
-
try {
|
|
8
|
-
const source = this.sourceData
|
|
9
|
-
let signature = ''
|
|
10
|
-
const signType = 'Attach' // 签名类型
|
|
11
|
-
const selectedAlg = 'SHA-1' // 哈希算法(仅对RSA算法有效,SM2默认使用SM3哈希算法):
|
|
12
|
-
|
|
13
|
-
if (signType === 'Attach') {
|
|
14
|
-
// PKCS#7 Attach
|
|
15
|
-
signature = this.CryptoAgent.SignMsgPKCS7(source, selectedAlg, true)
|
|
16
|
-
} else if (signType === 'Detach') {
|
|
17
|
-
// PKCS#7 Detach
|
|
18
|
-
signature = this.CryptoAgent.SignMsgPKCS7(source, selectedAlg, false)
|
|
19
|
-
} else {
|
|
20
|
-
// PKCS#1
|
|
21
|
-
signature = this.CryptoAgent.SignMsgPKCS1(source, selectedAlg)
|
|
22
|
-
}
|
|
23
|
-
if (!signature) {
|
|
24
|
-
errorDesc = this.CryptoAgent.GetLastErrorDesc()
|
|
25
|
-
alert(errorDesc)
|
|
26
|
-
return ''
|
|
27
|
-
}
|
|
28
|
-
console.log('SignOnClick 签名结果:', signature)
|
|
29
|
-
return signature
|
|
30
|
-
} catch (e) {
|
|
31
|
-
console.log('SignOnClick error=', e)
|
|
32
|
-
errorDesc = this.CryptoAgent.GetLastErrorDesc()
|
|
33
|
-
alert(errorDesc)
|
|
34
|
-
}
|
|
35
|
-
return ''
|
|
36
|
-
},
|
|
37
|
-
},
|
|
38
|
-
}
|