@fgv/ts-web-extras 5.1.0-17 → 5.1.0-19

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.
Files changed (70) hide show
  1. package/.rush/temp/{edc66e6a37414a0b69e52d768684c18c9d5825e3.tar.log → 42a7a953924ae898114e7b6231a2408228d92433.tar.log} +8 -2
  2. package/.rush/temp/chunked-rush-logs/ts-web-extras.build.chunks.jsonl +19 -17
  3. package/.rush/temp/operation/build/all.log +19 -17
  4. package/.rush/temp/operation/build/log-chunks.jsonl +19 -17
  5. package/.rush/temp/operation/build/state.json +1 -1
  6. package/dist/packlets/crypto-utils/browserCryptoProvider.js +176 -18
  7. package/dist/packlets/crypto-utils/browserCryptoProvider.js.map +1 -1
  8. package/dist/test/unit/browserCryptoProvider.wrapBytes.test.js +221 -0
  9. package/dist/test/unit/browserCryptoProvider.wrapBytes.test.js.map +1 -0
  10. package/dist/ts-web-extras.d.ts +46 -6
  11. package/docs/CryptoUtils/classes/BrowserCryptoProvider.exportPublicKeyJwk.md +24 -0
  12. package/docs/CryptoUtils/classes/BrowserCryptoProvider.generateKeyPair.md +25 -0
  13. package/docs/CryptoUtils/classes/BrowserCryptoProvider.importPublicKeyJwk.md +25 -0
  14. package/docs/CryptoUtils/classes/BrowserCryptoProvider.md +67 -0
  15. package/docs/CryptoUtils/classes/BrowserCryptoProvider.unwrapBytes.md +27 -0
  16. package/docs/CryptoUtils/classes/BrowserCryptoProvider.wrapBytes.md +28 -0
  17. package/docs/classes/BrowserCryptoProvider.exportPublicKeyJwk.md +24 -0
  18. package/docs/classes/BrowserCryptoProvider.generateKeyPair.md +25 -0
  19. package/docs/classes/BrowserCryptoProvider.importPublicKeyJwk.md +25 -0
  20. package/docs/classes/BrowserCryptoProvider.md +67 -0
  21. package/docs/classes/BrowserCryptoProvider.unwrapBytes.md +27 -0
  22. package/docs/classes/BrowserCryptoProvider.wrapBytes.md +28 -0
  23. package/etc/ts-web-extras.api.md +10 -5
  24. package/lib/packlets/crypto-utils/browserCryptoProvider.d.ts +46 -5
  25. package/lib/packlets/crypto-utils/browserCryptoProvider.d.ts.map +1 -1
  26. package/lib/packlets/crypto-utils/browserCryptoProvider.js +175 -17
  27. package/lib/packlets/crypto-utils/browserCryptoProvider.js.map +1 -1
  28. package/lib/test/unit/browserCryptoProvider.wrapBytes.test.d.ts +2 -0
  29. package/lib/test/unit/browserCryptoProvider.wrapBytes.test.d.ts.map +1 -0
  30. package/lib/test/unit/browserCryptoProvider.wrapBytes.test.js +223 -0
  31. package/lib/test/unit/browserCryptoProvider.wrapBytes.test.js.map +1 -0
  32. package/package.json +14 -14
  33. package/rush-logs/ts-web-extras.build.cache.log +1 -1
  34. package/rush-logs/ts-web-extras.build.log +19 -17
  35. package/src/packlets/crypto-utils/browserCryptoProvider.ts +244 -23
  36. package/src/test/unit/browserCryptoProvider.wrapBytes.test.ts +325 -0
  37. package/temp/build/typescript/ts_8nwakTlr.json +1 -1
  38. package/temp/coverage/crypto-utils/browserCryptoProvider.ts.html +692 -29
  39. package/temp/coverage/crypto-utils/browserHashProvider.ts.html +1 -1
  40. package/temp/coverage/crypto-utils/index.html +9 -9
  41. package/temp/coverage/file-tree/directoryHandleStore.ts.html +1 -1
  42. package/temp/coverage/file-tree/fileApiTreeAccessors.ts.html +1 -1
  43. package/temp/coverage/file-tree/fileSystemAccessTreeAccessors.ts.html +1 -1
  44. package/temp/coverage/file-tree/httpTreeAccessors.ts.html +1 -1
  45. package/temp/coverage/file-tree/index.html +1 -1
  46. package/temp/coverage/file-tree/localStorageTreeAccessors.ts.html +1 -1
  47. package/temp/coverage/helpers/fileTreeHelpers.ts.html +1 -1
  48. package/temp/coverage/helpers/index.html +1 -1
  49. package/temp/coverage/index.html +10 -10
  50. package/temp/coverage/lcov-report/crypto-utils/browserCryptoProvider.ts.html +692 -29
  51. package/temp/coverage/lcov-report/crypto-utils/browserHashProvider.ts.html +1 -1
  52. package/temp/coverage/lcov-report/crypto-utils/index.html +9 -9
  53. package/temp/coverage/lcov-report/file-tree/directoryHandleStore.ts.html +1 -1
  54. package/temp/coverage/lcov-report/file-tree/fileApiTreeAccessors.ts.html +1 -1
  55. package/temp/coverage/lcov-report/file-tree/fileSystemAccessTreeAccessors.ts.html +1 -1
  56. package/temp/coverage/lcov-report/file-tree/httpTreeAccessors.ts.html +1 -1
  57. package/temp/coverage/lcov-report/file-tree/index.html +1 -1
  58. package/temp/coverage/lcov-report/file-tree/localStorageTreeAccessors.ts.html +1 -1
  59. package/temp/coverage/lcov-report/helpers/fileTreeHelpers.ts.html +1 -1
  60. package/temp/coverage/lcov-report/helpers/index.html +1 -1
  61. package/temp/coverage/lcov-report/index.html +10 -10
  62. package/temp/coverage/lcov-report/url-utils/index.html +1 -1
  63. package/temp/coverage/lcov-report/url-utils/urlParams.ts.html +1 -1
  64. package/temp/coverage/lcov.info +294 -23
  65. package/temp/coverage/url-utils/index.html +1 -1
  66. package/temp/coverage/url-utils/urlParams.ts.html +1 -1
  67. package/temp/test/jest/haste-map-7492f1b44480e0cdd1f220078fb3afd8-c8dd6c3430605adeb2f1cadf4f75e791-8c9336785555d572065b28c111982ba4 +0 -0
  68. package/temp/test/jest/perf-cache-7492f1b44480e0cdd1f220078fb3afd8-da39a3ee5e6b4b0d3255bfef95601890 +1 -1
  69. package/temp/ts-web-extras.api.json +465 -4
  70. package/temp/ts-web-extras.api.md +10 -5
