@opentdf/sdk 0.1.0-beta.1718 → 0.2.0-beta.1941
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 +45 -38
- package/dist/cjs/src/access.js +99 -62
- package/dist/cjs/src/auth/auth.js +5 -26
- package/dist/cjs/src/auth/oidc-clientcredentials-provider.js +1 -1
- package/dist/cjs/src/auth/oidc-externaljwt-provider.js +1 -1
- package/dist/cjs/src/auth/oidc-refreshtoken-provider.js +1 -1
- package/dist/cjs/src/auth/oidc.js +1 -1
- package/dist/cjs/src/auth/providers.js +1 -1
- package/dist/cjs/src/concurrency.js +3 -4
- package/dist/cjs/src/encodings/base64.js +4 -4
- package/dist/cjs/src/encodings/hex.js +5 -6
- package/dist/cjs/src/encodings/index.js +18 -8
- package/dist/cjs/src/errors.js +1 -1
- package/dist/cjs/src/index.js +28 -320
- package/dist/cjs/src/nanoclients.js +285 -0
- package/dist/cjs/src/nanoindex.js +47 -0
- package/dist/cjs/src/nanotdf/Client.js +35 -30
- package/dist/cjs/src/nanotdf/NanoTDF.js +1 -1
- package/dist/cjs/src/nanotdf/decrypt.js +2 -2
- package/dist/cjs/src/nanotdf/encrypt-dataset.js +2 -2
- package/dist/cjs/src/nanotdf/encrypt.js +2 -2
- package/dist/cjs/src/nanotdf/helpers/calculateByCurve.js +3 -4
- package/dist/cjs/src/nanotdf/helpers/getHkdfSalt.js +2 -2
- package/dist/cjs/src/nanotdf/models/Ciphers.js +3 -3
- package/dist/cjs/src/nanotdf/models/EcCurves.js +3 -3
- package/dist/cjs/src/nanotdf/models/Header.js +1 -1
- package/dist/cjs/src/nanotdf/models/Payload.js +1 -1
- package/dist/cjs/src/nanotdf/models/Policy/AbstractPolicy.js +1 -1
- package/dist/cjs/src/nanotdf/models/Policy/EmbeddedPolicy.js +1 -1
- package/dist/cjs/src/nanotdf/models/Policy/PolicyFactory.js +1 -1
- package/dist/cjs/src/nanotdf/models/ResourceLocator.js +1 -1
- package/dist/cjs/src/nanotdf/models/Signature.js +1 -1
- package/dist/cjs/src/nanotdf-crypto/ciphers.js +1 -1
- package/dist/cjs/src/nanotdf-crypto/decrypt.js +2 -2
- package/dist/cjs/src/nanotdf-crypto/digest.js +2 -2
- package/dist/cjs/src/nanotdf-crypto/ecdsaSignature.js +4 -5
- package/dist/cjs/src/nanotdf-crypto/encrypt.js +2 -2
- package/dist/cjs/src/nanotdf-crypto/exportCryptoKey.js +2 -2
- package/dist/cjs/src/nanotdf-crypto/generateKeyPair.js +2 -2
- package/dist/cjs/src/nanotdf-crypto/generateRandomNumber.js +2 -2
- package/dist/cjs/src/nanotdf-crypto/index.js +21 -13
- package/dist/cjs/src/nanotdf-crypto/keyAgreement.js +10 -8
- package/dist/cjs/src/nanotdf-crypto/pemPublicToCrypto.js +20 -11
- package/dist/cjs/src/opentdf.js +243 -0
- package/dist/cjs/src/policy/api.js +2 -3
- package/dist/cjs/src/policy/granter.js +3 -4
- package/dist/cjs/src/seekable.js +157 -0
- package/dist/cjs/src/tdf/AttributeObject.js +2 -4
- package/dist/cjs/src/tdf/Policy.js +3 -3
- package/dist/cjs/src/utils.js +13 -21
- package/dist/cjs/src/version.js +7 -3
- package/dist/cjs/tdf3/index.js +27 -16
- package/dist/cjs/tdf3/src/assertions.js +25 -11
- package/dist/cjs/tdf3/src/binary.js +1 -1
- package/dist/cjs/tdf3/src/ciphers/aes-gcm-cipher.js +1 -1
- package/dist/cjs/tdf3/src/ciphers/symmetric-cipher-base.js +1 -1
- package/dist/cjs/tdf3/src/client/DecoratedReadableStream.js +7 -74
- package/dist/cjs/tdf3/src/client/builders.js +26 -22
- package/dist/cjs/tdf3/src/client/index.js +91 -117
- package/dist/cjs/tdf3/src/client/validation.js +3 -3
- package/dist/cjs/tdf3/src/crypto/crypto-utils.js +1 -1
- package/dist/cjs/tdf3/src/crypto/index.js +18 -18
- package/dist/cjs/tdf3/src/index.js +22 -11
- package/dist/cjs/tdf3/src/models/attribute-set.js +1 -1
- package/dist/cjs/tdf3/src/models/encryption-information.js +3 -3
- package/dist/cjs/tdf3/src/models/index.js +1 -2
- package/dist/cjs/tdf3/src/models/key-access.js +67 -35
- package/dist/cjs/tdf3/src/models/policy.js +3 -3
- package/dist/cjs/tdf3/src/tdf.js +180 -395
- package/dist/cjs/tdf3/src/utils/buffer-crc32.js +2 -3
- package/dist/cjs/tdf3/src/utils/index.js +48 -38
- package/dist/cjs/tdf3/src/utils/keysplit.js +4 -5
- package/dist/cjs/tdf3/src/utils/unwrap.js +21 -0
- package/dist/cjs/tdf3/src/utils/zip-reader.js +4 -4
- package/dist/cjs/tdf3/src/utils/zip-writer.js +4 -4
- package/dist/types/src/access.d.ts +10 -4
- package/dist/types/src/access.d.ts.map +1 -1
- package/dist/types/src/auth/auth.d.ts +1 -28
- package/dist/types/src/auth/auth.d.ts.map +1 -1
- package/dist/types/src/auth/providers.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +5 -136
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/nanoclients.d.ts +107 -0
- package/dist/types/src/nanoclients.d.ts.map +1 -0
- package/dist/types/src/nanoindex.d.ts +5 -0
- package/dist/types/src/nanoindex.d.ts.map +1 -0
- package/dist/types/src/nanotdf/Client.d.ts +1 -13
- package/dist/types/src/nanotdf/Client.d.ts.map +1 -1
- package/dist/types/src/nanotdf/NanoTDF.d.ts +1 -1
- package/dist/types/src/nanotdf/NanoTDF.d.ts.map +1 -1
- package/dist/types/src/nanotdf/encrypt-dataset.d.ts +1 -1
- package/dist/types/src/nanotdf/encrypt-dataset.d.ts.map +1 -1
- package/dist/types/src/nanotdf/encrypt.d.ts +1 -1
- package/dist/types/src/nanotdf/encrypt.d.ts.map +1 -1
- package/dist/types/src/nanotdf/enum/CipherEnum.d.ts +1 -1
- package/dist/types/src/nanotdf/enum/CipherEnum.d.ts.map +1 -1
- package/dist/types/src/nanotdf/enum/PolicyTypeEnum.d.ts +1 -1
- package/dist/types/src/nanotdf/enum/PolicyTypeEnum.d.ts.map +1 -1
- package/dist/types/src/nanotdf/helpers/getHkdfSalt.d.ts +1 -1
- package/dist/types/src/nanotdf/helpers/getHkdfSalt.d.ts.map +1 -1
- package/dist/types/src/nanotdf/models/DefaultParams.d.ts +1 -1
- package/dist/types/src/nanotdf/models/ResourceLocator.d.ts.map +1 -1
- package/dist/types/src/nanotdf-crypto/digest.d.ts +1 -1
- package/dist/types/src/nanotdf-crypto/digest.d.ts.map +1 -1
- package/dist/types/src/nanotdf-crypto/generateKeyPair.d.ts +1 -1
- package/dist/types/src/nanotdf-crypto/generateKeyPair.d.ts.map +1 -1
- package/dist/types/src/nanotdf-crypto/generateRandomNumber.d.ts +1 -1
- package/dist/types/src/nanotdf-crypto/generateRandomNumber.d.ts.map +1 -1
- package/dist/types/src/nanotdf-crypto/index.d.ts +2 -3
- package/dist/types/src/nanotdf-crypto/index.d.ts.map +1 -1
- package/dist/types/src/nanotdf-crypto/keyAgreement.d.ts.map +1 -1
- package/dist/types/src/opentdf.d.ts +106 -0
- package/dist/types/src/opentdf.d.ts.map +1 -0
- package/dist/types/src/seekable.d.ts +39 -0
- package/dist/types/src/seekable.d.ts.map +1 -0
- package/dist/types/src/tdf/AttributeObject.d.ts +0 -2
- package/dist/types/src/tdf/AttributeObject.d.ts.map +1 -1
- package/dist/types/src/tdf/NanoTDF/NanoTDF.d.ts +2 -2
- package/dist/types/src/tdf/NanoTDF/NanoTDF.d.ts.map +1 -1
- package/dist/types/src/tdf/Policy.d.ts +1 -1
- package/dist/types/src/tdf/Policy.d.ts.map +1 -1
- package/dist/types/src/tdf/PolicyObject.d.ts +1 -2
- package/dist/types/src/tdf/PolicyObject.d.ts.map +1 -1
- package/dist/types/src/tdf/TypedArray.d.ts +1 -2
- package/dist/types/src/tdf/TypedArray.d.ts.map +1 -1
- package/dist/types/src/utils.d.ts +1 -3
- package/dist/types/src/utils.d.ts.map +1 -1
- package/dist/types/src/version.d.ts +5 -1
- package/dist/types/src/version.d.ts.map +1 -1
- package/dist/types/tdf3/index.d.ts +5 -4
- package/dist/types/tdf3/index.d.ts.map +1 -1
- package/dist/types/tdf3/src/assertions.d.ts +3 -3
- package/dist/types/tdf3/src/assertions.d.ts.map +1 -1
- package/dist/types/tdf3/src/client/DecoratedReadableStream.d.ts +2 -15
- package/dist/types/tdf3/src/client/DecoratedReadableStream.d.ts.map +1 -1
- package/dist/types/tdf3/src/client/builders.d.ts +43 -42
- package/dist/types/tdf3/src/client/builders.d.ts.map +1 -1
- package/dist/types/tdf3/src/client/index.d.ts +12 -17
- package/dist/types/tdf3/src/client/index.d.ts.map +1 -1
- package/dist/types/tdf3/src/client/validation.d.ts +3 -3
- package/dist/types/tdf3/src/client/validation.d.ts.map +1 -1
- package/dist/types/tdf3/src/crypto/crypto-utils.d.ts.map +1 -1
- package/dist/types/tdf3/src/index.d.ts +1 -1
- package/dist/types/tdf3/src/index.d.ts.map +1 -1
- package/dist/types/tdf3/src/models/index.d.ts +0 -1
- package/dist/types/tdf3/src/models/index.d.ts.map +1 -1
- package/dist/types/tdf3/src/models/key-access.d.ts +63 -15
- package/dist/types/tdf3/src/models/key-access.d.ts.map +1 -1
- package/dist/types/tdf3/src/models/manifest.d.ts +2 -0
- package/dist/types/tdf3/src/models/manifest.d.ts.map +1 -1
- package/dist/types/tdf3/src/models/policy.d.ts +0 -1
- package/dist/types/tdf3/src/models/policy.d.ts.map +1 -1
- package/dist/types/tdf3/src/tdf.d.ts +24 -37
- package/dist/types/tdf3/src/tdf.d.ts.map +1 -1
- package/dist/types/tdf3/src/utils/index.d.ts +0 -4
- package/dist/types/tdf3/src/utils/index.d.ts.map +1 -1
- package/dist/types/tdf3/src/utils/unwrap.d.ts +2 -0
- package/dist/types/tdf3/src/utils/unwrap.d.ts.map +1 -0
- package/dist/types/tdf3/src/utils/zip-reader.d.ts +1 -1
- package/dist/types/tdf3/src/utils/zip-reader.d.ts.map +1 -1
- package/dist/types/tdf3/src/utils/zip-writer.d.ts +2 -2
- package/dist/web/src/access.js +93 -58
- package/dist/web/src/auth/auth.js +1 -21
- package/dist/web/src/auth/oidc-clientcredentials-provider.js +1 -1
- package/dist/web/src/auth/oidc-externaljwt-provider.js +1 -1
- package/dist/web/src/auth/oidc-refreshtoken-provider.js +1 -1
- package/dist/web/src/auth/oidc.js +1 -1
- package/dist/web/src/auth/providers.js +1 -1
- package/dist/web/src/concurrency.js +1 -1
- package/dist/web/src/encodings/base64.js +1 -1
- package/dist/web/src/encodings/hex.js +1 -1
- package/dist/web/src/errors.js +1 -1
- package/dist/web/src/index.js +6 -312
- package/dist/web/src/nanoclients.js +280 -0
- package/dist/web/src/nanoindex.js +5 -0
- package/dist/web/src/nanotdf/Client.js +18 -23
- package/dist/web/src/nanotdf/NanoTDF.js +1 -1
- package/dist/web/src/nanotdf/encrypt-dataset.js +1 -1
- package/dist/web/src/nanotdf/encrypt.js +1 -1
- package/dist/web/src/nanotdf/models/Ciphers.js +1 -1
- package/dist/web/src/nanotdf/models/EcCurves.js +1 -1
- package/dist/web/src/nanotdf/models/Header.js +1 -1
- package/dist/web/src/nanotdf/models/Payload.js +1 -1
- package/dist/web/src/nanotdf/models/Policy/AbstractPolicy.js +1 -1
- package/dist/web/src/nanotdf/models/Policy/EmbeddedPolicy.js +1 -1
- package/dist/web/src/nanotdf/models/Policy/PolicyFactory.js +1 -1
- package/dist/web/src/nanotdf/models/ResourceLocator.js +1 -1
- package/dist/web/src/nanotdf/models/Signature.js +1 -1
- package/dist/web/src/nanotdf-crypto/ciphers.js +1 -1
- package/dist/web/src/nanotdf-crypto/ecdsaSignature.js +1 -1
- package/dist/web/src/nanotdf-crypto/generateKeyPair.js +2 -2
- package/dist/web/src/nanotdf-crypto/generateRandomNumber.js +2 -2
- package/dist/web/src/nanotdf-crypto/index.js +3 -4
- package/dist/web/src/nanotdf-crypto/keyAgreement.js +9 -6
- package/dist/web/src/nanotdf-crypto/pemPublicToCrypto.js +1 -1
- package/dist/web/src/opentdf.js +234 -0
- package/dist/web/src/policy/api.js +1 -1
- package/dist/web/src/policy/granter.js +1 -1
- package/dist/web/src/seekable.js +148 -0
- package/dist/web/src/tdf/AttributeObject.js +1 -2
- package/dist/web/src/tdf/Policy.js +2 -4
- package/dist/web/src/utils.js +3 -10
- package/dist/web/src/version.js +6 -2
- package/dist/web/tdf3/index.js +5 -4
- package/dist/web/tdf3/src/assertions.js +21 -6
- package/dist/web/tdf3/src/binary.js +1 -1
- package/dist/web/tdf3/src/ciphers/aes-gcm-cipher.js +1 -1
- package/dist/web/tdf3/src/ciphers/symmetric-cipher-base.js +1 -1
- package/dist/web/tdf3/src/client/DecoratedReadableStream.js +4 -68
- package/dist/web/tdf3/src/client/builders.js +26 -22
- package/dist/web/tdf3/src/client/index.js +74 -105
- package/dist/web/tdf3/src/client/validation.js +1 -1
- package/dist/web/tdf3/src/crypto/crypto-utils.js +1 -1
- package/dist/web/tdf3/src/crypto/index.js +1 -1
- package/dist/web/tdf3/src/index.js +2 -2
- package/dist/web/tdf3/src/models/attribute-set.js +1 -1
- package/dist/web/tdf3/src/models/encryption-information.js +3 -3
- package/dist/web/tdf3/src/models/index.js +1 -2
- package/dist/web/tdf3/src/models/key-access.js +47 -24
- package/dist/web/tdf3/src/models/policy.js +1 -1
- package/dist/web/tdf3/src/tdf.js +153 -371
- package/dist/web/tdf3/src/utils/buffer-crc32.js +1 -1
- package/dist/web/tdf3/src/utils/index.js +19 -14
- package/dist/web/tdf3/src/utils/keysplit.js +1 -1
- package/dist/web/tdf3/src/utils/unwrap.js +18 -0
- package/dist/web/tdf3/src/utils/zip-reader.js +1 -1
- package/dist/web/tdf3/src/utils/zip-writer.js +1 -1
- package/package.json +45 -45
- package/src/access.ts +111 -54
- package/src/auth/auth.ts +1 -31
- package/src/index.ts +5 -440
- package/src/nanoclients.ts +405 -0
- package/src/nanoindex.ts +4 -0
- package/src/nanotdf/Client.ts +18 -25
- package/src/nanotdf/NanoTDF.ts +1 -1
- package/src/nanotdf/encrypt-dataset.ts +1 -1
- package/src/nanotdf/encrypt.ts +1 -1
- package/src/nanotdf/helpers/getHkdfSalt.ts +1 -1
- package/src/nanotdf-crypto/digest.ts +1 -1
- package/src/nanotdf-crypto/generateKeyPair.ts +1 -1
- package/src/nanotdf-crypto/generateRandomNumber.ts +1 -1
- package/src/nanotdf-crypto/index.ts +2 -3
- package/src/nanotdf-crypto/keyAgreement.ts +14 -7
- package/src/opentdf.ts +441 -0
- package/src/seekable.ts +180 -0
- package/src/tdf/AttributeObject.ts +0 -3
- package/src/tdf/Policy.ts +1 -2
- package/src/tdf/PolicyObject.ts +1 -2
- package/src/tdf/TypedArray.ts +1 -3
- package/src/utils.ts +3 -11
- package/src/version.ts +6 -1
- package/tdf3/index.ts +15 -10
- package/tdf3/src/assertions.ts +33 -8
- package/tdf3/src/client/DecoratedReadableStream.ts +3 -80
- package/tdf3/src/client/builders.ts +44 -28
- package/tdf3/src/client/index.ts +109 -165
- package/tdf3/src/index.ts +1 -1
- package/tdf3/src/models/encryption-information.ts +2 -2
- package/tdf3/src/models/index.ts +0 -1
- package/tdf3/src/models/key-access.ts +120 -38
- package/tdf3/src/models/manifest.ts +3 -0
- package/tdf3/src/models/policy.ts +0 -1
- package/tdf3/src/tdf.ts +266 -522
- package/tdf3/src/utils/index.ts +19 -18
- package/tdf3/src/utils/unwrap.ts +17 -0
- package/tdf3/src/utils/zip-reader.ts +1 -1
- package/dist/cjs/src/auth/Eas.js +0 -60
- package/dist/cjs/src/nanotdf-crypto/importRawKey.js +0 -18
- package/dist/cjs/src/tdf/Crypto.js +0 -47
- package/dist/cjs/src/tdf/EntityObject.js +0 -3
- package/dist/cjs/src/tdf/index.js +0 -35
- package/dist/cjs/tdf3/src/models/upsert-response.js +0 -3
- package/dist/cjs/tdf3/src/templates/default.html.js +0 -98
- package/dist/cjs/tdf3/src/templates/escaper.js +0 -15
- package/dist/cjs/tdf3/src/templates/index.js +0 -12
- package/dist/cjs/tdf3/src/utils/chunkers.js +0 -106
- package/dist/cjs/tdf3/src/version.js +0 -6
- package/dist/types/src/auth/Eas.d.ts +0 -34
- package/dist/types/src/auth/Eas.d.ts.map +0 -1
- package/dist/types/src/nanotdf-crypto/importRawKey.d.ts +0 -13
- package/dist/types/src/nanotdf-crypto/importRawKey.d.ts.map +0 -1
- package/dist/types/src/tdf/Crypto.d.ts +0 -37
- package/dist/types/src/tdf/Crypto.d.ts.map +0 -1
- package/dist/types/src/tdf/EntityObject.d.ts +0 -18
- package/dist/types/src/tdf/EntityObject.d.ts.map +0 -1
- package/dist/types/src/tdf/index.d.ts +0 -7
- package/dist/types/src/tdf/index.d.ts.map +0 -1
- package/dist/types/tdf3/src/models/upsert-response.d.ts +0 -16
- package/dist/types/tdf3/src/models/upsert-response.d.ts.map +0 -1
- package/dist/types/tdf3/src/templates/default.html.d.ts +0 -8
- package/dist/types/tdf3/src/templates/default.html.d.ts.map +0 -1
- package/dist/types/tdf3/src/templates/escaper.d.ts +0 -6
- package/dist/types/tdf3/src/templates/escaper.d.ts.map +0 -1
- package/dist/types/tdf3/src/templates/index.d.ts +0 -3
- package/dist/types/tdf3/src/templates/index.d.ts.map +0 -1
- package/dist/types/tdf3/src/utils/chunkers.d.ts +0 -29
- package/dist/types/tdf3/src/utils/chunkers.d.ts.map +0 -1
- package/dist/types/tdf3/src/version.d.ts +0 -3
- package/dist/types/tdf3/src/version.d.ts.map +0 -1
- package/dist/web/src/auth/Eas.js +0 -55
- package/dist/web/src/nanotdf-crypto/importRawKey.js +0 -15
- package/dist/web/src/tdf/Crypto.js +0 -44
- package/dist/web/src/tdf/EntityObject.js +0 -2
- package/dist/web/src/tdf/index.js +0 -4
- package/dist/web/tdf3/src/models/upsert-response.js +0 -2
- package/dist/web/tdf3/src/templates/default.html.js +0 -96
- package/dist/web/tdf3/src/templates/escaper.js +0 -10
- package/dist/web/tdf3/src/templates/index.js +0 -3
- package/dist/web/tdf3/src/utils/chunkers.js +0 -96
- package/dist/web/tdf3/src/version.js +0 -3
- package/src/auth/Eas.ts +0 -79
- package/src/nanotdf-crypto/importRawKey.ts +0 -19
- package/src/tdf/Crypto.ts +0 -42
- package/src/tdf/EntityObject.ts +0 -18
- package/src/tdf/index.ts +0 -6
- package/tdf3/src/models/upsert-response.ts +0 -17
- package/tdf3/src/templates/default.html.ts +0 -105
- package/tdf3/src/templates/escaper.ts +0 -10
- package/tdf3/src/templates/index.ts +0 -2
- package/tdf3/src/utils/chunkers.ts +0 -118
- package/tdf3/src/version.ts +0 -2
package/src/utils.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { type AxiosResponseHeaders, type RawAxiosResponseHeaders } from 'axios';
|
|
2
1
|
import { exportSPKI, importX509 } from 'jose';
|
|
3
2
|
|
|
4
3
|
import { base64 } from './encodings/index.js';
|
|
5
|
-
import { pemCertToCrypto, pemPublicToCrypto } from './nanotdf-crypto/
|
|
4
|
+
import { pemCertToCrypto, pemPublicToCrypto } from './nanotdf-crypto/pemPublicToCrypto.js';
|
|
6
5
|
import { ConfigurationError } from './errors.js';
|
|
7
6
|
|
|
8
7
|
/**
|
|
@@ -46,8 +45,6 @@ export function isBrowser() {
|
|
|
46
45
|
return typeof window !== 'undefined'; // eslint-disable-line
|
|
47
46
|
}
|
|
48
47
|
|
|
49
|
-
export const isFirefox = (): boolean => isBrowser() && 'InstallTrigger' in window;
|
|
50
|
-
|
|
51
48
|
export const rstrip = (str: string, suffix = ' '): string => {
|
|
52
49
|
while (str && suffix && str.endsWith(suffix)) {
|
|
53
50
|
str = str.slice(0, -suffix.length);
|
|
@@ -68,7 +65,7 @@ export const estimateSkew = async (serverEndpoint = window.origin): Promise<numb
|
|
|
68
65
|
return estimateSkewFromHeaders(response.headers, localUnixTimeBefore);
|
|
69
66
|
};
|
|
70
67
|
|
|
71
|
-
export type AnyHeaders =
|
|
68
|
+
export type AnyHeaders = Headers;
|
|
72
69
|
|
|
73
70
|
/**
|
|
74
71
|
* Rough estimate of number of seconds to add to the curren time to get
|
|
@@ -82,12 +79,7 @@ export type AnyHeaders = AxiosResponseHeaders | RawAxiosResponseHeaders | Header
|
|
|
82
79
|
*/
|
|
83
80
|
export const estimateSkewFromHeaders = (headers: AnyHeaders, dateNowBefore?: number): number => {
|
|
84
81
|
const localUnixTimeBefore = (dateNowBefore || Date.now()) / 1000;
|
|
85
|
-
|
|
86
|
-
if (headers.get) {
|
|
87
|
-
serverDateString = (headers as Headers).get('Date');
|
|
88
|
-
} else {
|
|
89
|
-
serverDateString = (headers as AxiosResponseHeaders | RawAxiosResponseHeaders).date;
|
|
90
|
-
}
|
|
82
|
+
const serverDateString = headers.get('Date');
|
|
91
83
|
if (serverDateString === null) {
|
|
92
84
|
throw Error('Cannot get access to Date header!');
|
|
93
85
|
}
|
package/src/version.ts
CHANGED
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Exposes the released version number of the `@opentdf/sdk` package
|
|
3
3
|
*/
|
|
4
|
-
export const version = '0.
|
|
4
|
+
export const version = '0.2.0';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* A string name used to label requests as coming from this library client.
|
|
8
8
|
*/
|
|
9
9
|
export const clientType = 'web-sdk';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Version of the opentdf/spec this library is targeting
|
|
13
|
+
*/
|
|
14
|
+
export const tdfSpecVersion = '4.3.0';
|
package/tdf3/index.ts
CHANGED
|
@@ -25,13 +25,7 @@ import {
|
|
|
25
25
|
SplitKey,
|
|
26
26
|
type EncryptionInformation,
|
|
27
27
|
} from './src/models/encryption-information.js';
|
|
28
|
-
import {
|
|
29
|
-
AuthProvider,
|
|
30
|
-
AppIdAuthProvider,
|
|
31
|
-
type HttpMethod,
|
|
32
|
-
HttpRequest,
|
|
33
|
-
withHeaders,
|
|
34
|
-
} from '../src/auth/auth.js';
|
|
28
|
+
import { AuthProvider, type HttpMethod, HttpRequest, withHeaders } from '../src/auth/auth.js';
|
|
35
29
|
import { AesGcmCipher } from './src/ciphers/aes-gcm-cipher.js';
|
|
36
30
|
import {
|
|
37
31
|
NanoTDFClient,
|
|
@@ -39,9 +33,9 @@ import {
|
|
|
39
33
|
AuthProviders,
|
|
40
34
|
version,
|
|
41
35
|
clientType,
|
|
42
|
-
} from '../src/
|
|
36
|
+
} from '../src/nanoindex.js';
|
|
43
37
|
import { Algorithms, type AlgorithmName, type AlgorithmUrn } from './src/ciphers/algorithms.js';
|
|
44
|
-
import { type Chunker } from '
|
|
38
|
+
import { type Chunker } from '../src/seekable.js';
|
|
45
39
|
|
|
46
40
|
export type {
|
|
47
41
|
AlgorithmName,
|
|
@@ -63,7 +57,6 @@ export type {
|
|
|
63
57
|
export {
|
|
64
58
|
AesGcmCipher,
|
|
65
59
|
Algorithms,
|
|
66
|
-
AppIdAuthProvider,
|
|
67
60
|
AuthProviders,
|
|
68
61
|
Binary,
|
|
69
62
|
Client,
|
|
@@ -89,3 +82,15 @@ export {
|
|
|
89
82
|
};
|
|
90
83
|
|
|
91
84
|
export * as WebCryptoService from './src/crypto/index.js';
|
|
85
|
+
export {
|
|
86
|
+
type CreateNanoTDFCollectionOptions,
|
|
87
|
+
type CreateNanoTDFOptions,
|
|
88
|
+
type CreateOptions,
|
|
89
|
+
type CreateZTDFOptions,
|
|
90
|
+
type DecoratedStream,
|
|
91
|
+
type Keys,
|
|
92
|
+
type OpenTDFOptions,
|
|
93
|
+
type NanoTDFCollection,
|
|
94
|
+
type ReadOptions,
|
|
95
|
+
OpenTDF,
|
|
96
|
+
} from '../src/opentdf.js';
|
package/tdf3/src/assertions.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { type KeyLike, SignJWT, jwtVerify } from 'jose';
|
|
|
3
3
|
import { base64, hex } from '../../src/encodings/index.js';
|
|
4
4
|
import { ConfigurationError, IntegrityError, InvalidFileError } from '../../src/errors.js';
|
|
5
5
|
|
|
6
|
-
export type AssertionKeyAlg = 'RS256' | 'HS256';
|
|
6
|
+
export type AssertionKeyAlg = 'ES256' | 'RS256' | 'HS256';
|
|
7
7
|
export type AssertionType = 'handling' | 'other';
|
|
8
8
|
export type Scope = 'tdo' | 'payload';
|
|
9
9
|
export type AppliesToState = 'encrypted' | 'unencrypted';
|
|
@@ -110,8 +110,9 @@ export function isAssertionConfig(obj: unknown): obj is AssertionConfig {
|
|
|
110
110
|
*/
|
|
111
111
|
export async function verify(
|
|
112
112
|
thiz: Assertion,
|
|
113
|
-
aggregateHash:
|
|
114
|
-
key: AssertionKey
|
|
113
|
+
aggregateHash: Uint8Array,
|
|
114
|
+
key: AssertionKey,
|
|
115
|
+
isLegacyTDF: boolean
|
|
115
116
|
): Promise<void> {
|
|
116
117
|
let payload: AssertionPayload;
|
|
117
118
|
try {
|
|
@@ -126,14 +127,25 @@ export async function verify(
|
|
|
126
127
|
|
|
127
128
|
// Get the hash of the assertion
|
|
128
129
|
const hashOfAssertion = await hash(thiz);
|
|
129
|
-
const combinedHash = aggregateHash + hashOfAssertion;
|
|
130
|
-
const encodedHash = base64.encode(combinedHash);
|
|
131
130
|
|
|
132
131
|
// check if assertionHash is same as hashOfAssertion
|
|
133
132
|
if (hashOfAssertion !== assertionHash) {
|
|
134
133
|
throw new IntegrityError('Assertion hash mismatch');
|
|
135
134
|
}
|
|
136
135
|
|
|
136
|
+
let encodedHash: string;
|
|
137
|
+
if (isLegacyTDF) {
|
|
138
|
+
const aggregateHashAsStr = new TextDecoder('utf-8').decode(aggregateHash);
|
|
139
|
+
const combinedHash = aggregateHashAsStr + hashOfAssertion;
|
|
140
|
+
encodedHash = base64.encode(combinedHash);
|
|
141
|
+
} else {
|
|
142
|
+
const combinedHash = concatenateUint8Arrays(
|
|
143
|
+
aggregateHash,
|
|
144
|
+
new Uint8Array(hex.decodeArrayBuffer(assertionHash))
|
|
145
|
+
);
|
|
146
|
+
encodedHash = base64.encodeArrayBuffer(combinedHash);
|
|
147
|
+
}
|
|
148
|
+
|
|
137
149
|
// check if assertionSig is same as encodedHash
|
|
138
150
|
if (assertionSig !== encodedHash) {
|
|
139
151
|
throw new IntegrityError('Failed integrity check on assertion signature');
|
|
@@ -144,7 +156,7 @@ export async function verify(
|
|
|
144
156
|
* Creates an Assertion object with the specified properties.
|
|
145
157
|
*/
|
|
146
158
|
export async function CreateAssertion(
|
|
147
|
-
aggregateHash:
|
|
159
|
+
aggregateHash: Uint8Array,
|
|
148
160
|
assertionConfig: AssertionConfig
|
|
149
161
|
): Promise<Assertion> {
|
|
150
162
|
if (!assertionConfig.signingKey) {
|
|
@@ -162,8 +174,11 @@ export async function CreateAssertion(
|
|
|
162
174
|
};
|
|
163
175
|
|
|
164
176
|
const assertionHash = await hash(a);
|
|
165
|
-
const combinedHash =
|
|
166
|
-
|
|
177
|
+
const combinedHash = concatenateUint8Arrays(
|
|
178
|
+
aggregateHash,
|
|
179
|
+
new Uint8Array(hex.decodeArrayBuffer(assertionHash))
|
|
180
|
+
);
|
|
181
|
+
const encodedHash = base64.encodeArrayBuffer(combinedHash);
|
|
167
182
|
|
|
168
183
|
return await sign(a, assertionHash, encodedHash, assertionConfig.signingKey);
|
|
169
184
|
}
|
|
@@ -189,3 +204,13 @@ export type AssertionVerificationKeys = {
|
|
|
189
204
|
DefaultKey?: AssertionKey;
|
|
190
205
|
Keys: Record<string, AssertionKey>;
|
|
191
206
|
};
|
|
207
|
+
|
|
208
|
+
function concatenateUint8Arrays(array1: Uint8Array, array2: Uint8Array): Uint8Array {
|
|
209
|
+
const combinedLength = array1.length + array2.length;
|
|
210
|
+
const combinedArray = new Uint8Array(combinedLength);
|
|
211
|
+
|
|
212
|
+
combinedArray.set(array1, 0);
|
|
213
|
+
combinedArray.set(array2, array1.length);
|
|
214
|
+
|
|
215
|
+
return combinedArray;
|
|
216
|
+
}
|
|
@@ -1,11 +1,5 @@
|
|
|
1
|
-
import { EventEmitter } from 'eventemitter3';
|
|
2
|
-
import streamSaver from 'streamsaver';
|
|
3
|
-
import { fileSave } from 'browser-fs-access';
|
|
4
|
-
import { isFirefox } from '../../../src/utils.js';
|
|
5
|
-
|
|
6
1
|
import { type Metadata } from '../tdf.js';
|
|
7
|
-
import { type Manifest
|
|
8
|
-
import { ConfigurationError } from '../../../src/errors.js';
|
|
2
|
+
import { type Manifest } from '../models/index.js';
|
|
9
3
|
|
|
10
4
|
export async function streamToBuffer(stream: ReadableStream<Uint8Array>): Promise<Uint8Array> {
|
|
11
5
|
const accumulator = await new Response(stream).arrayBuffer();
|
|
@@ -24,12 +18,8 @@ export class DecoratedReadableStream {
|
|
|
24
18
|
tdfSize: number;
|
|
25
19
|
fileSize: number | undefined;
|
|
26
20
|
stream: ReadableStream<Uint8Array>;
|
|
27
|
-
ee: EventEmitter;
|
|
28
|
-
on: EventEmitter['on'];
|
|
29
|
-
emit: EventEmitter['emit'];
|
|
30
21
|
metadata?: Metadata;
|
|
31
22
|
manifest: Manifest;
|
|
32
|
-
upsertResponse?: UpsertResponse;
|
|
33
23
|
fileStreamServiceWorker?: string;
|
|
34
24
|
|
|
35
25
|
constructor(
|
|
@@ -43,23 +33,10 @@ export class DecoratedReadableStream {
|
|
|
43
33
|
this.stream = new ReadableStream(underlyingSource, {
|
|
44
34
|
highWaterMark: 1,
|
|
45
35
|
}) as ReadableStream<Uint8Array>;
|
|
46
|
-
this.ee = new EventEmitter();
|
|
47
|
-
this.on = (...args) => this.ee.on(...args);
|
|
48
|
-
this.emit = (...args) => this.ee.emit(...args);
|
|
49
36
|
}
|
|
50
37
|
|
|
51
38
|
async getMetadata() {
|
|
52
|
-
return
|
|
53
|
-
if (this.metadata) {
|
|
54
|
-
resolve(this.metadata);
|
|
55
|
-
} else {
|
|
56
|
-
this.on('error', reject);
|
|
57
|
-
this.on('rewrap', (rewrapResponse: Metadata) => {
|
|
58
|
-
this.metadata = rewrapResponse;
|
|
59
|
-
resolve(rewrapResponse);
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
});
|
|
39
|
+
return this.metadata;
|
|
63
40
|
}
|
|
64
41
|
|
|
65
42
|
/**
|
|
@@ -83,66 +60,12 @@ export class DecoratedReadableStream {
|
|
|
83
60
|
async toString(): Promise<string> {
|
|
84
61
|
return new Response(this.stream).text();
|
|
85
62
|
}
|
|
86
|
-
|
|
87
|
-
/**
|
|
88
|
-
* Dump the stream content to a local file. This will consume the stream.
|
|
89
|
-
*
|
|
90
|
-
* @param filepath The path of the local file to write plaintext to.
|
|
91
|
-
* @param encoding The charset encoding to use. Defaults to utf-8.
|
|
92
|
-
*/
|
|
93
|
-
async toFile(
|
|
94
|
-
filepath = 'download.tdf',
|
|
95
|
-
options?: BufferEncoding | DecoratedReadableStreamSinkOptions
|
|
96
|
-
): Promise<void> {
|
|
97
|
-
if (options && typeof options === 'string') {
|
|
98
|
-
throw new ConfigurationError('unsupported operation: Cannot set encoding in browser');
|
|
99
|
-
}
|
|
100
|
-
if (isFirefox()) {
|
|
101
|
-
await fileSave(new Response(this.stream), {
|
|
102
|
-
fileName: filepath,
|
|
103
|
-
extensions: [`.${filepath.split('.').pop()}`],
|
|
104
|
-
});
|
|
105
|
-
return;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
if (this.fileStreamServiceWorker) {
|
|
109
|
-
streamSaver.mitm = this.fileStreamServiceWorker;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
const fileStream = streamSaver.createWriteStream(filepath, {
|
|
113
|
-
writableStrategy: { highWaterMark: 1 },
|
|
114
|
-
readableStrategy: { highWaterMark: 1 },
|
|
115
|
-
});
|
|
116
|
-
|
|
117
|
-
if (WritableStream) {
|
|
118
|
-
return this.stream.pipeTo(fileStream, options);
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
// Write (pipe) manually
|
|
122
|
-
const reader = this.stream.getReader();
|
|
123
|
-
const writer = fileStream.getWriter();
|
|
124
|
-
const pump = async (): Promise<void> => {
|
|
125
|
-
const res = await reader.read();
|
|
126
|
-
|
|
127
|
-
if (res.done) {
|
|
128
|
-
return await writer.close();
|
|
129
|
-
} else {
|
|
130
|
-
await writer.write(res.value);
|
|
131
|
-
return pump();
|
|
132
|
-
}
|
|
133
|
-
};
|
|
134
|
-
return pump();
|
|
135
|
-
|
|
136
|
-
// const pump = (): Promise<void> =>
|
|
137
|
-
// reader.read().then((res) => (res.done ? writer.close() : writer.write(res.value).then(pump)));
|
|
138
|
-
// pump();
|
|
139
|
-
}
|
|
140
63
|
}
|
|
141
64
|
|
|
142
65
|
export function isDecoratedReadableStream(s: unknown): s is DecoratedReadableStream {
|
|
143
66
|
return (
|
|
67
|
+
typeof (s as DecoratedReadableStream)?.stream !== 'undefined' &&
|
|
144
68
|
typeof (s as DecoratedReadableStream)?.toBuffer !== 'undefined' &&
|
|
145
|
-
typeof (s as DecoratedReadableStream)?.toFile !== 'undefined' &&
|
|
146
69
|
typeof (s as DecoratedReadableStream)?.toString !== 'undefined'
|
|
147
70
|
);
|
|
148
71
|
}
|
|
@@ -5,11 +5,11 @@ import { Binary } from '../binary.js';
|
|
|
5
5
|
|
|
6
6
|
import { ConfigurationError } from '../../../src/errors.js';
|
|
7
7
|
import { PemKeyPair } from '../crypto/declarations.js';
|
|
8
|
-
import { EntityObject } from '../../../src/tdf/EntityObject.js';
|
|
9
8
|
import { DecoratedReadableStream } from './DecoratedReadableStream.js';
|
|
10
|
-
import { type Chunker } from '
|
|
9
|
+
import { type Chunker } from '../../../src/seekable.js';
|
|
11
10
|
import { AssertionConfig, AssertionVerificationKeys } from '../assertions.js';
|
|
12
11
|
import { Value } from '../../../src/policy/attributes.js';
|
|
12
|
+
import { KasPublicKeyAlgorithm, OriginAllowList } from '../../../src/access.js';
|
|
13
13
|
|
|
14
14
|
export const DEFAULT_SEGMENT_SIZE: number = 1024 * 1024;
|
|
15
15
|
export type Scope = {
|
|
@@ -35,27 +35,33 @@ export type SplitStep = {
|
|
|
35
35
|
};
|
|
36
36
|
|
|
37
37
|
export type EncryptParams = {
|
|
38
|
+
byteLimit?: number;
|
|
38
39
|
source: ReadableStream<Uint8Array>;
|
|
39
40
|
opts?: { keypair: PemKeyPair };
|
|
40
41
|
autoconfigure?: boolean;
|
|
41
42
|
scope?: Scope;
|
|
42
43
|
metadata?: Metadata;
|
|
43
44
|
keypair?: CryptoKeyPair;
|
|
44
|
-
offline?: boolean;
|
|
45
45
|
windowSize?: number;
|
|
46
|
-
asHtml?: boolean;
|
|
47
46
|
getPolicyId?: () => Scope['policyId'];
|
|
48
47
|
mimeType?: string;
|
|
49
|
-
eo?: EntityObject;
|
|
50
48
|
payloadKey?: Binary;
|
|
51
49
|
keyMiddleware?: EncryptKeyMiddleware;
|
|
52
50
|
splitPlan?: SplitStep[];
|
|
53
51
|
streamMiddleware?: EncryptStreamMiddleware;
|
|
54
52
|
assertionConfigs?: AssertionConfig[];
|
|
53
|
+
defaultKASEndpoint?: string;
|
|
54
|
+
|
|
55
|
+
// Preferred wrapping key algorithm. Used when KID resolution is not available.
|
|
56
|
+
wrappingKeyAlgorithm?: KasPublicKeyAlgorithm;
|
|
57
|
+
|
|
58
|
+
// Unsupported
|
|
59
|
+
asHtml?: boolean;
|
|
60
|
+
// Unsupported
|
|
61
|
+
offline?: boolean;
|
|
55
62
|
};
|
|
56
63
|
|
|
57
64
|
// 'Readonly<EncryptParams>': scope, metadata, offline, windowSize, asHtml
|
|
58
|
-
|
|
59
65
|
// deep copy is expensive, could be faster is Immer used, but to keep SDK work
|
|
60
66
|
// stable we can just make this object readonly
|
|
61
67
|
function freeze<Type>(obj: Type): Readonly<Type> {
|
|
@@ -76,9 +82,7 @@ class EncryptParamsBuilder {
|
|
|
76
82
|
attributes: [],
|
|
77
83
|
},
|
|
78
84
|
keypair: undefined,
|
|
79
|
-
offline: false,
|
|
80
85
|
windowSize: DEFAULT_SEGMENT_SIZE,
|
|
81
|
-
asHtml: false,
|
|
82
86
|
assertionConfigs: [],
|
|
83
87
|
}
|
|
84
88
|
) {
|
|
@@ -94,6 +98,11 @@ class EncryptParamsBuilder {
|
|
|
94
98
|
* @param {Readable} readStream - a Readable Stream to encrypt.
|
|
95
99
|
*/
|
|
96
100
|
setStreamSource(readStream: ReadableStream<Uint8Array>) {
|
|
101
|
+
if (!readStream?.getReader) {
|
|
102
|
+
throw new ConfigurationError(
|
|
103
|
+
`Source must be a WebReadableStream. Run node streams through stream.Readable.toWeb()`
|
|
104
|
+
);
|
|
105
|
+
}
|
|
97
106
|
this._params.source = readStream;
|
|
98
107
|
}
|
|
99
108
|
|
|
@@ -118,6 +127,9 @@ class EncryptParamsBuilder {
|
|
|
118
127
|
* @param {string} string - a string to encrypt.
|
|
119
128
|
*/
|
|
120
129
|
setStringSource(string: string) {
|
|
130
|
+
if (!(string && typeof string === 'string')) {
|
|
131
|
+
throw new ConfigurationError('StringSource must be a string');
|
|
132
|
+
}
|
|
121
133
|
const stream = new ReadableStream({
|
|
122
134
|
pull(controller) {
|
|
123
135
|
controller.enqueue(new TextEncoder().encode(string));
|
|
@@ -383,37 +395,24 @@ class EncryptParamsBuilder {
|
|
|
383
395
|
}
|
|
384
396
|
|
|
385
397
|
/**
|
|
386
|
-
*
|
|
387
|
-
* double click and read using the Virtru Secure Reader, at the cost of reduced space efficiency.
|
|
388
|
-
* <br/><br/>
|
|
389
|
-
* This is enabled by default.
|
|
390
|
-
* @return {boolean} true if the encrypted data will be in html format.
|
|
398
|
+
* @deprecated This feature is not supported
|
|
391
399
|
*/
|
|
392
400
|
hasHtmlFormat(): boolean {
|
|
393
|
-
return
|
|
401
|
+
return false;
|
|
394
402
|
}
|
|
395
403
|
|
|
396
404
|
/**
|
|
397
|
-
*
|
|
398
|
-
* double click and read using the Virtru Secure Reader, at the cost of reduced space efficiency.
|
|
399
|
-
* <br/><br/>
|
|
400
|
-
* This is enabled by default.
|
|
405
|
+
* @deprecated This feature is not supported
|
|
401
406
|
*/
|
|
402
407
|
setHtmlFormat() {
|
|
403
|
-
|
|
408
|
+
throw new ConfigurationError('HTML format is not supported');
|
|
404
409
|
}
|
|
405
410
|
|
|
406
411
|
/**
|
|
407
|
-
*
|
|
408
|
-
* double click and read using the Virtru Secure Reader, at the cost of reduced space efficiency.
|
|
409
|
-
* Returns this object for method chaining.
|
|
410
|
-
* <br/><br/>
|
|
411
|
-
* This is enabled by default.
|
|
412
|
-
* @return {EncryptParamsBuilder} - this object.
|
|
412
|
+
* @deprecated This feature is not supported
|
|
413
413
|
*/
|
|
414
414
|
withHtmlFormat(): EncryptParamsBuilder {
|
|
415
|
-
|
|
416
|
-
return this;
|
|
415
|
+
throw new ConfigurationError('HTML format is not supported');
|
|
417
416
|
}
|
|
418
417
|
|
|
419
418
|
/**
|
|
@@ -514,13 +513,14 @@ export type DecryptSource =
|
|
|
514
513
|
| { type: 'file-browser'; location: Blob };
|
|
515
514
|
|
|
516
515
|
export type DecryptParams = {
|
|
517
|
-
eo?: EntityObject;
|
|
518
516
|
source: DecryptSource;
|
|
517
|
+
allowList?: OriginAllowList;
|
|
519
518
|
keyMiddleware?: DecryptKeyMiddleware;
|
|
520
519
|
streamMiddleware?: DecryptStreamMiddleware;
|
|
521
520
|
assertionVerificationKeys?: AssertionVerificationKeys;
|
|
522
521
|
concurrencyLimit?: number;
|
|
523
522
|
noVerifyAssertions?: boolean;
|
|
523
|
+
wrappingKeyAlgorithm?: KasPublicKeyAlgorithm;
|
|
524
524
|
};
|
|
525
525
|
|
|
526
526
|
/**
|
|
@@ -639,6 +639,9 @@ class DecryptParamsBuilder {
|
|
|
639
639
|
* @param source (node) the path of the local file to decrypt, or the Blob (browser/node)
|
|
640
640
|
*/
|
|
641
641
|
setFileSource(source: Blob) {
|
|
642
|
+
if (!(source instanceof Blob)) {
|
|
643
|
+
throw new ConfigurationError('File source must be a Blob');
|
|
644
|
+
}
|
|
642
645
|
this._params.source = { type: 'file-browser', location: source };
|
|
643
646
|
}
|
|
644
647
|
|
|
@@ -682,6 +685,19 @@ class DecryptParamsBuilder {
|
|
|
682
685
|
return this;
|
|
683
686
|
}
|
|
684
687
|
|
|
688
|
+
/**
|
|
689
|
+
* Sets the assertion verification keys for the decryption parameters.
|
|
690
|
+
*
|
|
691
|
+
* @param {AssertionVerificationKeys} assertionVerificationKeys - An array of assertion configurations to be set.
|
|
692
|
+
* @returns {DecryptParamsBuilder} The current instance of the EncryptParamsBuilder for method chaining.
|
|
693
|
+
*/
|
|
694
|
+
withAssertionVerificationKeys(
|
|
695
|
+
assertionVerificationKeys: AssertionVerificationKeys
|
|
696
|
+
): DecryptParamsBuilder {
|
|
697
|
+
this._params.assertionVerificationKeys = assertionVerificationKeys;
|
|
698
|
+
return this;
|
|
699
|
+
}
|
|
700
|
+
|
|
685
701
|
_deepCopy(_params: DecryptParams) {
|
|
686
702
|
return freeze({ ..._params });
|
|
687
703
|
}
|