@twin.org/web 0.0.1-next.5 → 0.0.1-next.50

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 (33) hide show
  1. package/dist/cjs/index.cjs +271 -96
  2. package/dist/esm/index.mjs +272 -98
  3. package/dist/types/index.d.ts +3 -1
  4. package/dist/types/models/IJwk.d.ts +2 -58
  5. package/dist/types/models/IJwtHeader.d.ts +2 -18
  6. package/dist/types/models/IJwtPayload.d.ts +2 -33
  7. package/dist/types/models/headerTypes.d.ts +8 -8
  8. package/dist/types/models/jwkCryptoKey.d.ts +4 -0
  9. package/dist/types/models/mimeTypes.d.ts +4 -0
  10. package/dist/types/utils/fetchHelper.d.ts +7 -0
  11. package/dist/types/utils/jwk.d.ts +34 -0
  12. package/dist/types/utils/jws.d.ts +22 -0
  13. package/dist/types/utils/jwt.d.ts +67 -29
  14. package/docs/changelog.md +16 -1
  15. package/docs/reference/classes/FetchError.md +13 -5
  16. package/docs/reference/classes/FetchHelper.md +85 -19
  17. package/docs/reference/classes/Jwk.md +101 -0
  18. package/docs/reference/classes/Jws.md +81 -0
  19. package/docs/reference/classes/Jwt.md +222 -102
  20. package/docs/reference/classes/MimeTypeHelper.md +6 -2
  21. package/docs/reference/index.md +3 -2
  22. package/docs/reference/interfaces/IHttpHeaders.md +1 -1
  23. package/docs/reference/interfaces/IJwk.md +2 -106
  24. package/docs/reference/interfaces/IJwtHeader.md +4 -24
  25. package/docs/reference/interfaces/IJwtPayload.md +4 -56
  26. package/docs/reference/type-aliases/JwkCryptoKey.md +5 -0
  27. package/docs/reference/variables/HeaderTypes.md +8 -8
  28. package/docs/reference/variables/MimeTypes.md +6 -0
  29. package/locales/en.json +11 -1
  30. package/package.json +7 -6
  31. package/dist/types/models/jwtAlgorithms.d.ts +0 -17
  32. package/docs/reference/type-aliases/JwtAlgorithms.md +0 -5
  33. package/docs/reference/variables/JwtAlgorithms.md +0 -19
@@ -2,6 +2,7 @@
2
2
 
3
3
  var core = require('@twin.org/core');
4
4
  var crypto = require('@twin.org/crypto');
5
+ var jose = require('jose');
5
6
 
6
7
  // Copyright 2024 IOTA Stiftung.
7
8
  // SPDX-License-Identifier: Apache-2.0.
@@ -39,35 +40,35 @@ const HeaderTypes = {
39
40
  /**
40
41
  * Content Type.
41
42
  */
42
- ContentType: "Content-Type",
43
+ ContentType: "content-type",
43
44
  /**
44
45
  * Content Length.
45
46
  */
46
- ContentLength: "Content-Length",
47
+ ContentLength: "content-length",
47
48
  /**
48
49
  * Content Disposition.
49
50
  */
50
- ContentDisposition: "Content-Disposition",
51
+ ContentDisposition: "content-disposition",
51
52
  /**
52
53
  * Accept.
53
54
  */
54
- Accept: "Accept",
55
+ Accept: "accept",
55
56
  /**
56
57
  * Authorization.
57
58
  */
58
- Authorization: "Authorization",
59
+ Authorization: "authorization",
59
60
  /**
60
61
  * Cookie.
61
62
  */
62
- Cookie: "Cookie",
63
+ Cookie: "cookie",
63
64
  /**
64
65
  * Set Cookie.
65
66
  */
66
- SetCookie: "Set-Cookie",
67
+ SetCookie: "set-cookie",
67
68
  /**
68
69
  * Location
69
70
  */
70
- Location: "Location"
71
+ Location: "location"
71
72
  };
72
73
 
73
74
  // Copyright 2024 IOTA Stiftung.
@@ -345,23 +346,6 @@ const HttpStatusCode = {
345
346
  networkAuthenticationRequired: 511
346
347
  };
347
348
 
