@sebastienrousseau/crypto-server 0.0.8 → 0.0.24

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 (102) hide show
  1. package/README.md +159 -56
  2. package/dist/@types/types.d.ts +1 -2
  3. package/dist/@types/types.d.ts.map +1 -1
  4. package/dist/config/auth-policy.d.ts +18 -0
  5. package/dist/config/auth-policy.d.ts.map +1 -1
  6. package/dist/config/auth-policy.js +126 -0
  7. package/dist/config/constants.d.ts.map +1 -1
  8. package/dist/config/constants.js +7 -1
  9. package/dist/enterprise/metering.d.ts.map +1 -1
  10. package/dist/enterprise/metering.js +2 -4
  11. package/dist/index.d.ts +1 -0
  12. package/dist/index.js +1 -0
  13. package/dist/lib/auth.d.ts +4 -1
  14. package/dist/lib/auth.d.ts.map +1 -1
  15. package/dist/lib/auth.js +87 -40
  16. package/dist/lib/kdf-runner.d.ts +18 -0
  17. package/dist/lib/kdf-runner.d.ts.map +1 -0
  18. package/dist/lib/kdf-runner.js +27 -0
  19. package/dist/lib/key-store.d.ts +37 -0
  20. package/dist/lib/key-store.d.ts.map +1 -0
  21. package/dist/lib/key-store.js +223 -0
  22. package/dist/lib/opaque-store.d.ts +34 -0
  23. package/dist/lib/opaque-store.d.ts.map +1 -0
  24. package/dist/lib/opaque-store.js +72 -0
  25. package/dist/lib/problem.d.ts +67 -0
  26. package/dist/lib/problem.d.ts.map +1 -0
  27. package/dist/lib/problem.js +162 -0
  28. package/dist/routes/v1/decrypt.d.ts.map +1 -1
  29. package/dist/routes/v1/decrypt.js +24 -16
  30. package/dist/routes/v1/encrypt.d.ts.map +1 -1
  31. package/dist/routes/v1/encrypt.js +12 -13
  32. package/dist/routes/v1/generate.d.ts.map +1 -1
  33. package/dist/routes/v1/generate.js +22 -25
  34. package/dist/routes/v1/revoke.d.ts.map +1 -1
  35. package/dist/routes/v1/revoke.js +6 -11
  36. package/dist/routes/v1/verify.d.ts.map +1 -1
  37. package/dist/routes/v1/verify.js +10 -12
  38. package/dist/routes/v2/algorithms.js +1 -1
  39. package/dist/routes/v2/compliance.js +1 -1
  40. package/dist/routes/v2/encrypt.d.ts.map +1 -1
  41. package/dist/routes/v2/encrypt.js +1 -1
  42. package/dist/routes/v2/hash.d.ts.map +1 -1
  43. package/dist/routes/v2/hash.js +1 -1
  44. package/dist/routes/v2/hpke.d.ts +3 -0
  45. package/dist/routes/v2/hpke.d.ts.map +1 -0
  46. package/dist/routes/v2/hpke.js +168 -0
  47. package/dist/routes/v2/index.d.ts.map +1 -1
  48. package/dist/routes/v2/index.js +6 -0
  49. package/dist/routes/v2/kdf.d.ts +5 -0
  50. package/dist/routes/v2/kdf.d.ts.map +1 -1
  51. package/dist/routes/v2/kdf.js +27 -12
  52. package/dist/routes/v2/key-wrap.d.ts.map +1 -1
  53. package/dist/routes/v2/key-wrap.js +9 -3
  54. package/dist/routes/v2/keys.d.ts.map +1 -1
  55. package/dist/routes/v2/keys.js +39 -26
  56. package/dist/routes/v2/kms.d.ts +7 -0
  57. package/dist/routes/v2/kms.d.ts.map +1 -0
  58. package/dist/routes/v2/kms.js +310 -0
  59. package/dist/routes/v2/mac.d.ts.map +1 -1
  60. package/dist/routes/v2/mac.js +10 -3
  61. package/dist/routes/v2/multi-recipient.d.ts.map +1 -1
  62. package/dist/routes/v2/multi-recipient.js +12 -11
  63. package/dist/routes/v2/opaque.d.ts +4 -0
  64. package/dist/routes/v2/opaque.d.ts.map +1 -0
  65. package/dist/routes/v2/opaque.js +174 -0
  66. package/dist/routes/v2/password-encrypt.d.ts.map +1 -1
  67. package/dist/routes/v2/password-encrypt.js +13 -46
  68. package/dist/routes/v2/password.d.ts +4 -0
  69. package/dist/routes/v2/password.d.ts.map +1 -1
  70. package/dist/routes/v2/password.js +28 -53
  71. package/dist/routes/v2/pq-hash-sign.d.ts.map +1 -1
  72. package/dist/routes/v2/pq-hash-sign.js +33 -24
  73. package/dist/routes/v2/pq-sign.d.ts.map +1 -1
  74. package/dist/routes/v2/pq-sign.js +31 -24
  75. package/dist/routes/v2/pq.d.ts.map +1 -1
  76. package/dist/routes/v2/pq.js +57 -38
  77. package/dist/routes/v2/sealedbox.d.ts.map +1 -1
  78. package/dist/routes/v2/sealedbox.js +32 -14
  79. package/dist/routes/v2/secretbox.d.ts.map +1 -1
  80. package/dist/routes/v2/secretbox.js +10 -3
  81. package/dist/routes/v2/signing.d.ts.map +1 -1
  82. package/dist/routes/v2/signing.js +17 -13
  83. package/dist/routes/v2/stream-schemas.d.ts +296 -0
  84. package/dist/routes/v2/stream-schemas.d.ts.map +1 -0
  85. package/dist/routes/v2/stream-schemas.js +207 -0
  86. package/dist/routes/v2/stream.d.ts.map +1 -1
  87. package/dist/routes/v2/stream.js +144 -151
  88. package/dist/server.d.ts.map +1 -1
  89. package/dist/server.js +19 -5
  90. package/dist/utils/keys.d.ts +17 -0
  91. package/dist/utils/keys.d.ts.map +1 -0
  92. package/dist/utils/keys.js +36 -0
  93. package/dist/utils/route-helpers.d.ts +1 -5
  94. package/dist/utils/route-helpers.d.ts.map +1 -1
  95. package/dist/utils/route-helpers.js +16 -10
  96. package/dist/utils/trace.d.ts +12 -0
  97. package/dist/utils/trace.d.ts.map +1 -0
  98. package/dist/utils/trace.js +62 -0
  99. package/dist/utils/validation.d.ts +1 -0
  100. package/dist/utils/validation.d.ts.map +1 -1
  101. package/dist/utils/validation.js +17 -9
  102. package/package.json +22 -18