@@ -209,8 +209,8 @@
209
209
  },
210
210
  {
211
211
  "kind": "Reference",
212
- "text": "ICryptoProvider",
213
- "canonicalReference": "@fgv/ts-web-extras!~ICryptoProvider:type"
212
+ "text": "CryptoUtils.ICryptoProvider",
213
+ "canonicalReference": "@fgv/ts-extras!ICryptoProvider:interface"
214
214
  },
215
215
  {
216
216
  "kind": "Content",
@@ -520,8 +520,8 @@
520
520
  },
521
521
  {
522
522
  "kind": "Reference",
523
- "text": "IEncryptionResult",
524
- "canonicalReference": "@fgv/ts-web-extras!~IEncryptionResult:type"
523
+ "text": "CryptoUtils.IEncryptionResult",
524
+ "canonicalReference": "@fgv/ts-extras!IEncryptionResult:interface"
525
525
  },
526
526
  {
527
527
  "kind": "Content",
@@ -562,6 +562,78 @@
562
562
  "isAbstract": false,
563
563
  "name": "encrypt"
564
564
  },
565
+ {
566
+ "kind": "Method",
567
+ "canonicalReference": "@fgv/ts-web-extras!CryptoUtils.BrowserCryptoProvider#exportPublicKeyJwk:member(1)",
568
+ "docComment": "/**\n * Exports a public `CryptoKey` as a JSON Web Key.\n *\n * @remarks\n *\n * Rejects non-public keys at runtime. WebCrypto's `exportKey('jwk', ...)` does not enforce public-vs-private; without this guard a caller that passed an extractable private key would receive its private fields (`d`, `p`, `q`, ...) as JWK, defeating the method's name.\n *\n * @param publicKey - Extractable public key to export.\n *\n * @returns `Success` with the JWK, or `Failure` if not a public key or if export fails.\n */\n",
569
+ "excerptTokens": [
570
+ {
571
+ "kind": "Content",
572
+ "text": "exportPublicKeyJwk(publicKey: "
573
+ },
574
+ {
575
+ "kind": "Reference",
576
+ "text": "CryptoKey",
577
+ "canonicalReference": "!CryptoKey:interface"
578
+ },
579
+ {
580
+ "kind": "Content",
581
+ "text": "): "
582
+ },
583
+ {
584
+ "kind": "Reference",
585
+ "text": "Promise",
586
+ "canonicalReference": "!Promise:interface"
587
+ },
588
+ {
589
+ "kind": "Content",
590
+ "text": "<"
591
+ },
592
+ {
593
+ "kind": "Reference",
594
+ "text": "Result",
595
+ "canonicalReference": "@fgv/ts-utils!Result:type"
596
+ },
597
+ {
598
+ "kind": "Content",
599
+ "text": "<"
600
+ },
601
+ {
602
+ "kind": "Reference",
603
+ "text": "JsonWebKey",
604
+ "canonicalReference": "!JsonWebKey:interface"
605
+ },
606
+ {
607
+ "kind": "Content",
608
+ "text": ">>"
609
+ },
610
+ {
611
+ "kind": "Content",
612
+ "text": ";"
613
+ }
614
+ ],
615
+ "isStatic": false,
616
+ "returnTypeTokenRange": {
617
+ "startIndex": 3,
618
+ "endIndex": 9
619
+ },
620
+ "releaseTag": "Public",
621
+ "isProtected": false,
622
+ "overloadIndex": 1,
623
+ "parameters": [
624
+ {
625
+ "parameterName": "publicKey",
626
+ "parameterTypeTokenRange": {
627
+ "startIndex": 1,
628
+ "endIndex": 2
629
+ },
630
+ "isOptional": false
631
+ }
632
+ ],
633
+ "isOptional": false,
634
+ "isAbstract": false,
635
+ "name": "exportPublicKeyJwk"
636
+ },
565
637
  {
566
638
  "kind": "Method",
567
639
  "canonicalReference": "@fgv/ts-web-extras!CryptoUtils.BrowserCryptoProvider#fromBase64:member(1)",
@@ -678,6 +750,94 @@
678
750
  "isAbstract": false,
679
751
  "name": "generateKey"
680
752
  },
