@it-enterprise/digital-signature 1.4.1 → 1.4.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
package/readme.md
CHANGED
|
@@ -886,7 +886,7 @@ const protectedReports = await ds.protectTaxReports({
|
|
|
886
886
|
Після виконання шифрування, ключ необхідно очистити, викликавши функцію **ctxFreePrivateKey**
|
|
887
887
|
|
|
888
888
|
```javascript
|
|
889
|
-
await ds.
|
|
889
|
+
await ds.ctxFreePrivateKey(
|
|
890
890
|
// Зчитаний ключ
|
|
891
891
|
keyInfo,
|
|
892
892
|
);
|
package/src/DigitalSignature.js
CHANGED
|
@@ -1252,7 +1252,7 @@ export default class DigitalSignature {
|
|
|
1252
1252
|
/**
|
|
1253
1253
|
* Зашифрувати звіти в податкову
|
|
1254
1254
|
* @param {ProtectTaxReportParams} params - Параметри шифрування
|
|
1255
|
-
* @returns Promise<Array<EndUserTaxReport>>
|
|
1255
|
+
* @returns {Promise<Array<EndUserTaxReport>>}
|
|
1256
1256
|
*/
|
|
1257
1257
|
async protectTaxReports(params) {
|
|
1258
1258
|
return await this._euSign.ProtectTaxReports(
|
|
@@ -1286,7 +1286,7 @@ export default class DigitalSignature {
|
|
|
1286
1286
|
};
|
|
1287
1287
|
}
|
|
1288
1288
|
|
|
1289
|
-
if (Array.isArray(certs)) {
|
|
1289
|
+
if (Array.isArray(certs) && certs.length > 0) {
|
|
1290
1290
|
certs = await Promise.all(certs.map(cert =>
|
|
1291
1291
|
cert instanceof File || cert instanceof Blob ? readFile(cert) :
|
|
1292
1292
|
cert instanceof EndUserCertificate ? cert.data :
|
|
@@ -1295,7 +1295,7 @@ export default class DigitalSignature {
|
|
|
1295
1295
|
|
|
1296
1296
|
try {
|
|
1297
1297
|
const ctx = await this._euSign.CtxCreate();
|
|
1298
|
-
const keyCtx = await this._euSign.CtxReadPrivateKey(keyMedia, certs, this._selectedIssuerCN);
|
|
1298
|
+
const keyCtx = await this._euSign.CtxReadPrivateKey(ctx, keyMedia, certs, this._selectedIssuerCN);
|
|
1299
1299
|
const readedKey = new HardwarePrivateKeyInfo(
|
|
1300
1300
|
DigitalSignatureKeyType.Token,
|
|
1301
1301
|
keyCtx.ownerInfo,
|
|
@@ -1356,7 +1356,7 @@ export default class DigitalSignature {
|
|
|
1356
1356
|
if (privateKey instanceof File || privateKey instanceof Blob) {
|
|
1357
1357
|
privateKey = await readFile(privateKey);
|
|
1358
1358
|
}
|
|
1359
|
-
if (Array.isArray(certs)) {
|
|
1359
|
+
if (Array.isArray(certs) && certs.length > 0) {
|
|
1360
1360
|
certs = await Promise.all(certs.map(cert =>
|
|
1361
1361
|
cert instanceof File || cert instanceof Blob ? readFile(cert) :
|
|
1362
1362
|
cert instanceof EndUserCertificate ? cert.data :
|
|
@@ -1406,7 +1406,7 @@ export default class DigitalSignature {
|
|
|
1406
1406
|
* @param {PrivateKeyInfo} privateKeyContext - Контекст приватного ключа
|
|
1407
1407
|
*/
|
|
1408
1408
|
async ctxFreePrivateKey(privateKeyContext) {
|
|
1409
|
-
if (privateKeyContext
|
|
1409
|
+
if (privateKeyContext.keyType === DigitalSignatureKeyType.Token) {
|
|
1410
1410
|
await this.setLibraryType(DigitalSignatureKeyType.Token);
|
|
1411
1411
|
} else {
|
|
1412
1412
|
await this.setLibraryType(DigitalSignatureKeyType.File);
|