@@ -34,7 +34,9 @@ var __importStar = (this && this.__importStar) || (function () {
34
34
  })();
35
35
  Object.defineProperty(exports, "__esModule", { value: true });
36
36
  const route_helpers_1 = require("../../utils/route-helpers");
37
- exports.default = (app) => {
37
+ const keys_1 = require("../../utils/keys");
38
+ const loadSealedbox = async () => (await Promise.resolve().then(() => __importStar(require("@sebastienrousseau/crypto-lib/high-level")))).sealedbox;
39
+ function registerSeal(app) {
38
40
  app.post("/v2/sealedbox/seal", {
39
41
  schema: {
40
42
  tags: ["Sealed Box"],
@@ -51,7 +53,7 @@ exports.default = (app) => {
51
53
  },
52
54
  }, async (request, reply) => {
53
55
  try {
54
- const { seal } = await Promise.resolve().then(() => __importStar(require("@sebastienrousseau/crypto-lib/dist/high-level/sealedbox")));
56
+ const { seal } = await loadSealedbox();
55
57
  const { recipientPublicKey, plaintext } = request.body;
56
58
  return reply.send({ data: seal(recipientPublicKey, plaintext) });
57
59
  }
@@ -59,25 +61,29 @@ exports.default = (app) => {
59
61
  return (0, route_helpers_1.classifyCryptoError)(error, request, reply, "Encryption");
60
62
  }
61
63
  });
64
+ }
65
+ function registerOpen(app) {
62
66
  app.post("/v2/sealedbox/open", {
63
67
  schema: {
64
68
  tags: ["Sealed Box"],
65
69
  summary: "Decrypt an anonymous sealed box (X25519)",
70
+ description: "Opens a sealed box with a server-held x25519 key (keyId from POST /v2/keys/generate).",
66
71
  body: {
67
72
  type: "object",
68
- required: ["recipientSecretKey", "sealed"],
73
+ required: ["keyId", "sealed"],
69
74
  additionalProperties: false,
70
75
  properties: {
71
- recipientSecretKey: { type: "string", minLength: 1 },
76
+ keyId: keys_1.KEY_ID_SCHEMA,
72
77
  sealed: { type: "string", minLength: 1 },
73
78
  },
74
79
  },
75
80
  },
76
81
  }, async (request, reply) => {
82
+ const { keyId, sealed } = request.body;
83
+ const key = await (0, keys_1.resolveKey)(request, keyId, ["x25519"]);
77
84
  try {
78
- const { open } = await Promise.resolve().then(() => __importStar(require("@sebastienrousseau/crypto-lib/dist/high-level/sealedbox")));
79
- const { recipientSecretKey, sealed } = request.body;
80
- const plaintext = open(recipientSecretKey, sealed);
85
+ const { open } = await loadSealedbox();
86
+ const plaintext = open(key.privateParts["privateKey"], sealed);
81
87
  return reply.send({
82
88
  data: Buffer.from(plaintext).toString("utf8"),
83
89
  });
@@ -86,6 +92,8 @@ exports.default = (app) => {
86
92
  return (0, route_helpers_1.classifyCryptoError)(error, request, reply, "Decryption");
87
93
  }
88
94
  });
95
+ }
96
+ function registerSealPq(app) {
89
97
  app.post("/v2/sealedbox/seal-pq", {
90
98
  schema: {
91
99
  tags: ["Sealed Box"],
@@ -103,7 +111,7 @@ exports.default = (app) => {
103
111
  },
104
112
  }, async (request, reply) => {
105
113
  try {
106
- const { sealPQ } = await Promise.resolve().then(() => __importStar(require("@sebastienrousseau/crypto-lib/dist/high-level/sealedbox")));
114
+ const { sealPQ } = await loadSealedbox();
107
115
  const { x25519PublicKey, mlKemPublicKey, plaintext } = request.body;
108
116
  return reply.send({
109
117
  data: sealPQ(x25519PublicKey, mlKemPublicKey, plaintext),
@@ -113,26 +121,30 @@ exports.default = (app) => {
113
121
  return (0, route_helpers_1.classifyCryptoError)(error, request, reply, "Encryption");
114
122
  }
115
123
  });
124
+ }
125
+ function registerOpenPq(app) {
116
126
  app.post("/v2/sealedbox/open-pq", {
117
127
  schema: {
118
128
  tags: ["Sealed Box"],
119
129
  summary: "Decrypt a post-quantum sealed box (X25519 + ML-KEM-768)",
130
+ description: "Opens a hybrid sealed box with a server-held x25519-ml-kem-768 key (keyId from POST /v2/pq/hybrid/keygen).",
120
131
  body: {
121
132
  type: "object",
122
- required: ["x25519SecretKey", "mlKemSecretKey", "sealed"],
133
+ required: ["keyId", "sealed"],
123
134
  additionalProperties: false,
124
135
  properties: {
125
- x25519SecretKey: { type: "string", minLength: 1 },
126
- mlKemSecretKey: { type: "string", minLength: 1 },
136
+ keyId: keys_1.KEY_ID_SCHEMA,
127
137
  sealed: { type: "string", minLength: 1 },
128
138
  },
129
139
  },
130
140
  },
131
141
  }, async (request, reply) => {
142
+ const { keyId, sealed } = request.body;
143
+ const key = await (0, keys_1.resolveKey)(request, keyId, ["x25519-ml-kem-768"]);
132
144
  try {
133
- const { openPQ } = await Promise.resolve().then(() => __importStar(require("@sebastienrousseau/crypto-lib/dist/high-level/sealedbox")));
134
- const { x25519SecretKey, mlKemSecretKey, sealed } = request.body;
135
- const plaintext = openPQ(x25519SecretKey, mlKemSecretKey, sealed);
145
+ const { openPQ } = await loadSealedbox();
146
+ const { x25519PrivateKey, mlKemSecretKey } = key.privateParts;
147
+ const plaintext = openPQ(x25519PrivateKey, mlKemSecretKey, sealed);
136
148
  return reply.send({
137
149
  data: Buffer.from(plaintext).toString("utf8"),
138
150
  });
@@ -141,5 +153,11 @@ exports.default = (app) => {
141
153
  return (0, route_helpers_1.classifyCryptoError)(error, request, reply, "Decryption");
142
154
  }
143
155
  });
156
+ }
157
+ exports.default = (app) => {
158
+ registerSeal(app);
159
+ registerOpen(app);
160
+ registerSealPq(app);
161
+ registerOpenPq(app);
144
162
  };
145
163
  //# sourceMappingURL=sealedbox.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"secretbox.d.ts","sourceRoot":"","sources":["../../../src/routes/v2/secretbox.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;yBAI/B,KAAK,eAAe,KAAG,IAAI;AAA3C,wBAyEE"}
1
+ {"version":3,"file":"secretbox.d.ts","sourceRoot":"","sources":["../../../src/routes/v2/secretbox.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;yBAqF/B,KAAK,eAAe,KAAG,IAAI;AAA3C,wBAGE"}
@@ -34,7 +34,8 @@ var __importStar = (this && this.__importStar) || (function () {
34
34
  })();
35
35
  Object.defineProperty(exports, "__esModule", { value: true });
36
36
  const route_helpers_1 = require("../../utils/route-helpers");
37
- exports.default = (app) => {
37
+ const loadSecretbox = async () => (await Promise.resolve().then(() => __importStar(require("@sebastienrousseau/crypto-lib/high-level")))).secretbox;
38
+ function registerSeal(app) {
38
39
  app.post("/v2/secretbox/seal", {
39
40
  schema: {
40
41
  tags: ["Secretbox"],
@@ -52,7 +53,7 @@ exports.default = (app) => {
52
53
  },
53
54
  }, async (request, reply) => {
54
55
  try {
55
- const { seal } = await Promise.resolve().then(() => __importStar(require("@sebastienrousseau/crypto-lib/dist/high-level/secretbox")));
56
+ const { seal } = await loadSecretbox();
56
57
  const { key, plaintext, aad } = request.body;
57
58
  const aadBytes = aad ? Buffer.from(aad, "utf8") : undefined;
58
59
  return reply.send({ data: seal(key, plaintext, aadBytes) });
@@ -61,6 +62,8 @@ exports.default = (app) => {
61
62
  return (0, route_helpers_1.classifyCryptoError)(error, request, reply, "Encryption");
62
63
  }
63
64
  });
65
+ }
66
+ function registerOpen(app) {
64
67
  app.post("/v2/secretbox/open", {
65
68
  schema: {
66
69
  tags: ["Secretbox"],
@@ -78,7 +81,7 @@ exports.default = (app) => {
78
81
  },
79
82
  }, async (request, reply) => {
80
83
  try {
81
- const { open } = await Promise.resolve().then(() => __importStar(require("@sebastienrousseau/crypto-lib/dist/high-level/secretbox")));
84
+ const { open } = await loadSecretbox();
82
85
  const { key, ciphertext, aad } = request.body;
83
86
  const aadBytes = aad ? Buffer.from(aad, "utf8") : undefined;
84
87
  const plaintext = open(key, ciphertext, aadBytes);
@@ -90,5 +93,9 @@ exports.default = (app) => {
90
93
  return (0, route_helpers_1.classifyCryptoError)(error, request, reply, "Decryption");
91
94
  }
92
95
  });
96
+ }
97
+ exports.default = (app) => {
98
+ registerSeal(app);
99
+ registerOpen(app);
93
100
  };
94
101
  //# sourceMappingURL=secretbox.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"signing.d.ts","sourceRoot":"","sources":["../../../src/routes/v2/signing.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;yBAQ/B,KAAK,eAAe,KAAG,IAAI;AAA3C,wBA6EE"}
1
+ {"version":3,"file":"signing.d.ts","sourceRoot":"","sources":["../../../src/routes/v2/signing.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;yBA0F/B,KAAK,eAAe,KAAG,IAAI;AAA3C,wBAIE"}
@@ -1,19 +1,20 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const modern_1 = require("@sebastienrousseau/crypto-lib/dist/modern");
3
+ const modern_1 = require("@sebastienrousseau/crypto-lib/modern");
4
4
  const route_helpers_1 = require("../../utils/route-helpers");
5
- exports.default = (app) => {
5
+ const keys_1 = require("../../utils/keys");
6
+ function registerSign(app) {
6
7
  app.post("/v2/sign", {
7
8
  schema: {
8
9
  tags: ["Signing"],
9
10
  summary: "Sign with Ed25519",
10
- description: "Create an Ed25519 digital signature over a message.",
11
+ description: "Create an Ed25519 digital signature over a message with a server-held ed25519 key (keyId from POST /v2/keys/generate).",
11
12
  body: {
12
13
  type: "object",
13
- required: ["privateKey", "message"],
14
+ required: ["keyId", "message"],
14
15
  additionalProperties: false,
15
16
  properties: {
16
- privateKey: { type: "string", minLength: 64, maxLength: 64 },
17
+ keyId: keys_1.KEY_ID_SCHEMA,
17
18
  message: {
18
19
  type: "string",
19
20
  minLength: 1,
@@ -23,15 +24,13 @@ exports.default = (app) => {
23
24
  },
24
25
  },
25
26
  }, async (request, reply) => {
26
- try {
27
- const { privateKey, message } = request.body;
28
- const result = (0, modern_1.ed25519Sign)(privateKey, message);
29
- return reply.send({ data: result });
30
- }
31
- catch (error) {
32
- return (0, route_helpers_1.classifyCryptoError)(error, request, reply, "Signing");
33
- }
27
+ const { keyId, message } = request.body;
28
+ const key = await (0, keys_1.resolveKey)(request, keyId, ["ed25519"]);
29
+ const result = (0, modern_1.ed25519Sign)(key.privateParts["privateKey"], message);
30
+ return reply.send({ data: result });
34
31
  });
32
+ }
33
+ function registerVerify(app) {
35
34
  app.post("/v2/verify", {
36
35
  schema: {
37
36
  tags: ["Signing"],
@@ -52,6 +51,7 @@ exports.default = (app) => {
52
51
  },
53
52
  },
54
53
  },
54
+ config: { rateLimit: { max: 100, timeWindow: "1 minute" } },
55
55
  }, async (request, reply) => {
56
56
  try {
57
57
  const { publicKey, message, signature } = request.body;
@@ -62,5 +62,9 @@ exports.default = (app) => {
62
62
  return (0, route_helpers_1.classifyCryptoError)(error, request, reply, "Verification");
63
63
  }
64
64
  });
65
+ }
66
+ exports.default = (app) => {
67
+ registerSign(app);
68
+ registerVerify(app);
65
69
  };
66
70
  //# sourceMappingURL=signing.js.map
@@ -0,0 +1,296 @@
1
+ export declare const SIGN_SCHEMA: {
2
+ tags: string[];
3
+ summary: string;
4
+ description: string;
5
+ body: {
6
+ type: string;
7
+ required: string[];
8
+ additionalProperties: boolean;
9
+ properties: {
10
+ items: {
11
+ type: string;
12
+ minItems: number;
13
+ maxItems: number;
14
+ items: {
15
+ type: string;
16
+ required: string[];
17
+ additionalProperties: boolean;
18
+ properties: {
19
+ id: {
20
+ type: string;
21
+ };
22
+ message: {
23
+ type: string;
24
+ minLength: number;
25
+ };
26
+ keyId: {
27
+ readonly type: "string";
28
+ readonly pattern: "^k_[A-Za-z0-9_-]{22}$";
29
+ readonly description: "Identifier of a server-held key, returned by a key-generation route.";
30
+ };
31
+ };
32
+ };
33
+ };
34
+ };
35
+ };
36
+ };
37
+ export declare const VERIFY_SCHEMA: {
38
+ tags: string[];
39
+ summary: string;
40
+ description: string;
41
+ body: {
42
+ type: string;
43
+ required: string[];
44
+ additionalProperties: boolean;
45
+ properties: {
46
+ items: {
47
+ type: string;
48
+ minItems: number;
49
+ maxItems: number;
50
+ items: {
51
+ type: string;
52
+ required: string[];
53
+ additionalProperties: boolean;
54
+ properties: {
55
+ id: {
56
+ type: string;
57
+ };
58
+ message: {
59
+ type: string;
60
+ minLength: number;
61
+ };
62
+ signature: {
63
+ type: string;
64
+ minLength: number;
65
+ };
66
+ publicKey: {
67
+ type: string;
68
+ minLength: number;
69
+ maxLength: number;
70
+ };
71
+ };
72
+ };
73
+ };
74
+ };
75
+ };
76
+ };
77
+ export declare const ISO20022_SCHEMA: {
78
+ tags: string[];
79
+ summary: string;
80
+ description: string;
81
+ body: {
82
+ type: string;
83
+ required: string[];
84
+ additionalProperties: boolean;
85
+ properties: {
86
+ trustedKeys: {
87
+ type: string;
88
+ required: string[];
89
+ additionalProperties: boolean;
90
+ properties: {
91
+ classicalPublicKey: {
92
+ type: string;
93
+ minLength: number;
94
+ };
95
+ postQuantumPublicKey: {
96
+ type: string;
97
+ minLength: number;
98
+ };
99
+ };
100
+ };
101
+ envelope: {
102
+ type: string;
103
+ required: string[];
104
+ additionalProperties: boolean;
105
+ properties: {
106
+ messageId: {
107
+ type: string;
108
+ };
109
+ messageType: {
110
+ type: string;
111
+ enum: string[];
112
+ };
113
+ payloadDigest: {
114
+ type: string;
115
+ };
116
+ digestAlgorithm: {
117
+ type: string;
118
+ enum: string[];
119
+ };
120
+ timestamp: {
121
+ type: string;
122
+ };
123
+ classical: {
124
+ type: string;
125
+ required: string[];
126
+ additionalProperties: boolean;
127
+ properties: {
128
+ algorithm: {
129
+ type: string;
130
+ };
131
+ signature: {
132
+ type: string;
133
+ };
134
+ publicKey: {
135
+ type: string;
136
+ };
137
+ };
138
+ };
139
+ postQuantum: {
140
+ type: string;
141
+ required: string[];
142
+ additionalProperties: boolean;
143
+ properties: {
144
+ algorithm: {
145
+ type: string;
146
+ enum: string[];
147
+ };
148
+ signature: {
149
+ type: string;
150
+ };
151
+ publicKey: {
152
+ type: string;
153
+ };
154
+ };
155
+ };
156
+ };
157
+ };
158
+ payload: {};
159
+ };
160
+ };
161
+ };
162
+ export declare const STREAM_PQ_ENCRYPT_SCHEMA: {
163
+ tags: string[];
164
+ summary: string;
165
+ description: string;
166
+ body: {
167
+ type: string;
168
+ required: string[];
169
+ additionalProperties: boolean;
170
+ properties: {
171
+ x25519PublicKey: {
172
+ type: string;
173
+ minLength: number;
174
+ maxLength: number;
175
+ };
176
+ mlKemPublicKey: {
177
+ type: string;
178
+ minLength: number;
179
+ };
180
+ plaintext: {
181
+ type: string;
182
+ minLength: number;
183
+ };
184
+ chunkSize: {
185
+ type: string;
186
+ minimum: number;
187
+ maximum: number;
188
+ };
189
+ };
190
+ };
191
+ };
192
+ export declare const STREAM_PQ_DECRYPT_SCHEMA: {
193
+ tags: string[];
194
+ summary: string;
195
+ description: string;
196
+ body: {
197
+ type: string;
198
+ required: string[];
199
+ additionalProperties: boolean;
200
+ properties: {
201
+ keyId: {
202
+ readonly type: "string";
203
+ readonly pattern: "^k_[A-Za-z0-9_-]{22}$";
204
+ readonly description: "Identifier of a server-held key, returned by a key-generation route.";
205
+ };
206
+ ciphertext: {
207
+ type: string;
208
+ minLength: number;
209
+ };
210
+ chunkSize: {
211
+ type: string;
212
+ minimum: number;
213
+ maximum: number;
214
+ };
215
+ };
216
+ };
217
+ };
218
+ export declare const STREAM_MULTI_PQ_ENCRYPT_SCHEMA: {
219
+ tags: string[];
220
+ summary: string;
221
+ description: string;
222
+ body: {
223
+ type: string;
224
+ required: string[];
225
+ additionalProperties: boolean;
226
+ properties: {
227
+ recipients: {
228
+ type: string;
229
+ minItems: number;
230
+ maxItems: number;
231
+ items: {
232
+ type: string;
233
+ required: string[];
234
+ additionalProperties: boolean;
235
+ properties: {
236
+ recipientId: {
237
+ type: string;
238
+ minLength: number;
239
+ maxLength: number;
240
+ };
241
+ x25519PublicKey: {
242
+ type: string;
243
+ minLength: number;
244
+ maxLength: number;
245
+ };
246
+ mlKemPublicKey: {
247
+ type: string;
248
+ minLength: number;
249
+ };
250
+ };
251
+ };
252
+ };
253
+ plaintext: {
254
+ type: string;
255
+ minLength: number;
256
+ };
257
+ chunkSize: {
258
+ type: string;
259
+ minimum: number;
260
+ maximum: number;
261
+ };
262
+ };
263
+ };
264
+ };
265
+ export declare const STREAM_MULTI_PQ_DECRYPT_SCHEMA: {
266
+ tags: string[];
267
+ summary: string;
268
+ description: string;
269
+ body: {
270
+ type: string;
271
+ required: string[];
272
+ additionalProperties: boolean;
273
+ properties: {
274
+ keyId: {
275
+ readonly type: "string";
276
+ readonly pattern: "^k_[A-Za-z0-9_-]{22}$";
277
+ readonly description: "Identifier of a server-held key, returned by a key-generation route.";
278
+ };
279
+ recipientId: {
280
+ type: string;
281
+ minLength: number;
282
+ maxLength: number;
283
+ };
284
+ ciphertext: {
285
+ type: string;
286
+ minLength: number;
287
+ };
288
+ chunkSize: {
289
+ type: string;
290
+ minimum: number;
291
+ maximum: number;
292
+ };
293
+ };
294
+ };
295
+ };
296
+ //# sourceMappingURL=stream-schemas.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stream-schemas.d.ts","sourceRoot":"","sources":["../../../src/routes/v2/stream-schemas.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2BvB,CAAC;AAGF,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4BzB,CAAC;AAGF,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuE3B,CAAC;AAGF,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgBpC,CAAC;AAGF,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;CAepC,CAAC;AAGF,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8B1C,CAAC;AAGF,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiB1C,CAAC"}