753
+ {
754
+ "kind": "Method",
755
+ "canonicalReference": "@fgv/ts-web-extras!CryptoUtils.BrowserCryptoProvider#generateKeyPair:member(1)",
756
+ "docComment": "/**\n * Generates a new asymmetric keypair via Web Crypto.\n *\n * @param algorithm - The algorithm to use.\n *\n * @param extractable - Whether the resulting keys may be exported.\n *\n * @returns `Success` with the generated `CryptoKeyPair`, or `Failure` with an error.\n */\n",
757
+ "excerptTokens": [
758
+ {
759
+ "kind": "Content",
760
+ "text": "generateKeyPair(algorithm: "
761
+ },
762
+ {
763
+ "kind": "Reference",
764
+ "text": "CryptoUtils.KeyPairAlgorithm",
765
+ "canonicalReference": "@fgv/ts-extras!KeyPairAlgorithm:type"
766
+ },
767
+ {
768
+ "kind": "Content",
769
+ "text": ", extractable: "
770
+ },
771
+ {
772
+ "kind": "Content",
773
+ "text": "boolean"
774
+ },
775
+ {
776
+ "kind": "Content",
777
+ "text": "): "
778
+ },
779
+ {
780
+ "kind": "Reference",
781
+ "text": "Promise",
782
+ "canonicalReference": "!Promise:interface"
783
+ },
784
+ {
785
+ "kind": "Content",
786
+ "text": "<"
787
+ },
788
+ {
789
+ "kind": "Reference",
790
+ "text": "Result",
791
+ "canonicalReference": "@fgv/ts-utils!Result:type"
792
+ },
793
+ {
794
+ "kind": "Content",
795
+ "text": "<"
796
+ },
797
+ {
798
+ "kind": "Reference",
799
+ "text": "CryptoKeyPair",
800
+ "canonicalReference": "!CryptoKeyPair:interface"
801
+ },
802
+ {
803
+ "kind": "Content",
804
+ "text": ">>"
805
+ },
806
+ {
807
+ "kind": "Content",
808
+ "text": ";"
809
+ }
810
+ ],
811
+ "isStatic": false,
812
+ "returnTypeTokenRange": {
813
+ "startIndex": 5,
814
+ "endIndex": 11
815
+ },
816
+ "releaseTag": "Public",
817
+ "isProtected": false,
818
+ "overloadIndex": 1,
819
+ "parameters": [
820
+ {
821
+ "parameterName": "algorithm",
822
+ "parameterTypeTokenRange": {
823
+ "startIndex": 1,
824
+ "endIndex": 2
825
+ },
826
+ "isOptional": false
827
+ },
828
+ {
829
+ "parameterName": "extractable",
830
+ "parameterTypeTokenRange": {
831
+ "startIndex": 3,
832
+ "endIndex": 4
833
+ },
834
+ "isOptional": false
835
+ }
836
+ ],
837
+ "isOptional": false,
838
+ "isAbstract": false,
839
+ "name": "generateKeyPair"
840
+ },
681
841
  {
682
842
  "kind": "Method",
683
843
  "canonicalReference": "@fgv/ts-web-extras!CryptoUtils.BrowserCryptoProvider#generateRandomBytes:member(1)",
@@ -740,6 +900,95 @@
740
900
  "isAbstract": false,
741
901
  "name": "generateRandomBytes"
742
902
  },
