@digitaldefiance/ecies-lib 4.12.8 → 4.13.1
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 +60 -12
- package/package.json +3 -3
- package/src/builders/ecies-builder.d.ts +24 -1
- package/src/builders/ecies-builder.d.ts.map +1 -1
- package/src/builders/ecies-builder.js +24 -1
- package/src/builders/ecies-builder.js.map +1 -1
- package/src/builders/member-builder.d.ts +57 -1
- package/src/builders/member-builder.d.ts.map +1 -1
- package/src/builders/member-builder.js +57 -1
- package/src/builders/member-builder.js.map +1 -1
- package/src/constants.d.ts +99 -10
- package/src/constants.d.ts.map +1 -1
- package/src/constants.js +162 -20
- package/src/constants.js.map +1 -1
- package/src/core/errors/crypto-error.d.ts +28 -1
- package/src/core/errors/crypto-error.d.ts.map +1 -1
- package/src/core/errors/crypto-error.js +28 -1
- package/src/core/errors/crypto-error.js.map +1 -1
- package/src/core/types/result.d.ts +21 -1
- package/src/core/types/result.d.ts.map +1 -1
- package/src/core/types/result.js +17 -1
- package/src/core/types/result.js.map +1 -1
- package/src/enumerations/ecies-cipher-suite.d.ts +11 -0
- package/src/enumerations/ecies-cipher-suite.d.ts.map +1 -1
- package/src/enumerations/ecies-cipher-suite.js +11 -1
- package/src/enumerations/ecies-cipher-suite.js.map +1 -1
- package/src/enumerations/ecies-encryption-type.d.ts +26 -3
- package/src/enumerations/ecies-encryption-type.d.ts.map +1 -1
- package/src/enumerations/ecies-encryption-type.js +29 -10
- package/src/enumerations/ecies-encryption-type.js.map +1 -1
- package/src/enumerations/ecies-error-type.d.ts +48 -3
- package/src/enumerations/ecies-error-type.d.ts.map +1 -1
- package/src/enumerations/ecies-error-type.js +45 -0
- package/src/enumerations/ecies-error-type.js.map +1 -1
- package/src/enumerations/ecies-string-key.d.ts +4 -0
- package/src/enumerations/ecies-string-key.d.ts.map +1 -1
- package/src/enumerations/ecies-string-key.js +4 -0
- package/src/enumerations/ecies-string-key.js.map +1 -1
- package/src/enumerations/ecies-version.d.ts +5 -0
- package/src/enumerations/ecies-version.d.ts.map +1 -1
- package/src/enumerations/ecies-version.js +5 -0
- package/src/enumerations/ecies-version.js.map +1 -1
- package/src/enumerations/guid-brand-type.d.ts +13 -8
- package/src/enumerations/guid-brand-type.d.ts.map +1 -1
- package/src/enumerations/guid-brand-type.js +13 -8
- package/src/enumerations/guid-brand-type.js.map +1 -1
- package/src/enumerations/guid-error-type.d.ts +8 -0
- package/src/enumerations/guid-error-type.d.ts.map +1 -1
- package/src/enumerations/guid-error-type.js +8 -0
- package/src/enumerations/guid-error-type.js.map +1 -1
- package/src/enumerations/index.d.ts +4 -0
- package/src/enumerations/index.d.ts.map +1 -1
- package/src/enumerations/index.js +4 -0
- package/src/enumerations/index.js.map +1 -1
- package/src/enumerations/invalid-email-type.d.ts +7 -0
- package/src/enumerations/invalid-email-type.d.ts.map +1 -1
- package/src/enumerations/invalid-email-type.js +7 -0
- package/src/enumerations/invalid-email-type.js.map +1 -1
- package/src/enumerations/length-encoding-type.d.ts +8 -0
- package/src/enumerations/length-encoding-type.d.ts.map +1 -1
- package/src/enumerations/length-encoding-type.js +8 -0
- package/src/enumerations/length-encoding-type.js.map +1 -1
- package/src/enumerations/length-error-type.d.ts +7 -0
- package/src/enumerations/length-error-type.d.ts.map +1 -1
- package/src/enumerations/length-error-type.js +7 -0
- package/src/enumerations/length-error-type.js.map +1 -1
- package/src/enumerations/password-login-error-type.d.ts +6 -0
- package/src/enumerations/password-login-error-type.d.ts.map +1 -1
- package/src/enumerations/password-login-error-type.js +6 -0
- package/src/enumerations/password-login-error-type.js.map +1 -1
- package/src/enumerations/pbkdf2-error-type.d.ts +7 -0
- package/src/enumerations/pbkdf2-error-type.d.ts.map +1 -1
- package/src/enumerations/pbkdf2-error-type.js +7 -0
- package/src/enumerations/pbkdf2-error-type.js.map +1 -1
- package/src/enumerations/pbkdf2-profile.d.ts +7 -0
- package/src/enumerations/pbkdf2-profile.d.ts.map +1 -1
- package/src/enumerations/pbkdf2-profile.js +7 -0
- package/src/enumerations/pbkdf2-profile.js.map +1 -1
- package/src/enumerations/secure-storage-error-type.d.ts +7 -0
- package/src/enumerations/secure-storage-error-type.d.ts.map +1 -1
- package/src/enumerations/secure-storage-error-type.js +7 -0
- package/src/enumerations/secure-storage-error-type.js.map +1 -1
- package/src/errors/index.d.ts +5 -0
- package/src/errors/index.d.ts.map +1 -1
- package/src/errors/index.js +5 -0
- package/src/errors/index.js.map +1 -1
- package/src/errors/invalid-email.d.ts +4 -0
- package/src/errors/invalid-email.d.ts.map +1 -1
- package/src/errors/invalid-email.js +4 -0
- package/src/errors/invalid-email.js.map +1 -1
- package/src/errors/length.d.ts +4 -0
- package/src/errors/length.d.ts.map +1 -1
- package/src/errors/length.js +4 -0
- package/src/errors/length.js.map +1 -1
- package/src/errors/member.d.ts +4 -0
- package/src/errors/member.d.ts.map +1 -1
- package/src/errors/member.js +4 -0
- package/src/errors/member.js.map +1 -1
- package/src/errors/pbkdf2.d.ts +4 -0
- package/src/errors/pbkdf2.d.ts.map +1 -1
- package/src/errors/pbkdf2.js +4 -0
- package/src/errors/pbkdf2.js.map +1 -1
- package/src/errors/secure-storage.d.ts +4 -0
- package/src/errors/secure-storage.d.ts.map +1 -1
- package/src/errors/secure-storage.js +4 -0
- package/src/errors/secure-storage.js.map +1 -1
- package/src/errors/simple-ecies.d.ts +4 -0
- package/src/errors/simple-ecies.d.ts.map +1 -1
- package/src/errors/simple-ecies.js +4 -0
- package/src/errors/simple-ecies.js.map +1 -1
- package/src/errors/simple-test-error.d.ts +3 -0
- package/src/errors/simple-test-error.d.ts.map +1 -1
- package/src/errors/simple-test-error.js +3 -0
- package/src/errors/simple-test-error.js.map +1 -1
- package/src/errors/translatable.d.ts +8 -0
- package/src/errors/translatable.d.ts.map +1 -0
- package/src/errors/translatable.js +20 -0
- package/src/errors/translatable.js.map +1 -0
- package/src/interfaces/checksum-config.d.ts +3 -0
- package/src/interfaces/checksum-config.d.ts.map +1 -1
- package/src/interfaces/checksum-consts.d.ts +4 -0
- package/src/interfaces/checksum-consts.d.ts.map +1 -1
- package/src/interfaces/constants.d.ts +21 -6
- package/src/interfaces/constants.d.ts.map +1 -1
- package/src/interfaces/constants.js +5 -0
- package/src/interfaces/constants.js.map +1 -1
- package/src/interfaces/ecies-config.d.ts +3 -0
- package/src/interfaces/ecies-config.d.ts.map +1 -1
- package/src/interfaces/ecies-consts.d.ts +42 -7
- package/src/interfaces/ecies-consts.d.ts.map +1 -1
- package/src/interfaces/ecies-file-service.d.ts +3 -0
- package/src/interfaces/ecies-file-service.d.ts.map +1 -1
- package/src/interfaces/guid.d.ts +4 -0
- package/src/interfaces/guid.d.ts.map +1 -1
- package/src/interfaces/index.d.ts +4 -0
- package/src/interfaces/index.d.ts.map +1 -1
- package/src/interfaces/index.js +4 -0
- package/src/interfaces/index.js.map +1 -1
- package/src/interfaces/pbkdf2-config.d.ts +8 -0
- package/src/interfaces/pbkdf2-config.d.ts.map +1 -1
- package/src/interfaces/pbkdf2-consts.d.ts +7 -3
- package/src/interfaces/pbkdf2-consts.d.ts.map +1 -1
- package/src/interfaces/pbkdf2-result.d.ts +7 -0
- package/src/interfaces/pbkdf2-result.d.ts.map +1 -1
- package/src/interfaces/platform-id.d.ts +10 -2
- package/src/interfaces/platform-id.d.ts.map +1 -1
- package/src/interfaces/platform-id.js +8 -0
- package/src/interfaces/platform-id.js.map +1 -1
- package/src/interfaces/voting-service.d.ts +5 -6
- package/src/interfaces/voting-service.d.ts.map +1 -1
- package/src/lib/configuration-provenance-utils.d.ts +5 -1
- package/src/lib/configuration-provenance-utils.d.ts.map +1 -1
- package/src/lib/configuration-provenance-utils.js +5 -1
- package/src/lib/configuration-provenance-utils.js.map +1 -1
- package/src/lib/guid.d.ts +47 -29
- package/src/lib/guid.d.ts.map +1 -1
- package/src/lib/guid.js +127 -104
- package/src/lib/guid.js.map +1 -1
- package/src/lib/id-providers/guidv4-provider.d.ts +8 -8
- package/src/lib/id-providers/guidv4-provider.d.ts.map +1 -1
- package/src/lib/id-providers/guidv4-provider.js +10 -10
- package/src/lib/id-providers/guidv4-provider.js.map +1 -1
- package/src/lib/invariants/index.d.ts +3 -0
- package/src/lib/invariants/index.d.ts.map +1 -1
- package/src/lib/invariants/index.js +3 -0
- package/src/lib/invariants/index.js.map +1 -1
- package/src/lib/voting/enumerations/audit-event-type.d.ts +3 -0
- package/src/lib/voting/enumerations/audit-event-type.d.ts.map +1 -1
- package/src/lib/voting/enumerations/audit-event-type.js +3 -0
- package/src/lib/voting/enumerations/audit-event-type.js.map +1 -1
- package/src/lib/voting/enumerations/event-type.d.ts +3 -0
- package/src/lib/voting/enumerations/event-type.d.ts.map +1 -1
- package/src/lib/voting/enumerations/event-type.js +3 -0
- package/src/lib/voting/enumerations/event-type.js.map +1 -1
- package/src/lib/voting/enumerations/index.d.ts +3 -0
- package/src/lib/voting/enumerations/index.d.ts.map +1 -1
- package/src/lib/voting/enumerations/index.js +3 -0
- package/src/lib/voting/enumerations/index.js.map +1 -1
- package/src/lib/voting/enumerations/jurisdictional-level.d.ts +3 -0
- package/src/lib/voting/enumerations/jurisdictional-level.d.ts.map +1 -1
- package/src/lib/voting/enumerations/jurisdictional-level.js +3 -0
- package/src/lib/voting/enumerations/jurisdictional-level.js.map +1 -1
- package/src/lib/voting/enumerations/security-level.d.ts +3 -0
- package/src/lib/voting/enumerations/security-level.d.ts.map +1 -1
- package/src/lib/voting/enumerations/security-level.js +3 -0
- package/src/lib/voting/enumerations/security-level.js.map +1 -1
- package/src/lib/voting/interfaces/aggregated-tally.d.ts +3 -0
- package/src/lib/voting/interfaces/aggregated-tally.d.ts.map +1 -1
- package/src/lib/voting/interfaces/audit-entry.d.ts +3 -0
- package/src/lib/voting/interfaces/audit-entry.d.ts.map +1 -1
- package/src/lib/voting/interfaces/audit-log.d.ts +3 -0
- package/src/lib/voting/interfaces/audit-log.d.ts.map +1 -1
- package/src/lib/voting/interfaces/bulletin-board-entry.d.ts +3 -0
- package/src/lib/voting/interfaces/bulletin-board-entry.d.ts.map +1 -1
- package/src/lib/voting/interfaces/bulletin-board.d.ts +3 -0
- package/src/lib/voting/interfaces/bulletin-board.d.ts.map +1 -1
- package/src/lib/voting/interfaces/checkpoint-manager.d.ts +3 -0
- package/src/lib/voting/interfaces/checkpoint-manager.d.ts.map +1 -1
- package/src/lib/voting/interfaces/checkpoint-metadata.d.ts +3 -0
- package/src/lib/voting/interfaces/checkpoint-metadata.d.ts.map +1 -1
- package/src/lib/voting/interfaces/event-log-entry.d.ts +3 -0
- package/src/lib/voting/interfaces/event-log-entry.d.ts.map +1 -1
- package/src/lib/voting/interfaces/event-logger.d.ts +3 -0
- package/src/lib/voting/interfaces/event-logger.d.ts.map +1 -1
- package/src/lib/voting/interfaces/index.d.ts +3 -0
- package/src/lib/voting/interfaces/index.d.ts.map +1 -1
- package/src/lib/voting/interfaces/index.js.map +1 -1
- package/src/lib/voting/interfaces/jurisdiction-config.d.ts +3 -0
- package/src/lib/voting/interfaces/jurisdiction-config.d.ts.map +1 -1
- package/src/lib/voting/interfaces/poll-configuration.d.ts +3 -0
- package/src/lib/voting/interfaces/poll-configuration.d.ts.map +1 -1
- package/src/lib/voting/interfaces/state-snapshot.d.ts +3 -0
- package/src/lib/voting/interfaces/state-snapshot.d.ts.map +1 -1
- package/src/lib/voting/interfaces/tally-proof.d.ts +3 -0
- package/src/lib/voting/interfaces/tally-proof.d.ts.map +1 -1
- package/src/lib/voting/interfaces/vote-logger.d.ts +3 -0
- package/src/lib/voting/interfaces/vote-logger.d.ts.map +1 -1
- package/src/lib/voting/test-voter-pool.d.ts.map +1 -1
- package/src/lib/voting/test-voter-pool.js +4 -0
- package/src/lib/voting/test-voter-pool.js.map +1 -1
- package/src/member.d.ts +198 -9
- package/src/member.d.ts.map +1 -1
- package/src/member.js +198 -15
- package/src/member.js.map +1 -1
- package/src/pbkdf2-profiles.d.ts +4 -0
- package/src/pbkdf2-profiles.d.ts.map +1 -1
- package/src/phone-number.d.ts +12 -0
- package/src/phone-number.d.ts.map +1 -1
- package/src/phone-number.js +12 -0
- package/src/phone-number.js.map +1 -1
- package/src/regexes.d.ts +15 -1
- package/src/regexes.d.ts.map +1 -1
- package/src/regexes.js +16 -2
- package/src/regexes.js.map +1 -1
- package/src/secure-buffer.d.ts +119 -8
- package/src/secure-buffer.d.ts.map +1 -1
- package/src/secure-buffer.js +119 -8
- package/src/secure-buffer.js.map +1 -1
- package/src/secure-string.d.ts +118 -1
- package/src/secure-string.d.ts.map +1 -1
- package/src/secure-string.js +118 -1
- package/src/secure-string.js.map +1 -1
- package/src/services/aes-gcm.d.ts.map +1 -1
- package/src/services/aes-gcm.js.map +1 -1
- package/src/services/chunk-processor.d.ts.map +1 -1
- package/src/services/chunk-processor.js +2 -2
- package/src/services/chunk-processor.js.map +1 -1
- package/src/services/crc.d.ts +80 -2
- package/src/services/crc.d.ts.map +1 -1
- package/src/services/crc.js +80 -2
- package/src/services/crc.js.map +1 -1
- package/src/services/ecies/crypto-core.d.ts +2 -1
- package/src/services/ecies/crypto-core.d.ts.map +1 -1
- package/src/services/ecies/crypto-core.js +4 -1
- package/src/services/ecies/crypto-core.js.map +1 -1
- package/src/services/ecies/example.d.ts.map +1 -1
- package/src/services/ecies/example.js +4 -4
- package/src/services/ecies/example.js.map +1 -1
- package/src/services/ecies/file.d.ts +4 -0
- package/src/services/ecies/file.d.ts.map +1 -1
- package/src/services/ecies/file.js +6 -6
- package/src/services/ecies/file.js.map +1 -1
- package/src/services/ecies/index.d.ts +4 -2
- package/src/services/ecies/index.d.ts.map +1 -1
- package/src/services/ecies/index.js +4 -2
- package/src/services/ecies/index.js.map +1 -1
- package/src/services/ecies/integration.d.ts.map +1 -1
- package/src/services/ecies/integration.js +10 -4
- package/src/services/ecies/integration.js.map +1 -1
- package/src/services/ecies/interfaces/decryption-result.d.ts +3 -0
- package/src/services/ecies/interfaces/decryption-result.d.ts.map +1 -1
- package/src/services/ecies/interfaces/encryption-result.d.ts +3 -0
- package/src/services/ecies/interfaces/encryption-result.d.ts.map +1 -1
- package/src/services/ecies/interfaces/index.d.ts +3 -0
- package/src/services/ecies/interfaces/index.d.ts.map +1 -1
- package/src/services/ecies/interfaces/multi-encrypted-message.d.ts +3 -0
- package/src/services/ecies/interfaces/multi-encrypted-message.d.ts.map +1 -1
- package/src/services/ecies/interfaces/multi-encrypted-parsed-header.d.ts +3 -0
- package/src/services/ecies/interfaces/multi-encrypted-parsed-header.d.ts.map +1 -1
- package/src/services/ecies/interfaces/multi-recipient.d.ts +3 -0
- package/src/services/ecies/interfaces/multi-recipient.d.ts.map +1 -1
- package/src/services/ecies/interfaces/simple-keypair.d.ts +3 -0
- package/src/services/ecies/interfaces/simple-keypair.d.ts.map +1 -1
- package/src/services/ecies/interfaces/single-encrypted-parsed-header.d.ts +3 -0
- package/src/services/ecies/interfaces/single-encrypted-parsed-header.d.ts.map +1 -1
- package/src/services/ecies/interfaces/wallet-seed.d.ts +3 -0
- package/src/services/ecies/interfaces/wallet-seed.d.ts.map +1 -1
- package/src/services/ecies/manual-test.d.ts.map +1 -1
- package/src/services/ecies/manual-test.js +7 -7
- package/src/services/ecies/manual-test.js.map +1 -1
- package/src/services/ecies/multi-recipient.d.ts +1 -1
- package/src/services/ecies/multi-recipient.d.ts.map +1 -1
- package/src/services/ecies/multi-recipient.js +1 -1
- package/src/services/ecies/multi-recipient.js.map +1 -1
- package/src/services/ecies/service.d.ts +21 -5
- package/src/services/ecies/service.d.ts.map +1 -1
- package/src/services/ecies/service.js +34 -18
- package/src/services/ecies/service.js.map +1 -1
- package/src/services/ecies/single-recipient.d.ts +2 -2
- package/src/services/ecies/single-recipient.d.ts.map +1 -1
- package/src/services/ecies/single-recipient.js +28 -33
- package/src/services/ecies/single-recipient.js.map +1 -1
- package/src/services/encryption-stream.d.ts.map +1 -1
- package/src/services/encryption-stream.js +1 -1
- package/src/services/encryption-stream.js.map +1 -1
- package/src/services/index.d.ts +4 -0
- package/src/services/index.d.ts.map +1 -1
- package/src/services/index.js +4 -0
- package/src/services/index.js.map +1 -1
- package/src/services/multi-recipient-processor.d.ts +15 -9
- package/src/services/multi-recipient-processor.d.ts.map +1 -1
- package/src/services/multi-recipient-processor.js +51 -39
- package/src/services/multi-recipient-processor.js.map +1 -1
- package/src/services/password-login.d.ts +41 -5
- package/src/services/password-login.d.ts.map +1 -1
- package/src/services/password-login.js +43 -7
- package/src/services/password-login.js.map +1 -1
- package/src/services/resumable-encryption.d.ts.map +1 -1
- package/src/services/resumable-encryption.js +5 -1
- package/src/services/resumable-encryption.js.map +1 -1
- package/src/test-mocks/index.d.ts +4 -0
- package/src/test-mocks/index.d.ts.map +1 -1
- package/src/test-mocks/index.js +4 -0
- package/src/test-mocks/index.js.map +1 -1
- package/src/test-mocks/mock-frontend-member.d.ts +91 -0
- package/src/test-mocks/mock-frontend-member.d.ts.map +1 -1
- package/src/test-mocks/mock-frontend-member.js +91 -0
- package/src/test-mocks/mock-frontend-member.js.map +1 -1
- package/src/testing.d.ts +4 -0
- package/src/testing.d.ts.map +1 -1
- package/src/testing.js +4 -1
- package/src/testing.js.map +1 -1
- package/src/transforms/checksumTransform.d.ts +17 -0
- package/src/transforms/checksumTransform.d.ts.map +1 -1
- package/src/transforms/checksumTransform.js +17 -0
- package/src/transforms/checksumTransform.js.map +1 -1
- package/src/transforms/eciesDecryptTransform.d.ts +19 -0
- package/src/transforms/eciesDecryptTransform.d.ts.map +1 -1
- package/src/transforms/eciesDecryptTransform.js +21 -2
- package/src/transforms/eciesDecryptTransform.js.map +1 -1
- package/src/transforms/eciesEncryptTransform.d.ts +20 -0
- package/src/transforms/eciesEncryptTransform.d.ts.map +1 -1
- package/src/transforms/eciesEncryptTransform.js +23 -3
- package/src/transforms/eciesEncryptTransform.js.map +1 -1
- package/src/transforms/index.d.ts +4 -0
- package/src/transforms/index.d.ts.map +1 -1
- package/src/transforms/index.js +4 -0
- package/src/transforms/index.js.map +1 -1
- package/src/transforms/xorMultipleTransform.d.ts +21 -0
- package/src/transforms/xorMultipleTransform.d.ts.map +1 -1
- package/src/transforms/xorMultipleTransform.js +21 -0
- package/src/transforms/xorMultipleTransform.js.map +1 -1
- package/src/transforms/xorTransform.d.ts +13 -0
- package/src/transforms/xorTransform.d.ts.map +1 -1
- package/src/transforms/xorTransform.js +13 -0
- package/src/transforms/xorTransform.js.map +1 -1
- package/src/translations/de.d.ts +3 -0
- package/src/translations/de.d.ts.map +1 -1
- package/src/translations/de.js +3 -0
- package/src/translations/de.js.map +1 -1
- package/src/translations/en-US.d.ts +3 -0
- package/src/translations/en-US.d.ts.map +1 -1
- package/src/translations/en-US.js +3 -0
- package/src/translations/en-US.js.map +1 -1
- package/src/translations/es.d.ts +3 -0
- package/src/translations/es.d.ts.map +1 -1
- package/src/translations/es.js +3 -0
- package/src/translations/es.js.map +1 -1
- package/src/translations/fr.d.ts +3 -0
- package/src/translations/fr.d.ts.map +1 -1
- package/src/translations/fr.js +3 -0
- package/src/translations/fr.js.map +1 -1
- package/src/translations/ja.d.ts +3 -0
- package/src/translations/ja.d.ts.map +1 -1
- package/src/translations/ja.js +3 -0
- package/src/translations/ja.js.map +1 -1
- package/src/translations/uk.d.ts +3 -0
- package/src/translations/uk.d.ts.map +1 -1
- package/src/translations/uk.js +3 -0
- package/src/translations/uk.js.map +1 -1
- package/src/translations/zh-cn.d.ts +3 -0
- package/src/translations/zh-cn.d.ts.map +1 -1
- package/src/translations/zh-cn.js +3 -0
- package/src/translations/zh-cn.js.map +1 -1
- package/src/typed-configuration.d.ts +2 -2
- package/src/typed-configuration.d.ts.map +1 -1
- package/src/typed-configuration.js.map +1 -1
- package/src/types/deep-partial.d.ts +16 -0
- package/src/types/deep-partial.d.ts.map +1 -1
- package/src/types/guid-versions.d.ts +5 -9
- package/src/types/guid-versions.d.ts.map +1 -1
- package/src/types.d.ts +30 -1
- package/src/types.d.ts.map +1 -1
- package/src/types.js +4 -0
- package/src/types.js.map +1 -1
- package/src/utils.d.ts +69 -18
- package/src/utils.d.ts.map +1 -1
- package/src/utils.js +70 -19
- package/src/utils.js.map +1 -1
package/README.md
CHANGED
|
@@ -8,7 +8,7 @@ Production-ready, browser-compatible ECIES (Elliptic Curve Integrated Encryption
|
|
|
8
8
|
|
|
9
9
|
Part of [Express Suite](https://github.com/Digital-Defiance/express-suite)
|
|
10
10
|
|
|
11
|
-
**Current Version: v4.
|
|
11
|
+
**Current Version: v4.13.0**
|
|
12
12
|
|
|
13
13
|
This library implements a modern, enterprise-grade ECIES protocol (v4.0) featuring HKDF key derivation, AAD binding, and optimized multi-recipient encryption. It includes a pluggable ID provider system with PlatformID support, memory-efficient streaming encryption, comprehensive internationalization, and a complete cryptographic voting system with 15+ voting methods.
|
|
14
14
|
|
|
@@ -26,8 +26,8 @@ This library implements a modern, enterprise-grade ECIES protocol (v4.0) featuri
|
|
|
26
26
|
- **Symmetric**: `AES-256-GCM` for authenticated symmetric encryption.
|
|
27
27
|
- **Hashing**: `SHA-256` and `SHA-512`.
|
|
28
28
|
- **Modes**:
|
|
29
|
-
- **
|
|
30
|
-
- **
|
|
29
|
+
- **Basic**: Minimal overhead (no length prefix).
|
|
30
|
+
- **WithLength**: Includes data length prefix.
|
|
31
31
|
- **Multiple**: Efficient encryption for up to 65,535 recipients.
|
|
32
32
|
|
|
33
33
|
### 🗳️ Cryptographic Voting System
|
|
@@ -226,8 +226,8 @@ const { privateKey, publicKey } = ecies.mnemonicToSimpleKeyPair(mnemonic);
|
|
|
226
226
|
|
|
227
227
|
// 5. Encrypt & Decrypt
|
|
228
228
|
const message = new TextEncoder().encode('Hello, Secure World!');
|
|
229
|
-
const encrypted = await ecies.
|
|
230
|
-
const decrypted = await ecies.
|
|
229
|
+
const encrypted = await ecies.encryptWithLength(publicKey, message);
|
|
230
|
+
const decrypted = await ecies.decryptWithLengthAndHeader(privateKey, encrypted);
|
|
231
231
|
|
|
232
232
|
console.log(new TextDecoder().decode(decrypted)); // "Hello, Secure World!"
|
|
233
233
|
|
|
@@ -1277,6 +1277,55 @@ The library maintains **100% test coverage** with over 1,200 tests, including:
|
|
|
1277
1277
|
|
|
1278
1278
|
## ChangeLog
|
|
1279
1279
|
|
|
1280
|
+
### v4.13.0 - API Naming Improvements & Configuration Enhancements
|
|
1281
|
+
|
|
1282
|
+
**Breaking Changes:**
|
|
1283
|
+
|
|
1284
|
+
- **Encryption Mode Renaming**:
|
|
1285
|
+
- `SIMPLE` → `BASIC` (constant)
|
|
1286
|
+
- `SINGLE` → `WITH_LENGTH` (constant)
|
|
1287
|
+
- `encryptSimpleOrSingle(isSimple, ...)` → `encryptBasic(...)` / `encryptWithLength(...)`
|
|
1288
|
+
- `decryptSimpleOrSingleWithHeader(isSimple, ...)` → `decryptBasicWithHeader(...)` / `decryptWithLengthAndHeader(...)`
|
|
1289
|
+
|
|
1290
|
+
- **Removed Constants**:
|
|
1291
|
+
- `OBJECT_ID_LENGTH` removed - use `idProvider.byteLength` instead
|
|
1292
|
+
|
|
1293
|
+
- **Guid Class Renamed**:
|
|
1294
|
+
- `Guid` → `GuidUint8Array` (browser implementation)
|
|
1295
|
+
- Added `VersionedGuidUint8Array<V>` type for compile-time version tracking
|
|
1296
|
+
- Methods like `generate()`, `parse()`, `hydrate()` now return `VersionedGuidUint8Array`
|
|
1297
|
+
|
|
1298
|
+
**New Features:**
|
|
1299
|
+
|
|
1300
|
+
- **ECIES_CONFIG**: New configuration interface and constant for ECIES parameters
|
|
1301
|
+
- `curveName`, `primaryKeyDerivationPath`, `mnemonicStrength`, `symmetricAlgorithm`, etc.
|
|
1302
|
+
|
|
1303
|
+
- **TranslatableEciesError**: New error class with automatic i18n translation
|
|
1304
|
+
```typescript
|
|
1305
|
+
throw new TranslatableEciesError('INVALID_KEY', { keyLength: 32 });
|
|
1306
|
+
```
|
|
1307
|
+
|
|
1308
|
+
- **Enhanced Type System for GUIDs**:
|
|
1309
|
+
- `VersionedGuidUint8Array<4>` for v4 UUIDs with compile-time version info
|
|
1310
|
+
- `__version` property attached to parsed/generated GUIDs
|
|
1311
|
+
|
|
1312
|
+
**Migration Guide:**
|
|
1313
|
+
```typescript
|
|
1314
|
+
// BEFORE (v4.12.x)
|
|
1315
|
+
const encrypted = await ecies.encryptSimpleOrSingle(false, publicKey, data); // "single" mode
|
|
1316
|
+
const decrypted = await ecies.decryptSimpleOrSingleWithHeader(false, privateKey, encrypted);
|
|
1317
|
+
|
|
1318
|
+
const encrypted2 = await ecies.encryptSimpleOrSingle(true, publicKey, data); // "simple" mode
|
|
1319
|
+
const decrypted2 = await ecies.decryptSimpleOrSingleWithHeader(true, privateKey, encrypted2);
|
|
1320
|
+
|
|
1321
|
+
// AFTER (v4.13.0+)
|
|
1322
|
+
const encrypted = await ecies.encryptWithLength(publicKey, data); // WithLength mode (formerly "single")
|
|
1323
|
+
const decrypted = await ecies.decryptWithLengthAndHeader(privateKey, encrypted);
|
|
1324
|
+
|
|
1325
|
+
const encrypted2 = await ecies.encryptBasic(publicKey, data); // Basic mode (formerly "simple")
|
|
1326
|
+
const decrypted2 = await ecies.decryptBasicWithHeader(privateKey, encrypted2);
|
|
1327
|
+
```
|
|
1328
|
+
|
|
1280
1329
|
### v4.12.0 - AESGCMService Refactoring & JSON Encryption
|
|
1281
1330
|
|
|
1282
1331
|
**Breaking Changes:**
|
|
@@ -1972,8 +2021,8 @@ describe('ECIES Encryption', () => {
|
|
|
1972
2021
|
const { privateKey, publicKey } = ecies.mnemonicToSimpleKeyPair(mnemonic);
|
|
1973
2022
|
|
|
1974
2023
|
const message = new TextEncoder().encode('Secret Message');
|
|
1975
|
-
const encrypted = await ecies.
|
|
1976
|
-
const decrypted = await ecies.
|
|
2024
|
+
const encrypted = await ecies.encryptWithLength(publicKey, message);
|
|
2025
|
+
const decrypted = await ecies.decryptWithLengthAndHeader(privateKey, encrypted);
|
|
1977
2026
|
|
|
1978
2027
|
expect(new TextDecoder().decode(decrypted)).toBe('Secret Message');
|
|
1979
2028
|
});
|
|
@@ -2122,8 +2171,8 @@ describe('Cryptographic Properties', () => {
|
|
|
2122
2171
|
fc.asyncProperty(
|
|
2123
2172
|
fc.uint8Array({ minLength: 1, maxLength: 1000 }),
|
|
2124
2173
|
async (message) => {
|
|
2125
|
-
const encrypted = await ecies.
|
|
2126
|
-
const decrypted = await ecies.
|
|
2174
|
+
const encrypted = await ecies.encryptWithLength(publicKey, message);
|
|
2175
|
+
const decrypted = await ecies.decryptWithLengthAndHeader(privateKey, encrypted);
|
|
2127
2176
|
|
|
2128
2177
|
expect(decrypted).toEqual(message);
|
|
2129
2178
|
}
|
|
@@ -2137,7 +2186,7 @@ describe('Cryptographic Properties', () => {
|
|
|
2137
2186
|
### Testing Best Practices
|
|
2138
2187
|
|
|
2139
2188
|
1. **Initialize i18n** before running tests with `getEciesI18nEngine()`
|
|
2140
|
-
2. **Test all encryption modes** (
|
|
2189
|
+
2. **Test all encryption modes** (Basic, WithLength, Multiple)
|
|
2141
2190
|
3. **Test with different ID providers** to ensure compatibility
|
|
2142
2191
|
4. **Use property-based tests** for cryptographic invariants
|
|
2143
2192
|
5. **Test error conditions** like invalid keys, corrupted data, and wrong recipients
|
|
@@ -2162,8 +2211,7 @@ describe('Cross-Platform Compatibility', () => {
|
|
|
2162
2211
|
const nodeEncrypted = Buffer.from('...'); // From node-ecies-lib
|
|
2163
2212
|
|
|
2164
2213
|
const browserEcies = new BrowserECIES();
|
|
2165
|
-
const decrypted = await browserEcies.
|
|
2166
|
-
false,
|
|
2214
|
+
const decrypted = await browserEcies.decryptWithLengthAndHeader(
|
|
2167
2215
|
privateKey,
|
|
2168
2216
|
new Uint8Array(nodeEncrypted)
|
|
2169
2217
|
);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@digitaldefiance/ecies-lib",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.13.1",
|
|
4
4
|
"description": "Digital Defiance ECIES Library",
|
|
5
5
|
"homepage": "https://github.com/Digital-Defiance/ecies-lib",
|
|
6
6
|
"repository": {
|
|
@@ -80,8 +80,8 @@
|
|
|
80
80
|
"@digitaldefiance/express-suite-test-utils": "1.0.12",
|
|
81
81
|
"@swc/core": "^1.15.3",
|
|
82
82
|
"@swc/jest": "^0.2.39",
|
|
83
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
84
|
-
"@typescript-eslint/parser": "^8.
|
|
83
|
+
"@typescript-eslint/eslint-plugin": "^8.53.1",
|
|
84
|
+
"@typescript-eslint/parser": "^8.53.1",
|
|
85
85
|
"eslint-plugin-import": "^2.32.0",
|
|
86
86
|
"eslint-plugin-prettier": "^5.5.4",
|
|
87
87
|
"fast-check": "^4.3.0",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Fluent builder for ECIESService
|
|
2
|
+
* Fluent builder for ECIESService.
|
|
3
3
|
*/
|
|
4
4
|
import { PluginI18nEngine } from '@digitaldefiance/i18n-lib';
|
|
5
5
|
import { IECIESConfig } from '../interfaces/ecies-config';
|
|
@@ -9,10 +9,33 @@ export declare class ECIESBuilder {
|
|
|
9
9
|
private serviceConfig;
|
|
10
10
|
private eciesConsts;
|
|
11
11
|
private _i18n?;
|
|
12
|
+
/**
|
|
13
|
+
* Creates a new ECIESBuilder instance.
|
|
14
|
+
* @returns A new builder instance
|
|
15
|
+
*/
|
|
12
16
|
static create(): ECIESBuilder;
|
|
17
|
+
/**
|
|
18
|
+
* Sets the service configuration.
|
|
19
|
+
* @param config Partial service configuration
|
|
20
|
+
* @returns This builder for chaining
|
|
21
|
+
*/
|
|
13
22
|
withServiceConfig(config: Partial<IECIESConfig>): this;
|
|
23
|
+
/**
|
|
24
|
+
* Sets the ECIES constants.
|
|
25
|
+
* @param constants Partial ECIES constants
|
|
26
|
+
* @returns This builder for chaining
|
|
27
|
+
*/
|
|
14
28
|
withConstants(constants: Partial<IECIESConstants>): this;
|
|
29
|
+
/**
|
|
30
|
+
* Sets the i18n engine.
|
|
31
|
+
* @param engine The i18n engine instance
|
|
32
|
+
* @returns This builder for chaining
|
|
33
|
+
*/
|
|
15
34
|
withI18n(engine: PluginI18nEngine<string>): this;
|
|
35
|
+
/**
|
|
36
|
+
* Builds and returns the configured ECIESService instance.
|
|
37
|
+
* @returns A new ECIESService instance
|
|
38
|
+
*/
|
|
16
39
|
build(): ECIESService;
|
|
17
40
|
}
|
|
18
41
|
//# sourceMappingURL=ecies-builder.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ecies-builder.d.ts","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-ecies-lib/src/builders/ecies-builder.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAE7D,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAEzD,qBAAa,YAAY;IACvB,OAAO,CAAC,aAAa,CAA6B;IAClD,OAAO,CAAC,WAAW,CAAgC;IACnD,OAAO,CAAC,KAAK,CAAC,CAA2B;IAEzC,MAAM,CAAC,MAAM,IAAI,YAAY;IAI7B,iBAAiB,CAAC,MAAM,EAAE,OAAO,CAAC,YAAY,CAAC,GAAG,IAAI;IAKtD,aAAa,CAAC,SAAS,EAAE,OAAO,CAAC,eAAe,CAAC,GAAG,IAAI;IAKxD,QAAQ,CAAC,MAAM,EAAE,gBAAgB,CAAC,MAAM,CAAC,GAAG,IAAI;IAKhD,KAAK,IAAI,YAAY;CAItB"}
|
|
1
|
+
{"version":3,"file":"ecies-builder.d.ts","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-ecies-lib/src/builders/ecies-builder.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAE7D,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAEzD,qBAAa,YAAY;IACvB,OAAO,CAAC,aAAa,CAA6B;IAClD,OAAO,CAAC,WAAW,CAAgC;IACnD,OAAO,CAAC,KAAK,CAAC,CAA2B;IAEzC;;;OAGG;IACH,MAAM,CAAC,MAAM,IAAI,YAAY;IAI7B;;;;OAIG;IACH,iBAAiB,CAAC,MAAM,EAAE,OAAO,CAAC,YAAY,CAAC,GAAG,IAAI;IAKtD;;;;OAIG;IACH,aAAa,CAAC,SAAS,EAAE,OAAO,CAAC,eAAe,CAAC,GAAG,IAAI;IAKxD;;;;OAIG;IACH,QAAQ,CAAC,MAAM,EAAE,gBAAgB,CAAC,MAAM,CAAC,GAAG,IAAI;IAKhD;;;OAGG;IACH,KAAK,IAAI,YAAY;CAItB"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/**
|
|
3
|
-
* Fluent builder for ECIESService
|
|
3
|
+
* Fluent builder for ECIESService.
|
|
4
4
|
*/
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.ECIESBuilder = void 0;
|
|
@@ -10,21 +10,44 @@ class ECIESBuilder {
|
|
|
10
10
|
serviceConfig = {};
|
|
11
11
|
eciesConsts = {};
|
|
12
12
|
_i18n;
|
|
13
|
+
/**
|
|
14
|
+
* Creates a new ECIESBuilder instance.
|
|
15
|
+
* @returns A new builder instance
|
|
16
|
+
*/
|
|
13
17
|
static create() {
|
|
14
18
|
return new ECIESBuilder();
|
|
15
19
|
}
|
|
20
|
+
/**
|
|
21
|
+
* Sets the service configuration.
|
|
22
|
+
* @param config Partial service configuration
|
|
23
|
+
* @returns This builder for chaining
|
|
24
|
+
*/
|
|
16
25
|
withServiceConfig(config) {
|
|
17
26
|
this.serviceConfig = { ...this.serviceConfig, ...config };
|
|
18
27
|
return this;
|
|
19
28
|
}
|
|
29
|
+
/**
|
|
30
|
+
* Sets the ECIES constants.
|
|
31
|
+
* @param constants Partial ECIES constants
|
|
32
|
+
* @returns This builder for chaining
|
|
33
|
+
*/
|
|
20
34
|
withConstants(constants) {
|
|
21
35
|
this.eciesConsts = { ...this.eciesConsts, ...constants };
|
|
22
36
|
return this;
|
|
23
37
|
}
|
|
38
|
+
/**
|
|
39
|
+
* Sets the i18n engine.
|
|
40
|
+
* @param engine The i18n engine instance
|
|
41
|
+
* @returns This builder for chaining
|
|
42
|
+
*/
|
|
24
43
|
withI18n(engine) {
|
|
25
44
|
this._i18n = engine;
|
|
26
45
|
return this;
|
|
27
46
|
}
|
|
47
|
+
/**
|
|
48
|
+
* Builds and returns the configured ECIESService instance.
|
|
49
|
+
* @returns A new ECIESService instance
|
|
50
|
+
*/
|
|
28
51
|
build() {
|
|
29
52
|
const finalConstants = { ...constants_1.Constants.ECIES, ...this.eciesConsts };
|
|
30
53
|
return new service_1.ECIESService(this.serviceConfig, finalConstants);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ecies-builder.js","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-ecies-lib/src/builders/ecies-builder.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAGH,4CAAyC;AAGzC,uDAAyD;AAEzD,MAAa,YAAY;IACf,aAAa,GAA0B,EAAE,CAAC;IAC1C,WAAW,GAA6B,EAAE,CAAC;IAC3C,KAAK,CAA4B;IAEzC,MAAM,CAAC,MAAM;QACX,OAAO,IAAI,YAAY,EAAE,CAAC;IAC5B,CAAC;IAED,iBAAiB,CAAC,MAA6B;QAC7C,IAAI,CAAC,aAAa,GAAG,EAAE,GAAG,IAAI,CAAC,aAAa,EAAE,GAAG,MAAM,EAAE,CAAC;QAC1D,OAAO,IAAI,CAAC;IACd,CAAC;IAED,aAAa,CAAC,SAAmC;QAC/C,IAAI,CAAC,WAAW,GAAG,EAAE,GAAG,IAAI,CAAC,WAAW,EAAE,GAAG,SAAS,EAAE,CAAC;QACzD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,QAAQ,CAAC,MAAgC;QACvC,IAAI,CAAC,KAAK,GAAG,MAAM,CAAC;QACpB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,KAAK;QACH,MAAM,cAAc,GAAG,EAAE,GAAG,qBAAS,CAAC,KAAK,EAAE,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC;QACnE,OAAO,IAAI,sBAAY,CAAC,IAAI,CAAC,aAAa,EAAE,cAAc,CAAC,CAAC;IAC9D,CAAC;CACF;
|
|
1
|
+
{"version":3,"file":"ecies-builder.js","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-ecies-lib/src/builders/ecies-builder.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAGH,4CAAyC;AAGzC,uDAAyD;AAEzD,MAAa,YAAY;IACf,aAAa,GAA0B,EAAE,CAAC;IAC1C,WAAW,GAA6B,EAAE,CAAC;IAC3C,KAAK,CAA4B;IAEzC;;;OAGG;IACH,MAAM,CAAC,MAAM;QACX,OAAO,IAAI,YAAY,EAAE,CAAC;IAC5B,CAAC;IAED;;;;OAIG;IACH,iBAAiB,CAAC,MAA6B;QAC7C,IAAI,CAAC,aAAa,GAAG,EAAE,GAAG,IAAI,CAAC,aAAa,EAAE,GAAG,MAAM,EAAE,CAAC;QAC1D,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;;OAIG;IACH,aAAa,CAAC,SAAmC;QAC/C,IAAI,CAAC,WAAW,GAAG,EAAE,GAAG,IAAI,CAAC,WAAW,EAAE,GAAG,SAAS,EAAE,CAAC;QACzD,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;;OAIG;IACH,QAAQ,CAAC,MAAgC;QACvC,IAAI,CAAC,KAAK,GAAG,MAAM,CAAC;QACpB,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;OAGG;IACH,KAAK;QACH,MAAM,cAAc,GAAG,EAAE,GAAG,qBAAS,CAAC,KAAK,EAAE,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC;QACnE,OAAO,IAAI,sBAAY,CAAC,IAAI,CAAC,aAAa,EAAE,cAAc,CAAC,CAAC;IAC9D,CAAC;CACF;AAnDD,oCAmDC"}
|
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Fluent builder for Member
|
|
2
|
+
* Fluent builder for Member instances.
|
|
3
|
+
* Provides a convenient way to configure and create Member instances with all required properties.
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* ```typescript
|
|
7
|
+
* const { member, mnemonic } = MemberBuilder.create()
|
|
8
|
+
* .withEciesService(service)
|
|
9
|
+
* .withType(MemberType.User)
|
|
10
|
+
* .withName('Alice')
|
|
11
|
+
* .withEmail('alice@example.com')
|
|
12
|
+
* .generateMnemonic()
|
|
13
|
+
* .build();
|
|
14
|
+
* ```
|
|
3
15
|
*/
|
|
4
16
|
import { EmailString } from '../email-string';
|
|
5
17
|
import { MemberType } from '../enumerations/member-type';
|
|
@@ -14,14 +26,58 @@ export declare class MemberBuilder {
|
|
|
14
26
|
private email?;
|
|
15
27
|
private mnemonic?;
|
|
16
28
|
private createdBy?;
|
|
29
|
+
/**
|
|
30
|
+
* Creates a new MemberBuilder instance.
|
|
31
|
+
* @returns A new builder instance
|
|
32
|
+
*/
|
|
17
33
|
static create(): MemberBuilder;
|
|
34
|
+
/**
|
|
35
|
+
* Sets the ECIES service to use.
|
|
36
|
+
* @param service The ECIES service instance
|
|
37
|
+
* @returns This builder for chaining
|
|
38
|
+
*/
|
|
18
39
|
withEciesService(service: ECIESService): this;
|
|
40
|
+
/**
|
|
41
|
+
* Sets the member type.
|
|
42
|
+
* @param type The member type (Admin, System, User, Anonymous)
|
|
43
|
+
* @returns This builder for chaining
|
|
44
|
+
*/
|
|
19
45
|
withType(type: MemberType): this;
|
|
46
|
+
/**
|
|
47
|
+
* Sets the member name.
|
|
48
|
+
* @param name The member's display name
|
|
49
|
+
* @returns This builder for chaining
|
|
50
|
+
*/
|
|
20
51
|
withName(name: string): this;
|
|
52
|
+
/**
|
|
53
|
+
* Sets the member email.
|
|
54
|
+
* @param email The member's email address (string or EmailString)
|
|
55
|
+
* @returns This builder for chaining
|
|
56
|
+
*/
|
|
21
57
|
withEmail(email: string | EmailString): this;
|
|
58
|
+
/**
|
|
59
|
+
* Sets a specific mnemonic to use.
|
|
60
|
+
* @param mnemonic The BIP39 mnemonic phrase
|
|
61
|
+
* @returns This builder for chaining
|
|
62
|
+
*/
|
|
22
63
|
withMnemonic(mnemonic: SecureString): this;
|
|
64
|
+
/**
|
|
65
|
+
* Sets the creator ID.
|
|
66
|
+
* @param creatorId The ID of the member who created this member
|
|
67
|
+
* @returns This builder for chaining
|
|
68
|
+
*/
|
|
23
69
|
withCreatedBy(creatorId: Uint8Array): this;
|
|
70
|
+
/**
|
|
71
|
+
* Generates a new random mnemonic.
|
|
72
|
+
* @returns This builder for chaining
|
|
73
|
+
* @throws {Error} If ECIES service is not set
|
|
74
|
+
*/
|
|
24
75
|
generateMnemonic(): this;
|
|
76
|
+
/**
|
|
77
|
+
* Builds and returns the configured Member instance with its mnemonic.
|
|
78
|
+
* @returns Object containing the member and mnemonic
|
|
79
|
+
* @throws {Error} If required fields are missing
|
|
80
|
+
*/
|
|
25
81
|
build(): IMemberWithMnemonic;
|
|
26
82
|
/**
|
|
27
83
|
* Convenience factory method to create a new member with default ECIESService
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"member-builder.d.ts","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-ecies-lib/src/builders/member-builder.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"member-builder.d.ts","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-ecies-lib/src/builders/member-builder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE9C,OAAO,EAAE,UAAU,EAAE,M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H,MAAM,CAAC,QAAQ,CAAC,GAAG,SAAS,UAAU,GAAG,UAAU,EACjD,IAAI,EAAE,MAAM,GACX,MAAM,CAAC,GAAG,CAAC;IAKd;;;;;;OAMG;IACH,MAAM,CAAC,YAAY,CAAC,GAAG,SAAS,UAAU,GAAG,UAAU,EACrD,QAAQ,EAAE,YAAY,EACtB,IAAI,SAAc,EAClB,KAAK,GAAE,WAAW,GAAG,MAA2B,GAC/C,MAAM,CAAC,GAAG,CAAC;CAYf"}
|
|
@@ -1,6 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/**
|
|
3
|
-
* Fluent builder for Member
|
|
3
|
+
* Fluent builder for Member instances.
|
|
4
|
+
* Provides a convenient way to configure and create Member instances with all required properties.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```typescript
|
|
8
|
+
* const { member, mnemonic } = MemberBuilder.create()
|
|
9
|
+
* .withEciesService(service)
|
|
10
|
+
* .withType(MemberType.User)
|
|
11
|
+
* .withName('Alice')
|
|
12
|
+
* .withEmail('alice@example.com')
|
|
13
|
+
* .generateMnemonic()
|
|
14
|
+
* .build();
|
|
15
|
+
* ```
|
|
4
16
|
*/
|
|
5
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
18
|
exports.MemberBuilder = void 0;
|
|
@@ -16,33 +28,72 @@ class MemberBuilder {
|
|
|
16
28
|
email;
|
|
17
29
|
mnemonic;
|
|
18
30
|
createdBy; // ID of the creator
|
|
31
|
+
/**
|
|
32
|
+
* Creates a new MemberBuilder instance.
|
|
33
|
+
* @returns A new builder instance
|
|
34
|
+
*/
|
|
19
35
|
static create() {
|
|
20
36
|
return new MemberBuilder();
|
|
21
37
|
}
|
|
38
|
+
/**
|
|
39
|
+
* Sets the ECIES service to use.
|
|
40
|
+
* @param service The ECIES service instance
|
|
41
|
+
* @returns This builder for chaining
|
|
42
|
+
*/
|
|
22
43
|
withEciesService(service) {
|
|
23
44
|
this.eciesService = service;
|
|
24
45
|
return this;
|
|
25
46
|
}
|
|
47
|
+
/**
|
|
48
|
+
* Sets the member type.
|
|
49
|
+
* @param type The member type (Admin, System, User, Anonymous)
|
|
50
|
+
* @returns This builder for chaining
|
|
51
|
+
*/
|
|
26
52
|
withType(type) {
|
|
27
53
|
this.type = type;
|
|
28
54
|
return this;
|
|
29
55
|
}
|
|
56
|
+
/**
|
|
57
|
+
* Sets the member name.
|
|
58
|
+
* @param name The member's display name
|
|
59
|
+
* @returns This builder for chaining
|
|
60
|
+
*/
|
|
30
61
|
withName(name) {
|
|
31
62
|
this.name = name;
|
|
32
63
|
return this;
|
|
33
64
|
}
|
|
65
|
+
/**
|
|
66
|
+
* Sets the member email.
|
|
67
|
+
* @param email The member's email address (string or EmailString)
|
|
68
|
+
* @returns This builder for chaining
|
|
69
|
+
*/
|
|
34
70
|
withEmail(email) {
|
|
35
71
|
this.email = typeof email === 'string' ? new email_string_1.EmailString(email) : email;
|
|
36
72
|
return this;
|
|
37
73
|
}
|
|
74
|
+
/**
|
|
75
|
+
* Sets a specific mnemonic to use.
|
|
76
|
+
* @param mnemonic The BIP39 mnemonic phrase
|
|
77
|
+
* @returns This builder for chaining
|
|
78
|
+
*/
|
|
38
79
|
withMnemonic(mnemonic) {
|
|
39
80
|
this.mnemonic = mnemonic;
|
|
40
81
|
return this;
|
|
41
82
|
}
|
|
83
|
+
/**
|
|
84
|
+
* Sets the creator ID.
|
|
85
|
+
* @param creatorId The ID of the member who created this member
|
|
86
|
+
* @returns This builder for chaining
|
|
87
|
+
*/
|
|
42
88
|
withCreatedBy(creatorId) {
|
|
43
89
|
this.createdBy = creatorId;
|
|
44
90
|
return this;
|
|
45
91
|
}
|
|
92
|
+
/**
|
|
93
|
+
* Generates a new random mnemonic.
|
|
94
|
+
* @returns This builder for chaining
|
|
95
|
+
* @throws {Error} If ECIES service is not set
|
|
96
|
+
*/
|
|
46
97
|
generateMnemonic() {
|
|
47
98
|
if (!this.eciesService) {
|
|
48
99
|
const engine = (0, i18n_setup_1.getEciesI18nEngine)();
|
|
@@ -51,6 +102,11 @@ class MemberBuilder {
|
|
|
51
102
|
this.mnemonic = this.eciesService.generateNewMnemonic();
|
|
52
103
|
return this;
|
|
53
104
|
}
|
|
105
|
+
/**
|
|
106
|
+
* Builds and returns the configured Member instance with its mnemonic.
|
|
107
|
+
* @returns Object containing the member and mnemonic
|
|
108
|
+
* @throws {Error} If required fields are missing
|
|
109
|
+
*/
|
|
54
110
|
build() {
|
|
55
111
|
const engine = (0, i18n_setup_1.getEciesI18nEngine)();
|
|
56
112
|
if (!this.eciesService) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"member-builder.js","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-ecies-lib/src/builders/member-builder.ts"],"names":[],"mappings":";AAAA
|
|
1
|
+
{"version":3,"file":"member-builder.js","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-ecies-lib/src/builders/member-builder.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,kDAA8C;AAC9C,kDAAiD;AAEjD,8CAAqE;AAErE,sCAAwD;AAExD,uDAAyD;AAEzD,MAAa,aAAa;IAChB,YAAY,CAAgB;IAC5B,IAAI,CAAc;IAClB,IAAI,CAAU;IACd,KAAK,CAAe;IACpB,QAAQ,CAAgB;IACxB,SAAS,CAAc,CAAC,oBAAoB;IAEpD;;;OAGG;IACH,MAAM,CAAC,MAAM;QACX,OAAO,IAAI,aAAa,EAAE,CAAC;IAC7B,CAAC;IAED;;;;OAIG;IACH,gBAAgB,CAAC,OAAqB;QACpC,IAAI,CAAC,YAAY,GAAG,OAAO,CAAC;QAC5B,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;;OAIG;IACH,QAAQ,CAAC,IAAgB;QACvB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;;OAIG;IACH,QAAQ,CAAC,IAAY;QACnB,IAAI,CAAC,I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,QAAQ,CACM,CAAC;IACnB,CAAC;CACF;AAjMD,sCAiMC"}
|
package/src/constants.d.ts
CHANGED
|
@@ -1,28 +1,39 @@
|
|
|
1
1
|
import type { IChecksumConsts } from './interfaces/checksum-consts';
|
|
2
2
|
import type { IConfigurationProvenance } from './interfaces/configuration-provenance';
|
|
3
3
|
import type { IConstants } from './interfaces/constants';
|
|
4
|
+
import type { IECIESConfig } from './interfaces/ecies-config';
|
|
4
5
|
import type { IECIESConstants } from './interfaces/ecies-consts';
|
|
5
6
|
import type { IPBkdf2Consts } from './interfaces/pbkdf2-consts';
|
|
6
7
|
import type { IVotingConsts } from './lib/voting/interfaces/voting-consts';
|
|
7
8
|
import type { Pbkdf2Profiles } from './pbkdf2-profiles';
|
|
8
9
|
import type { DeepPartial } from './types/deep-partial';
|
|
9
10
|
/**
|
|
10
|
-
* Calculates a checksum for a configuration object.
|
|
11
|
-
*
|
|
11
|
+
* Calculates a SHA-256 checksum for a configuration object.
|
|
12
|
+
* Creates a stable JSON representation with BigInt support.
|
|
13
|
+
* @param config The configuration object to checksum
|
|
14
|
+
* @returns Hexadecimal string representation of the SHA-256 hash
|
|
12
15
|
*/
|
|
13
16
|
declare function calculateConfigChecksum(config: IConstants): string;
|
|
14
17
|
/**
|
|
15
|
-
* Captures a stack trace for provenance tracking
|
|
18
|
+
* Captures a stack trace for provenance tracking.
|
|
19
|
+
* Used to track where configuration objects are created.
|
|
20
|
+
* @returns Stack trace string or 'stack unavailable' if not supported
|
|
16
21
|
*/
|
|
17
22
|
declare function captureCreationStack(): string;
|
|
23
|
+
/** Size of an 8-bit unsigned integer in bytes */
|
|
18
24
|
export declare const UINT8_SIZE: number;
|
|
25
|
+
/** Size of a 16-bit unsigned integer in bytes */
|
|
19
26
|
export declare const UINT16_SIZE: number;
|
|
27
|
+
/** Maximum value for a 16-bit unsigned integer */
|
|
20
28
|
export declare const UINT16_MAX: number;
|
|
29
|
+
/** Size of a 32-bit unsigned integer in bytes */
|
|
21
30
|
export declare const UINT32_SIZE: number;
|
|
31
|
+
/** Maximum value for a 32-bit unsigned integer */
|
|
22
32
|
export declare const UINT32_MAX: number;
|
|
33
|
+
/** Size of a 64-bit unsigned integer in bytes */
|
|
23
34
|
export declare const UINT64_SIZE: number;
|
|
35
|
+
/** Maximum value for a 64-bit unsigned integer */
|
|
24
36
|
export declare const UINT64_MAX: bigint;
|
|
25
|
-
export declare const OBJECT_ID_LENGTH: number;
|
|
26
37
|
/**
|
|
27
38
|
* Constants for checksum operations
|
|
28
39
|
* These values are critical for data integrity and MUST NOT be changed
|
|
@@ -32,6 +43,7 @@ export declare const CHECKSUM: IChecksumConsts;
|
|
|
32
43
|
export declare const PBKDF2: IPBkdf2Consts;
|
|
33
44
|
export declare const PBKDF2_PROFILES: Pbkdf2Profiles;
|
|
34
45
|
export declare const ECIES: IECIESConstants;
|
|
46
|
+
export declare const ECIES_CONFIG: IECIESConfig;
|
|
35
47
|
/**
|
|
36
48
|
* Constants for voting operations using Paillier homomorphic encryption.
|
|
37
49
|
* These values are critical for cryptographic operations and MUST match
|
|
@@ -40,37 +52,114 @@ export declare const ECIES: IECIESConstants;
|
|
|
40
52
|
export declare const VOTING: IVotingConsts;
|
|
41
53
|
export declare const Constants: IConstants;
|
|
42
54
|
export type ConfigurationKey = string | symbol;
|
|
55
|
+
/**
|
|
56
|
+
* Creates a runtime configuration by merging overrides with a base configuration.
|
|
57
|
+
* Validates the result and freezes it to prevent modification.
|
|
58
|
+
* @param overrides Partial configuration overrides
|
|
59
|
+
* @param base Base configuration to extend (defaults to Constants)
|
|
60
|
+
* @returns Frozen, validated configuration object
|
|
61
|
+
*/
|
|
43
62
|
export declare function createRuntimeConfiguration(overrides?: DeepPartial<IConstants>, base?: IConstants): IConstants;
|
|
63
|
+
/**
|
|
64
|
+
* Registry for managing multiple named configuration instances.
|
|
65
|
+
* Provides methods to register, retrieve, and manage configurations with provenance tracking.
|
|
66
|
+
*/
|
|
44
67
|
export declare class ConstantsRegistry {
|
|
68
|
+
/**
|
|
69
|
+
* Default configuration key symbol.
|
|
70
|
+
*/
|
|
45
71
|
static readonly DEFAULT_KEY: ConfigurationKey;
|
|
72
|
+
/**
|
|
73
|
+
* Lists all registered configuration keys.
|
|
74
|
+
* @returns Array of configuration keys
|
|
75
|
+
*/
|
|
46
76
|
static listKeys(): ConfigurationKey[];
|
|
77
|
+
/**
|
|
78
|
+
* Checks if a configuration key exists in the registry.
|
|
79
|
+
* @param key The configuration key to check
|
|
80
|
+
* @returns True if the key exists
|
|
81
|
+
*/
|
|
47
82
|
static has(key: ConfigurationKey): boolean;
|
|
83
|
+
/**
|
|
84
|
+
* Retrieves a configuration by key.
|
|
85
|
+
* @param key The configuration key (defaults to DEFAULT_KEY)
|
|
86
|
+
* @returns The configuration object
|
|
87
|
+
*/
|
|
48
88
|
static get(key?: ConfigurationKey): IConstants;
|
|
49
89
|
/**
|
|
50
|
-
*
|
|
90
|
+
* Gets provenance information for a configuration.
|
|
91
|
+
* @param key The configuration key (defaults to DEFAULT_KEY)
|
|
92
|
+
* @returns Provenance information or undefined if not found
|
|
51
93
|
*/
|
|
52
94
|
static getProvenance(key?: ConfigurationKey): IConfigurationProvenance | undefined;
|
|
53
95
|
/**
|
|
54
|
-
*
|
|
96
|
+
* Lists all configurations with their provenance information.
|
|
97
|
+
* @returns Array of configuration entries with keys, configs, and provenance
|
|
55
98
|
*/
|
|
56
99
|
static listWithProvenance(): Array<{
|
|
57
100
|
key: ConfigurationKey;
|
|
58
101
|
config: IConstants;
|
|
59
102
|
provenance?: IConfigurationProvenance;
|
|
60
103
|
}>;
|
|
104
|
+
/**
|
|
105
|
+
* Creates a new configuration from overrides without registering it.
|
|
106
|
+
* @param overrides Partial configuration overrides
|
|
107
|
+
* @param baseKey Key of the base configuration to extend
|
|
108
|
+
* @returns New configuration object
|
|
109
|
+
*/
|
|
61
110
|
static create(overrides?: DeepPartial<IConstants>, baseKey?: ConfigurationKey): IConstants;
|
|
62
|
-
|
|
111
|
+
/**
|
|
112
|
+
* Registers a new configuration in the registry.
|
|
113
|
+
* @param key Unique key for the configuration
|
|
114
|
+
* @param configOrOverrides Full configuration or partial overrides
|
|
115
|
+
* @param options Registration options (baseKey, description)
|
|
116
|
+
* @returns The registered configuration
|
|
117
|
+
* @throws {Error} If attempting to overwrite the default configuration
|
|
118
|
+
*/
|
|
119
|
+
static register<T extends IConstants = IConstants>(key: ConfigurationKey, configOrOverrides?: DeepPartial<T> | T, options?: {
|
|
63
120
|
baseKey?: ConfigurationKey;
|
|
64
121
|
description?: string;
|
|
65
|
-
}):
|
|
122
|
+
}): T;
|
|
123
|
+
/**
|
|
124
|
+
* Unregisters a configuration from the registry.
|
|
125
|
+
* @param key The configuration key to remove
|
|
126
|
+
* @returns True if the configuration was removed, false if it didn't exist or is the default
|
|
127
|
+
*/
|
|
66
128
|
static unregister(key: ConfigurationKey): boolean;
|
|
129
|
+
/**
|
|
130
|
+
* Clears all configurations except the default.
|
|
131
|
+
*/
|
|
67
132
|
static clear(): void;
|
|
68
133
|
}
|
|
134
|
+
/**
|
|
135
|
+
* Retrieves a runtime configuration by key.
|
|
136
|
+
* Convenience function that delegates to ConstantsRegistry.get.
|
|
137
|
+
* @param key The configuration key (defaults to DEFAULT_KEY)
|
|
138
|
+
* @returns The configuration object
|
|
139
|
+
*/
|
|
69
140
|
export declare function getRuntimeConfiguration(key?: ConfigurationKey): IConstants;
|
|
70
|
-
|
|
141
|
+
/**
|
|
142
|
+
* Registers a runtime configuration.
|
|
143
|
+
* Convenience function that delegates to ConstantsRegistry.register.
|
|
144
|
+
* @param key Unique key for the configuration
|
|
145
|
+
* @param configOrOverrides Full configuration or partial overrides
|
|
146
|
+
* @param options Registration options
|
|
147
|
+
* @returns The registered configuration
|
|
148
|
+
*/
|
|
149
|
+
export declare function registerRuntimeConfiguration<T extends IConstants = IConstants>(key: ConfigurationKey, configOrOverrides?: DeepPartial<T> | T, options?: {
|
|
71
150
|
baseKey?: ConfigurationKey;
|
|
72
|
-
}):
|
|
151
|
+
}): T;
|
|
152
|
+
/**
|
|
153
|
+
* Unregisters a runtime configuration.
|
|
154
|
+
* Convenience function that delegates to ConstantsRegistry.unregister.
|
|
155
|
+
* @param key The configuration key to remove
|
|
156
|
+
* @returns True if the configuration was removed
|
|
157
|
+
*/
|
|
73
158
|
export declare function unregisterRuntimeConfiguration(key: ConfigurationKey): boolean;
|
|
159
|
+
/**
|
|
160
|
+
* Clears all runtime configurations except the default.
|
|
161
|
+
* Convenience function that delegates to ConstantsRegistry.clear.
|
|
162
|
+
*/
|
|
74
163
|
export declare function clearRuntimeConfigurations(): void;
|
|
75
164
|
export { MNEMONIC_REGEX, PASSWORD_REGEX } from './regexes';
|
|
76
165
|
export { calculateConfigChecksum, captureCreationStack };
|
package/src/constants.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../packages/digitaldefiance-ecies-lib/src/constants.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,uCAAuC,CAAC;AACtF,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAGhE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uCAAuC,CAAC;AAC3E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAExD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAExD
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../packages/digitaldefiance-ecies-lib/src/constants.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AACp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