348
- // Copyright 2024 IOTA Stiftung.
349
- // SPDX-License-Identifier: Apache-2.0.
350
- /**
351
- * The cryptographic algorithms supported for JSON Web Tokens and JSON Web Keys.
352
- */
353
- // eslint-disable-next-line @typescript-eslint/naming-convention
354
- const JwtAlgorithms = {
355
- /**
356
- * HMAC using SHA-256.
357
- */
358
- HS256: "HS256",
359
- /**
360
- * EdDSA using Ed25519.
361
- */
362
- EdDSA: "EdDSA"
363
- };
364
-
365
349
  // Copyright 2024 IOTA Stiftung.
366
350
  // SPDX-License-Identifier: Apache-2.0.
367
351
  /**
@@ -389,6 +373,10 @@ const MimeTypes = {
389
373
  * JSON-LD - application/ld+json
390
374
  */
391
375
  JsonLd: "application/ld+json",
376
+ /**
377
+ * JWT - application/jwt
378
+ */
379
+ Jwt: "application/jwt",
392
380
  /**
393
381
  * XML - application/xml
394
382
  */
@@ -698,6 +686,15 @@ class FetchHelper {
698
686
  static async getCacheEntry(url) {
699
687
  return core.AsyncCache.get(`${FetchHelper._CACHE_PREFIX}${url}`);
700
688
  }
689
+ /**
690
+ * Set a cache entry.
691
+ * @param url The url for the request.
692
+ * @param value The value to cache.
693
+ * @returns The cache entry if it exists.
694
+ */
695
+ static async setCacheEntry(url, value) {
696
+ core.AsyncCache.set(`${FetchHelper._CACHE_PREFIX}${url}`, value);
697
+ }
701
698
  /**
702
699
  * Remove a cache entry.
703
700
  * @param url The url for the request.
@@ -710,7 +707,145 @@ class FetchHelper {
710
707
  // Copyright 2024 IOTA Stiftung.
711
708
  // SPDX-License-Identifier: Apache-2.0.
712
709
  /**
713
- * Class to encode and decode JSON Web Tokens.
710
+ * Class to handle JSON Web Keys.
711
+ */
712
+ class Jwk {
713
+ /**
714
+ * Runtime name for the class.
715
+ * @internal
716
+ */
717
+ static _CLASS_NAME = "Jwk";
718
+ /**
719
+ * Convert the JWK to a crypto key.
720
+ * @param jwk The JWK to convert.
721
+ * @returns The crypto key.
722
+ */
723
+ static async toCryptoKey(jwk) {
724
+ core.Guards.object(Jwk._CLASS_NAME, "jwk", jwk);
725
+ try {
726
+ return jose.importJWK(jwk);
727
+ }
728
+ catch (err) {
729
+ throw new core.GeneralError(Jwk._CLASS_NAME, "jwkImportFailed", undefined, err);
730
+ }
731
+ }
732
+ /**
733
+ * Convert the Ed25519 private key to a crypto key.
734
+ * @param privateKey The private key to use.
735
+ * @returns The crypto key.
736
+ */
737
+ static async fromEd25519Private(privateKey) {
738
+ core.Guards.uint8Array(Jwk._CLASS_NAME, "privateKey", privateKey);
739
+ const publicKey = crypto.Ed25519.publicKeyFromPrivateKey(privateKey);
740
+ const jwk = {
741
+ kty: "OKP",
742
+ use: "enc",
743
+ alg: "EdDSA",
744
+ crv: "Ed25519",
745
+ x: core.Converter.bytesToBase64Url(publicKey),
746
+ d: core.Converter.bytesToBase64Url(privateKey)
747
+ };
748
+ return jwk;
749
+ }
750
+ /**
751
+ * Convert the Ed25519 public key to a crypto key.
752
+ * @param publicKey The private key to use.
753
+ * @returns The crypto key.
754
+ */
755
+ static async fromEd25519Public(publicKey) {
756
+ core.Guards.uint8Array(Jwk._CLASS_NAME, "publicKey", publicKey);
757
+ const jwk = {
758
+ kty: "OKP",
759
+ use: "sig",
760
+ alg: "EdDSA",
761
+ crv: "Ed25519",
762
+ x: core.Converter.bytesToBase64Url(publicKey)
763
+ };
764
+ return jwk;
765
+ }
766
+ /**
767
+ * Convert the JWK to raw keys.
768
+ * @param jwk The JWK to convert to raw.
769
+ * @returns The crypto key.
770
+ */
771
+ static async toRaw(jwk) {
772
+ core.Guards.object(Jwk._CLASS_NAME, "jwk", jwk);
773
+ let publicKey;
774
+ let privateKey;
775
+ if (core.Is.stringBase64Url(jwk.x)) {
776
+ publicKey = core.Converter.base64UrlToBytes(jwk.x);
777
+ }
778
+ if (core.Is.stringBase64Url(jwk.d)) {
779
+ privateKey = core.Converter.base64UrlToBytes(jwk.d);
780
+ }
781
+ return {
782
+ publicKey,
783
+ privateKey
784
+ };
785
+ }
786
+ }
787
+
788
+ // Copyright 2024 IOTA Stiftung.
789
+ // SPDX-License-Identifier: Apache-2.0.
790
+ /**
791
+ * Class to handle JSON Web Signatures.
792
+ */
793
+ class Jws {
794
+ /**
795
+ * Runtime name for the class.
796
+ * @internal
797
+ */
798
+ static _CLASS_NAME = "Jws";
799
+ /**
800
+ * Create a signature.
801
+ * @param privateKey The private key to use.
802
+ * @param hash The hash to sign.
803
+ * @param algOverride An optional algorithm override.
804
+ * @returns The signature.
805
+ */
806
+ static async create(privateKey, hash, algOverride) {
807
+ core.Guards.defined(Jws._CLASS_NAME, "privateKey", privateKey);
808
+ core.Guards.uint8Array(Jws._CLASS_NAME, "hash", hash);
809
+ try {
810
+ const jws = await new jose.CompactSign(hash)
811
+ .setProtectedHeader({
812
+ alg: core.Is.uint8Array(privateKey) ? (algOverride ?? "EdDSA") : privateKey.algorithm.name,
813
+ b64: false,
814
+ crit: ["b64"]
815
+ })
816
+ .sign(privateKey);
817
+ return jws;
818
+ }
819
+ catch (err) {
820
+ throw new core.GeneralError(Jws._CLASS_NAME, "createFailed", undefined, err);
821
+ }
822
+ }
823
+ /**
824
+ * Verify a signature.
825
+ * @param jws The signature to verify.
826
+ * @param publicKey The public key to verify the signature with.
827
+ * @param hash The hash to verify.
828
+ * @returns True if the signature was verified.
829
+ */
830
+ static async verify(jws, publicKey, hash) {
831
+ core.Guards.stringValue(Jws._CLASS_NAME, "jws", jws);
832
+ core.Guards.defined(Jws._CLASS_NAME, "publicKey", publicKey);
833
+ core.Guards.uint8Array(Jws._CLASS_NAME, "hash", hash);
834
+ try {
835
+ const jwsParts = jws.split(".");
836
+ await jose.flattenedVerify({ protected: jwsParts[0], payload: hash, signature: jwsParts[2] }, publicKey);
837
+ return true;
838
+ }
839
+ catch (err) {
840
+ throw new core.GeneralError(Jws._CLASS_NAME, "verifyFailed", undefined, err);
841
+ }
842
+ }
843
+ }
844
+
845
+ // Copyright 2024 IOTA Stiftung.
846
+ // SPDX-License-Identifier: Apache-2.0.
847
+ /**
848
+ * Class to handle JSON Web Tokens.
714
849
  */
715
850
  class Jwt {
716
851
  /**
@@ -727,9 +862,8 @@ class Jwt {
727
862
  */
728
863
  static async encode(header, payload, key) {
729
864
  core.Guards.object(Jwt._CLASS_NAME, "header", header);
730
- core.Guards.arrayOneOf(Jwt._CLASS_NAME, "header.alg", header.alg, Object.values(JwtAlgorithms));
731
865
  core.Guards.object(Jwt._CLASS_NAME, "payload", payload);
732
- core.Guards.uint8Array(Jwt._CLASS_NAME, "key", key);
866
+ core.Guards.defined(Jwt._CLASS_NAME, "key", key);
733
867
  return Jwt.internalEncode(header, payload, key);
734
868
  }
735
869
  /**
@@ -741,7 +875,7 @@ class Jwt {
741
875
  */
742
876
  static async encodeWithSigner(header, payload, signer) {
743
877
  core.Guards.object(Jwt._CLASS_NAME, "header", header);
744
- core.Guards.arrayOneOf(Jwt._CLASS_NAME, "header.alg", header.alg, Object.values(JwtAlgorithms));
878
+ core.Guards.stringValue(Jwt._CLASS_NAME, "header.alg", header.alg);
745
879
  core.Guards.object(Jwt._CLASS_NAME, "payload", payload);
746
880
  core.Guards.function(Jwt._CLASS_NAME, "signer", signer);
747
881
  return Jwt.internalEncode(header, payload, undefined, signer);
@@ -788,13 +922,8 @@ class Jwt {
788
922
  */
789
923
  static async verify(token, key) {
790
924
  core.Guards.stringValue(Jwt._CLASS_NAME, "token", token);
791
- core.Guards.uint8Array(Jwt._CLASS_NAME, "key", key);
792
- const decoded = await Jwt.decode(token);
793
- const verified = await Jwt.verifySignature(decoded.header, decoded.payload, decoded.signature, key);
794
- return {
795
- verified,
796
- ...decoded
797
- };
925
+ core.Guards.defined(Jwt._CLASS_NAME, "key", key);
926
+ return Jwt.verifySignature(token, key);
798
927
  }
799
928
  /**
800
929
  * Verify a token.
@@ -805,79 +934,131 @@ class Jwt {
805
934
  static async verifyWithVerifier(token, verifier) {
806
935
  core.Guards.stringValue(Jwt._CLASS_NAME, "token", token);
807
936
  core.Guards.function(Jwt._CLASS_NAME, "verifier", verifier);
808
- core.Guards.stringValue(Jwt._CLASS_NAME, "token", token);
809
- const decoded = await Jwt.decode(token);
810
- const verified = await Jwt.verifySignature(decoded.header, decoded.payload, decoded.signature, undefined, verifier);
811
- return {
812
- verified,
813
- ...decoded
814
- };
937
+ return Jwt.verifySignature(token, undefined, verifier);
815
938
  }
816
939
  /**
817
940
  * Verify a token by parts.
818
- * @param header The header to verify.
819
- * @param payload The payload to verify.
820
- * @param signature The signature to verify.
941
+ * @param token The token to verify.
821
942
  * @param key The key for verifying the token, if not provided no verification occurs.
822
943
  * @param verifier Custom verification method.
823
944
  * @returns True if the parts are verified.
824
945
  */
825
- static async verifySignature(header, payload, signature, key, verifier) {
946
+ static async verifySignature(token, key, verifier) {
947
+ core.Guards.stringValue(Jwt._CLASS_NAME, "token", token);
826
948
  const hasKey = core.Is.notEmpty(key);
827
949
  const hasVerifier = core.Is.notEmpty(verifier);
828
950
  if (!hasKey && !hasVerifier) {
829
951
  throw new core.GeneralError(Jwt._CLASS_NAME, "noKeyOrVerifier");
830
952
  }
831
- let verified = false;
832
- if (core.Is.object(header) &&
833
- core.Is.object(payload) &&
834
- core.Is.uint8Array(signature) &&
835
- core.Is.arrayOneOf(header.alg, Object.values(JwtAlgorithms))) {
836
- const segments = [];
837
- const headerBytes = core.Converter.utf8ToBytes(JSON.stringify(header));
838
- segments.push(core.Converter.bytesToBase64Url(headerBytes));
839
- const payloadBytes = core.Converter.utf8ToBytes(JSON.stringify(payload));
840
- segments.push(core.Converter.bytesToBase64Url(payloadBytes));
841
- const jwtHeaderAndPayload = core.Converter.utf8ToBytes(segments.join("."));
842
- verifier ??= async (alg, k, p, s) => Jwt.defaultVerifier(alg, k, p, s);
843
- verified = await verifier(header.alg, key, jwtHeaderAndPayload, signature);
844
- }
845
- return verified;
953
+ verifier ??= async (t, k) => Jwt.defaultVerifier(t, k);
954
+ return verifier(token, key);
846
955
  }
847
956
  /**
848
957
  * The default signer for the JWT.
849
- * @param alg The algorithm to use.
850
- * @param key The key to sign with.
958
+ * @param header The header to sign.
851
959
  * @param payload The payload to sign.
960
+ * @param key The optional key to sign with.
852
961
  * @returns The signature.
853
962
  */
854
- static async defaultSigner(alg, key, payload) {
855
- core.Guards.uint8Array(Jwt._CLASS_NAME, "key", key);
856
- core.Guards.uint8Array(Jwt._CLASS_NAME, "payload", payload);
857
- if (alg === "HS256") {
858
- const algo = new crypto.HmacSha256(key);
859
- return algo.update(payload).digest();
963
+ static async defaultSigner(header, payload, key) {
964
+ core.Guards.object(Jwt._CLASS_NAME, "header", header);
965
+ core.Guards.object(Jwt._CLASS_NAME, "payload", payload);
966
+ core.Guards.defined(Jwt._CLASS_NAME, "key", key);
967
+ const signer = new jose.SignJWT(payload);
968
+ signer.setProtectedHeader(header);
969
+ let finalKey = key;
970
+ if (header.alg === "EdDSA" && core.Is.uint8Array(key)) {
971
+ // Jose does not support Ed25519 keys in raw format, so we need to convert it to PKCS8.
972
+ finalKey = await crypto.Ed25519.privateKeyToPkcs8(key);
860
973
  }
861
- return crypto.Ed25519.sign(key, payload);
974
+ return signer.sign(finalKey);
862
975
  }
863
976
  /**
864
977
  * The default verifier for the JWT.
865
- * @param alg The algorithm to use.
978
+ * @param token The token to verify.
866
979
  * @param key The key to verify with.
867
- * @param payload The payload to verify.
868
- * @param signature The signature to verify.
869
- * @returns True if the signature was verified.
980
+ * @returns The header and payload if verification successful.
870
981
  */
871
- static async defaultVerifier(alg, key, payload, signature) {
872
- core.Guards.uint8Array(Jwt._CLASS_NAME, "key", key);
873
- core.Guards.uint8Array(Jwt._CLASS_NAME, "payload", payload);
982
+ static async defaultVerifier(token, key) {
983
+ core.Guards.stringValue(Jwt._CLASS_NAME, "token", token);
984
+ core.Guards.defined(Jwt._CLASS_NAME, "key", key);
985
+ try {
986
+ const result = await jose.jwtVerify(token, key);
987
+ return {
988
+ header: result.protectedHeader,
989
+ payload: result.payload
990
+ };
991
+ }
992
+ catch (err) {
993
+ throw new core.GeneralError(Jwt._CLASS_NAME, "verifyFailed", undefined, err);
994
+ }
995
+ }
996
+ /**
997
+ * Create bytes for signing from header and payload.
998
+ * @param header The header.
999
+ * @param payload The payload.
1000
+ * @returns The bytes to sign.
1001
+ */
1002
+ static toSigningBytes(header, payload) {
1003
+ core.Guards.object(Jwt._CLASS_NAME, "header", header);
1004
+ core.Guards.object(Jwt._CLASS_NAME, "payload", payload);
1005
+ const segments = [];
1006
+ const headerBytes = core.Converter.utf8ToBytes(JSON.stringify(header));
1007
+ segments.push(core.Converter.bytesToBase64Url(headerBytes));
1008
+ const payloadBytes = core.Converter.utf8ToBytes(JSON.stringify(payload));
1009
+ segments.push(core.Converter.bytesToBase64Url(payloadBytes));
1010
+ return core.Converter.utf8ToBytes(segments.join("."));
1011
+ }
1012
+ /**
1013
+ * Create header and payload from signing bytes.
1014
+ * @param signingBytes The signing bytes from a token.
1015
+ * @returns The header and payload.
1016
+ * @throws If the signing bytes are invalid
1017
+ */
1018
+ static fromSigningBytes(signingBytes) {
1019
+ core.Guards.uint8Array(Jwt._CLASS_NAME, "signingBytes", signingBytes);
1020
+ const segments = core.Converter.bytesToUtf8(signingBytes).split(".");
1021
+ if (segments.length !== 2) {
1022
+ throw new core.GeneralError(Jwt._CLASS_NAME, "invalidSigningBytes");
1023
+ }
1024
+ const headerBytes = core.Converter.base64UrlToBytes(segments[0]);
1025
+ const payloadBytes = core.Converter.base64UrlToBytes(segments[1]);
1026
+ return {
1027
+ header: core.ObjectHelper.fromBytes(headerBytes),
1028
+ payload: core.ObjectHelper.fromBytes(payloadBytes)
1029
+ };
1030
+ }
1031
+ /**
1032
+ * Convert signed bytes and signature bytes to token.
1033
+ * @param signingBytes The signed bytes.
1034
+ * @param signature The signature.
1035
+ * @returns The token.
1036
+ */
1037
+ static tokenFromBytes(signingBytes, signature) {
1038
+ core.Guards.uint8Array(Jwt._CLASS_NAME, "signingBytes", signingBytes);
874
1039
  core.Guards.uint8Array(Jwt._CLASS_NAME, "signature", signature);
875
- if (alg === "HS256") {
876
- const algo = new crypto.HmacSha256(key);
877
- const sigBytes = algo.update(payload).digest();
878
- return core.ArrayHelper.matches(sigBytes, signature);
1040
+ const signedBytesUtf8 = core.Converter.bytesToUtf8(signingBytes);
1041
+ const signatureBase64 = core.Converter.bytesToBase64Url(signature);
1042
+ return `${signedBytesUtf8}.${signatureBase64}`;
1043
+ }
1044
+ /**
1045
+ * Convert the token to signing bytes and signature bytes.
1046
+ * @param token The token to convert to bytes.
1047
+ * @returns The decoded bytes.
1048
+ * @throws If the token is invalid.
1049
+ */
1050
+ static tokenToBytes(token) {
1051
+ core.Guards.stringValue(Jwt._CLASS_NAME, "token", token);
1052
+ const segments = token.split(".");
1053
+ if (segments.length !== 3) {
1054
+ throw new core.GeneralError(Jwt._CLASS_NAME, "invalidTokenParts");
879
1055
  }
880
- return crypto.Ed25519.verify(key, payload, signature);
1056
+ const signingBytes = core.Converter.utf8ToBytes(`${segments[0]}.${segments[1]}`);
1057
+ const signature = core.Converter.base64UrlToBytes(segments[2]);
1058
+ return {
1059
+ signingBytes,
1060
+ signature
1061
+ };
881
1062
  }
882
1063
  /**
883
1064
  * Encode a token.
@@ -894,19 +1075,11 @@ class Jwt {
894
1075
  if (!hasKey && !hasSigner) {
895
1076
  throw new core.GeneralError(Jwt._CLASS_NAME, "noKeyOrSigner");
896
1077
  }
897
- signer ??= async (alg, k, p) => Jwt.defaultSigner(alg, k, p);
1078
+ signer ??= async (h, p, k) => Jwt.defaultSigner(h, p, k);
898
1079
  if (core.Is.undefined(header.typ)) {
899
1080
  header.typ = "JWT";
900
1081
  }
901
- const segments = [];
902
- const headerBytes = core.Converter.utf8ToBytes(JSON.stringify(header));
903
- segments.push(core.Converter.bytesToBase64Url(headerBytes));
904
- const payloadBytes = core.Converter.utf8ToBytes(JSON.stringify(payload));
905
- segments.push(core.Converter.bytesToBase64Url(payloadBytes));
906
- const jwtHeaderAndPayload = core.Converter.utf8ToBytes(segments.join("."));
907
- const sigBytes = await signer(header.alg, key, jwtHeaderAndPayload);
908
- segments.push(core.Converter.bytesToBase64Url(sigBytes));
909
- return segments.join(".");
1082
+ return signer(header, payload, key);
910
1083
  }
911
1084
  }
912
1085
 
@@ -922,7 +1095,7 @@ class MimeTypeHelper {
922
1095
  * @returns The mime type if detected.
923
1096
  */
924
1097
  static async detect(data) {
925
- if (!core.Is.uint8Array(data)) {
1098
+ if (!core.Is.uint8Array(data) || data.length === 0) {
926
1099
  return undefined;
927
1100
  }
928
1101
  // Image
@@ -994,12 +1167,13 @@ class MimeTypeHelper {
994
1167
  [MimeTypes.Javascript]: "js",
995
1168
  [MimeTypes.Json]: "json",
996
1169
  [MimeTypes.JsonLd]: "jsonld",
1170
+ [MimeTypes.Jwt]: "jwt",
997
1171
  [MimeTypes.Xml]: "xml",
998
1172
  [MimeTypes.OctetStream]: "bin",
999
1173
  [MimeTypes.Gzip]: "gzip",
1000
1174
  [MimeTypes.Bzip2]: "bz2",
1001
1175
  [MimeTypes.Zip]: "zip",
1002
- [MimeTypes.Pdf]: "pfd",
1176
+ [MimeTypes.Pdf]: "pdf",
1003
1177
  [MimeTypes.Gif]: "gif",
1004
1178
  [MimeTypes.Bmp]: "bmp",
1005
1179
  [MimeTypes.Jpeg]: "jpeg",
@@ -1050,7 +1224,8 @@ exports.FetchHelper = FetchHelper;
1050
1224
  exports.HeaderTypes = HeaderTypes;
1051
1225
  exports.HttpMethod = HttpMethod;
1052
1226
  exports.HttpStatusCode = HttpStatusCode;
1227
+ exports.Jwk = Jwk;
1228
+ exports.Jws = Jws;
1053
1229
  exports.Jwt = Jwt;
1054
- exports.JwtAlgorithms = JwtAlgorithms;
1055
1230
  exports.MimeTypeHelper = MimeTypeHelper;
1056
1231
  exports.MimeTypes = MimeTypes;