903
+ {
904
+ "kind": "Method",
905
+ "canonicalReference": "@fgv/ts-web-extras!CryptoUtils.BrowserCryptoProvider#importPublicKeyJwk:member(1)",
906
+ "docComment": "/**\n * Imports a public-key JWK as a `CryptoKey` for the requested algorithm.\n *\n * @param jwk - The JSON Web Key produced by a prior export.\n *\n * @param algorithm - The algorithm the key was generated for.\n *\n * @returns `Success` with the imported public `CryptoKey`, or `Failure` with an error.\n */\n",
907
+ "excerptTokens": [
908
+ {
909
+ "kind": "Content",
910
+ "text": "importPublicKeyJwk(jwk: "
911
+ },
912
+ {
913
+ "kind": "Reference",
914
+ "text": "JsonWebKey",
915
+ "canonicalReference": "!JsonWebKey:interface"
916
+ },
917
+ {
918
+ "kind": "Content",
919
+ "text": ", algorithm: "
920
+ },
921
+ {
922
+ "kind": "Reference",
923
+ "text": "CryptoUtils.KeyPairAlgorithm",
924
+ "canonicalReference": "@fgv/ts-extras!KeyPairAlgorithm:type"
925
+ },
926
+ {
927
+ "kind": "Content",
928
+ "text": "): "
929
+ },
930
+ {
931
+ "kind": "Reference",
932
+ "text": "Promise",
933
+ "canonicalReference": "!Promise:interface"
934
+ },
935
+ {
936
+ "kind": "Content",
937
+ "text": "<"
938
+ },
939
+ {
940
+ "kind": "Reference",
941
+ "text": "Result",
942
+ "canonicalReference": "@fgv/ts-utils!Result:type"
943
+ },
944
+ {
945
+ "kind": "Content",
946
+ "text": "<"
947
+ },
948
+ {
949
+ "kind": "Reference",
950
+ "text": "CryptoKey",
951
+ "canonicalReference": "!CryptoKey:interface"
952
+ },
953
+ {
954
+ "kind": "Content",
955
+ "text": ">>"
956
+ },
957
+ {
958
+ "kind": "Content",
959
+ "text": ";"
960
+ }
961
+ ],
962
+ "isStatic": false,
963
+ "returnTypeTokenRange": {
964
+ "startIndex": 5,
965
+ "endIndex": 11
966
+ },
967
+ "releaseTag": "Public",
968
+ "isProtected": false,
969
+ "overloadIndex": 1,
970
+ "parameters": [
971
+ {
972
+ "parameterName": "jwk",
973
+ "parameterTypeTokenRange": {
974
+ "startIndex": 1,
975
+ "endIndex": 2
976
+ },
977
+ "isOptional": false
978
+ },
979
+ {
980
+ "parameterName": "algorithm",
981
+ "parameterTypeTokenRange": {
982
+ "startIndex": 3,
983
+ "endIndex": 4
984
+ },
985
+ "isOptional": false
986
+ }
987
+ ],
988
+ "isOptional": false,
989
+ "isAbstract": false,
990
+ "name": "importPublicKeyJwk"
991
+ },
743
992
  {
744
993
  "kind": "Method",
745
994
  "canonicalReference": "@fgv/ts-web-extras!CryptoUtils.BrowserCryptoProvider#sha256:member(1)",
@@ -850,6 +1099,218 @@
850
1099
  "isOptional": false,
851
1100
  "isAbstract": false,
852
1101
  "name": "toBase64"
1102
+ },
1103
+ {
1104
+ "kind": "Method",
1105
+ "canonicalReference": "@fgv/ts-web-extras!CryptoUtils.BrowserCryptoProvider#unwrapBytes:member(1)",
1106
+ "docComment": "/**\n * Unwraps a payload produced by `wrapBytes` using the recipient's private key. See {@link CryptoUtils.ICryptoProvider.unwrapBytes | ICryptoProvider.unwrapBytes}.\n *\n * @param wrapped - The wrapped payload.\n *\n * @param recipientPrivateKey - The recipient's ECDH P-256 private `CryptoKey`.\n *\n * @param options - HKDF salt and info matching the wrap call.\n *\n * @returns `Success` with the original `plaintext`, or `Failure` with an error.\n */\n",
1107
+ "excerptTokens": [
1108
+ {
1109
+ "kind": "Content",
1110
+ "text": "unwrapBytes(wrapped: "
1111
+ },
1112
+ {
1113
+ "kind": "Reference",
1114
+ "text": "CryptoUtils.IWrappedBytes",
1115
+ "canonicalReference": "@fgv/ts-extras!IWrappedBytes:interface"
1116
+ },
1117
+ {
1118
+ "kind": "Content",
1119
+ "text": ", recipientPrivateKey: "
1120
+ },
1121
+ {
1122
+ "kind": "Reference",
1123
+ "text": "CryptoKey",
1124
+ "canonicalReference": "!CryptoKey:interface"
1125
+ },
1126
+ {
1127
+ "kind": "Content",
1128
+ "text": ", options: "
1129
+ },
1130
+ {
1131
+ "kind": "Reference",
1132
+ "text": "CryptoUtils.IWrapBytesOptions",
1133
+ "canonicalReference": "@fgv/ts-extras!IWrapBytesOptions:interface"
1134
+ },
1135
+ {
1136
+ "kind": "Content",
1137
+ "text": "): "
1138
+ },
1139
+ {
1140
+ "kind": "Reference",
1141
+ "text": "Promise",
1142
+ "canonicalReference": "!Promise:interface"
1143
+ },
1144
+ {
1145
+ "kind": "Content",
1146
+ "text": "<"
1147
+ },
1148
+ {
1149
+ "kind": "Reference",
1150
+ "text": "Result",
1151
+ "canonicalReference": "@fgv/ts-utils!Result:type"
1152
+ },
1153
+ {
1154
+ "kind": "Content",
1155
+ "text": "<"
1156
+ },
1157
+ {
1158
+ "kind": "Reference",
1159
+ "text": "Uint8Array",
1160
+ "canonicalReference": "!Uint8Array:interface"
1161
+ },
1162
+ {
1163
+ "kind": "Content",
1164
+ "text": ">>"
1165
+ },
1166
+ {
1167
+ "kind": "Content",
1168
+ "text": ";"
1169
+ }
1170
+ ],
1171
+ "isStatic": false,
1172
+ "returnTypeTokenRange": {
1173
+ "startIndex": 7,
1174
+ "endIndex": 13
1175
+ },
1176
+ "releaseTag": "Public",
1177
+ "isProtected": false,
1178
+ "overloadIndex": 1,
1179
+ "parameters": [
1180
+ {
1181
+ "parameterName": "wrapped",
1182
+ "parameterTypeTokenRange": {
1183
+ "startIndex": 1,
1184
+ "endIndex": 2
1185
+ },
1186
+ "isOptional": false
1187
+ },
1188
+ {
1189
+ "parameterName": "recipientPrivateKey",
1190
+ "parameterTypeTokenRange": {
1191
+ "startIndex": 3,
1192
+ "endIndex": 4
1193
+ },
1194
+ "isOptional": false
1195
+ },
1196
+ {
1197
+ "parameterName": "options",
1198
+ "parameterTypeTokenRange": {
1199
+ "startIndex": 5,
1200
+ "endIndex": 6
1201
+ },
1202
+ "isOptional": false
1203
+ }
1204
+ ],
1205
+ "isOptional": false,
1206
+ "isAbstract": false,
1207
+ "name": "unwrapBytes"
1208
+ },
1209
+ {
1210
+ "kind": "Method",
1211
+ "canonicalReference": "@fgv/ts-web-extras!CryptoUtils.BrowserCryptoProvider#wrapBytes:member(1)",
1212
+ "docComment": "/**\n * Wraps `plaintext` for the holder of `recipientPublicKey` using ECIES (ECDH P-256 + HKDF-SHA256 + AES-GCM-256). See {@link CryptoUtils.ICryptoProvider.wrapBytes | ICryptoProvider.wrapBytes}.\n *\n * @param plaintext - The bytes to wrap.\n *\n * @param recipientPublicKey - The recipient's ECDH P-256 public `CryptoKey`.\n *\n * @param options - HKDF salt and info; see {@link CryptoUtils.IWrapBytesOptions | IWrapBytesOptions}.\n *\n * @returns `Success` with the wrapped payload, or `Failure` with an error.\n */\n",
1213
+ "excerptTokens": [
1214
+ {
1215
+ "kind": "Content",
1216
+ "text": "wrapBytes(plaintext: "
1217
+ },
1218
+ {
1219
+ "kind": "Reference",
1220
+ "text": "Uint8Array",
1221
+ "canonicalReference": "!Uint8Array:interface"
1222
+ },
1223
+ {
1224
+ "kind": "Content",
1225
+ "text": ", recipientPublicKey: "
1226
+ },
1227
+ {
1228
+ "kind": "Reference",
1229
+ "text": "CryptoKey",
1230
+ "canonicalReference": "!CryptoKey:interface"
1231
+ },
1232
+ {
1233
+ "kind": "Content",
1234
+ "text": ", options: "
1235
+ },
1236
+ {
1237
+ "kind": "Reference",
1238
+ "text": "CryptoUtils.IWrapBytesOptions",
1239
+ "canonicalReference": "@fgv/ts-extras!IWrapBytesOptions:interface"
1240
+ },
1241
+ {
1242
+ "kind": "Content",
1243
+ "text": "): "
1244
+ },
1245
+ {
1246
+ "kind": "Reference",
1247
+ "text": "Promise",
1248
+ "canonicalReference": "!Promise:interface"
1249
+ },
1250
+ {
1251
+ "kind": "Content",
1252
+ "text": "<"
1253
+ },
1254
+ {
1255
+ "kind": "Reference",
1256
+ "text": "Result",
1257
+ "canonicalReference": "@fgv/ts-utils!Result:type"
1258
+ },
1259
+ {
1260
+ "kind": "Content",
1261
+ "text": "<"
1262
+ },
1263
+ {
1264
+ "kind": "Reference",
1265
+ "text": "CryptoUtils.IWrappedBytes",
1266
+ "canonicalReference": "@fgv/ts-extras!IWrappedBytes:interface"
1267
+ },
1268
+ {
1269
+ "kind": "Content",
1270
+ "text": ">>"
1271
+ },
1272
+ {
1273
+ "kind": "Content",
1274
+ "text": ";"
1275
+ }
1276
+ ],
1277
+ "isStatic": false,
1278
+ "returnTypeTokenRange": {
1279
+ "startIndex": 7,
1280
+ "endIndex": 13
1281
+ },
1282
+ "releaseTag": "Public",
1283
+ "isProtected": false,
1284
+ "overloadIndex": 1,
1285
+ "parameters": [
1286
+ {
1287
+ "parameterName": "plaintext",
1288
+ "parameterTypeTokenRange": {
1289
+ "startIndex": 1,
1290
+ "endIndex": 2
1291
+ },
1292
+ "isOptional": false
1293
+ },
1294
+ {
1295
+ "parameterName": "recipientPublicKey",
1296
+ "parameterTypeTokenRange": {
1297
+ "startIndex": 3,
1298
+ "endIndex": 4
1299
+ },
1300
+ "isOptional": false
1301
+ },
1302
+ {
1303
+ "parameterName": "options",
1304
+ "parameterTypeTokenRange": {
1305
+ "startIndex": 5,
1306
+ "endIndex": 6
1307
+ },
1308
+ "isOptional": false
1309
+ }
1310
+ ],
1311
+ "isOptional": false,
1312
+ "isAbstract": false,
1313
+ "name": "wrapBytes"
853
1314
  }
