@it-enterprise/digital-signature 1.3.15 → 1.3.16

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@it-enterprise/digital-signature",
3
- "version": "1.3.15",
3
+ "version": "1.3.16",
4
4
  "description": "digital signature",
5
5
  "private": false,
6
6
  "main": "src/index.js",
@@ -208,6 +208,7 @@ export default class DigitalSignature {
208
208
  "смарт-карта Техноконс. TEllipse3 (PKCS#11)",
209
209
  "смарт-карта Техноконс. TEllipse",
210
210
  "смарт-карта Техноконс. TEllipse2/3",
211
+ "е.ключ SIS DIAMOND",
211
212
  "е.ключ SafeNet iKey (PKCS#11, RSA)",
212
213
  "е.ключ Aruba Key (PKCS#11, RSA)"
213
214
  ]
@@ -823,6 +824,9 @@ export default class DigitalSignature {
823
824
  if (hashAlgo === EndUserConstants.EndUserCertHashType.GOST34311 && this._glSign.HashAlgorithm !== "GOST34311") {
824
825
  hashAlgo = EndUserConstants.EndUserHashAlgo.DSTU7564_256;
825
826
  }
827
+ if (hashAlgo === EndUserConstants.EndUserCertHashType.DSTU7564_256 && this._glSign.HashAlgorithm === "GOST34311") {
828
+ hashAlgo = EndUserConstants.EndUserHashAlgo.GOST34311;
829
+ }
826
830
 
827
831
  const hash = await this._euSign.HashData(hashAlgo, data);
828
832
  return await this._euSign.VerifyHash(hash.val || hash, sign.val || sign, signIndex);
package/src/Models.js CHANGED
@@ -441,6 +441,9 @@ export class PrivateKeyInfo {
441
441
  if (hashType == EndUserConstants.EndUserHashAlgo.GOST34311 && glsign?.HashAlgorithm !== "GOST34311") {
442
442
  return EndUserConstants.EndUserHashAlgo.DSTU7564_256;
443
443
  }
444
+ if (hashType == EndUserConstants.EndUserHashAlgo.DSTU7564_256 && glsign?.HashAlgorithm === "GOST34311") {
445
+ return EndUserConstants.EndUserHashAlgo.GOST34311;
446
+ }
444
447
 
445
448
  return hashType;
446
449
  }
package/src/Utils.js CHANGED
@@ -221,7 +221,8 @@ export function getSupportedSignAlgos(certificates, glsign = null) {
221
221
  }
222
222
  switch (certificate.infoEx.publicKeyType) {
223
223
  case EndUserConstants.EndUserCertKeyType.DSTU4145:
224
- if (certificate.infoEx.certHashType === EndUserConstants.EU_CERT_HASH_TYPE_GOST34311 && glsign?.HashAlgorithm === "GOST34311") {
224
+ if ((certificate.infoEx.certHashType === EndUserConstants.EU_CERT_HASH_TYPE_GOST34311 || certificate.infoEx.certHashType === EndUserConstants.EU_CERT_HASH_TYPE_DSTU7564_256)
225
+ && glsign?.HashAlgorithm === "GOST34311") {
225
226
  signAlgos.push(EndUserConstants.EndUserSignAlgo.DSTU4145WithGOST34311);
226
227
  } else {
227
228
  signAlgos.push(EndUserConstants.EndUserSignAlgo.DSTU4145WithDSTU7564);