854
1315
  ],
855
1316
  "implementsTokenRanges": [
@@ -10,21 +10,26 @@ import { FileTree } from '@fgv/ts-json-base';
10
10
  import { Logging } from '@fgv/ts-utils';
11
11
  import { Result } from '@fgv/ts-utils';
12
12
 
13
- // Warning: (ae-forgotten-export) The symbol "ICryptoProvider" needs to be exported by the entry point index.d.ts
14
- //
15
13
  // @public
16
- class BrowserCryptoProvider implements ICryptoProvider {
14
+ class BrowserCryptoProvider implements CryptoUtils_2.ICryptoProvider {
17
15
  // Warning: (ae-unresolved-link) The @link reference could not be resolved: This type of declaration is not supported yet by the resolver
18
16
  constructor(cryptoApi?: Crypto);
19
17
  decrypt(encryptedData: Uint8Array, key: Uint8Array, iv: Uint8Array, authTag: Uint8Array): Promise<Result<string>>;
20
18
  deriveKey(password: string, salt: Uint8Array, iterations: number): Promise<Result<Uint8Array>>;
21
- // Warning: (ae-forgotten-export) The symbol "IEncryptionResult" needs to be exported by the entry point index.d.ts
22
- encrypt(plaintext: string, key: Uint8Array): Promise<Result<IEncryptionResult>>;
19
+ encrypt(plaintext: string, key: Uint8Array): Promise<Result<CryptoUtils_2.IEncryptionResult>>;
20
+ exportPublicKeyJwk(publicKey: CryptoKey): Promise<Result<JsonWebKey>>;
23
21
  fromBase64(base64: string): Result<Uint8Array>;
24
22
  generateKey(): Promise<Result<Uint8Array>>;
23
+ generateKeyPair(algorithm: CryptoUtils_2.KeyPairAlgorithm, extractable: boolean): Promise<Result<CryptoKeyPair>>;
25
24
  generateRandomBytes(length: number): Result<Uint8Array>;
25
+ importPublicKeyJwk(jwk: JsonWebKey, algorithm: CryptoUtils_2.KeyPairAlgorithm): Promise<Result<CryptoKey>>;
26
26
  sha256(data: string): Promise<Result<string>>;
27
27
  toBase64(data: Uint8Array): string;
28
+ // Warning: (ae-unresolved-link) The @link reference could not be resolved: This type of declaration is not supported yet by the resolver
29
+ unwrapBytes(wrapped: CryptoUtils_2.IWrappedBytes, recipientPrivateKey: CryptoKey, options: CryptoUtils_2.IWrapBytesOptions): Promise<Result<Uint8Array>>;
30
+ // Warning: (ae-unresolved-link) The @link reference could not be resolved: This type of declaration is not supported yet by the resolver
31
+ // Warning: (ae-unresolved-link) The @link reference could not be resolved: This type of declaration is not supported yet by the resolver
32
+ wrapBytes(plaintext: Uint8Array, recipientPublicKey: CryptoKey, options: CryptoUtils_2.IWrapBytesOptions): Promise<Result<CryptoUtils_2.IWrappedBytes>>;
28
33
  }
29
34
 
30
35
  // @public