@wireapp/core-crypto 10.2.0 → 10.4.0

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.
@@ -41,268 +41,6 @@ export declare function setMaxLogLevel(level: CoreCryptoLogLevel): void;
41
41
  * The version of `core-crypto`.
42
42
  */
43
43
  export declare function version(): string;
44
- type UuidLike = Uuid;
45
- /**
46
- * A Uuid.
47
- */
48
- export declare class Uuid extends UniffiAbstractObject {
49
- readonly [uniffiTypeNameSymbol] = "Uuid";
50
- readonly [destructorGuardSymbol]: UniffiGcObject;
51
- readonly [pointerLiteralSymbol]: UniffiHandle;
52
- /**
53
- * Parse a `Uuid` from a string.
54
- */
55
- constructor(uuid: string);
56
- toString(): string;
57
- equals(other: Uuid): boolean;
58
- hashCode(): bigint;
59
- uniffiDestroy(): void;
60
- static instanceOf(obj_: any): obj_ is Uuid;
61
- }
62
- type DeviceIdLike = DeviceId;
63
- /**
64
- * A Device ID.
65
- */
66
- export declare class DeviceId extends UniffiAbstractObject {
67
- readonly [uniffiTypeNameSymbol] = "DeviceId";
68
- readonly [destructorGuardSymbol]: UniffiGcObject;
69
- readonly [pointerLiteralSymbol]: UniffiHandle;
70
- /**
71
- * New device id from an unsigned 64-bit integer.
72
- */
73
- constructor(id: bigint);
74
- /**
75
- * Construct a `DeviceId` from 8 bytes encoded as a hex string.
76
- */
77
- static fromHexString(hexString: string): DeviceIdLike;
78
- /**
79
- * Encode the `DeviceId` as a 16-character lowercase hex string, with leading 0s.
80
- */
81
- toHexString(): string;
82
- /**
83
- * Get the number corresponding to this `DeviceId`.
84
- */
85
- toU64(): bigint;
86
- equals(other: DeviceId): boolean;
87
- hashCode(): bigint;
88
- uniffiDestroy(): void;
89
- static instanceOf(obj_: any): obj_ is DeviceId;
90
- }
91
- /**
92
- * This directly represents a `ClientId` of the `<userid>:<device-id>@<domain>` format.
93
- * Instantiate via [ClientId::deserialize].
94
- */
95
- export type DeserializedClientId = {
96
- /**
97
- * The client id this was deserialized from
98
- */
99
- clientId: ClientIdLike;
100
- /**
101
- * The user id component
102
- */
103
- userId: UuidLike;
104
- /**
105
- * The device id component
106
- */
107
- deviceId: DeviceIdLike;
108
- /**
109
- * The domain
110
- */
111
- domain: string;
112
- };
113
- /**
114
- * Generated factory for {@link DeserializedClientId} record objects.
115
- */
116
- export declare const DeserializedClientId: Readonly<{
117
- create: (partial: Partial<DeserializedClientId> & Required<Omit<DeserializedClientId, never>>) => DeserializedClientId;
118
- new: (partial: Partial<DeserializedClientId> & Required<Omit<DeserializedClientId, never>>) => DeserializedClientId;
119
- defaults: () => Partial<DeserializedClientId>;
120
- toString(self_: DeserializedClientId): string;
121
- }>;
122
- type ClientIdLike = ClientId;
123
- /**
124
- * A unique identifier for an MLS client.
125
- *
126
- * Each app instance a user is running, such as desktop or mobile, is a separate client
127
- * with its own client id. A single user may therefore have multiple clients.
128
- * More information: <https://messaginglayersecurity.rocks/mls-architecture/draft-ietf-mls-architecture.html#name-group-members-and-clients>
129
- */
130
- export declare class ClientId extends UniffiAbstractObject {
131
- readonly [uniffiTypeNameSymbol] = "ClientId";
132
- readonly [destructorGuardSymbol]: UniffiGcObject;
133
- readonly [pointerLiteralSymbol]: UniffiHandle;
134
- /**
135
- * Create a new client id.
136
- */
137
- constructor(userId: UuidLike, deviceId: DeviceIdLike, domain: string);
138
- /**
139
- * Copy the wrapped data into a new byte array.
140
- */
141
- copyBytes(): Uint8Array;
142
- /**
143
- * Copy the wrapped data into a direct representation of the `<user-id>:<device-id>@<domain>` format.
144
- */
145
- deserialize(): DeserializedClientId;
146
- equals(other: ClientId): boolean;
147
- hashCode(): bigint;
148
- uniffiDestroy(): void;
149
- static instanceOf(obj_: any): obj_ is ClientId;
150
- }
151
- /**
152
- * The standalone status of a device credential in an MLS group at a given moment.
153
- *
154
- * This does not represent states where a device is not using MLS or end-to-end identity.
155
- */
156
- export declare enum DeviceStatus {
157
- /**
158
- * The device credential is valid.
159
- */
160
- Valid = 1,
161
- /**
162
- * The device credential's certificate has expired.
163
- */
164
- Expired = 2,
165
- /**
166
- * The device credential's certificate has been revoked.
167
- *
168
- * Note: revocation is not yet implemented.
169
- */
170
- Revoked = 3
171
- }
172
- /**
173
- * The type of credential used to authenticate an MLS client's identity.
174
- */
175
- export declare enum CredentialType {
176
- /**
177
- * A basic credential backed by a raw key pair, without any certificate infrastructure.
178
- */
179
- Basic = 1,
180
- /**
181
- * An X509 certificate credential, typically obtained through the end-to-end identity enrollment process.
182
- */
183
- X509 = 2
184
- }
185
- /**
186
- * Typealias from the type name used in the UDL file to the builtin type. This
187
- * is needed because the UDL type name is used in function/method signatures.
188
- */
189
- export type Timestamp = Date;
190
- /**
191
- * Fields from a `WireIdentity` that are specific to X509 credentials.
192
- */
193
- export type X509Identity = {
194
- /**
195
- * User handle e.g. `john_wire`
196
- */
197
- handle: string;
198
- /**
199
- * Name as displayed in the messaging application e.g. `John Fitzgerald Kennedy`
200
- */
201
- displayName: string;
202
- /**
203
- * DNS domain for which this identity proof was generated e.g. `whitehouse.gov`
204
- */
205
- domain: string;
206
- /**
207
- * PEM-encoded X509 certificate identifying this client in the MLS group.
208
- */
209
- certificate: string;
210
- /**
211
- * X509 certificate serial number
212
- */
213
- serialNumber: string;
214
- /**
215
- * Certificate validity start time (the X509 notBefore field).
216
- */
217
- notBefore: Timestamp;
218
- /**
219
- * Certificate validity end time (the X509 notAfter field).
220
- */
221
- notAfter: Timestamp;
222
- };
223
- /**
224
- * Generated factory for {@link X509Identity} record objects.
225
- */
226
- export declare const X509Identity: Readonly<{
227
- create: (partial: Partial<X509Identity> & Required<Omit<X509Identity, never>>) => X509Identity;
228
- new: (partial: Partial<X509Identity> & Required<Omit<X509Identity, never>>) => X509Identity;
229
- defaults: () => Partial<X509Identity>;
230
- }>;
231
- /**
232
- * The identity claims identifying a client.
233
- *
234
- * Those claims are verifiable by any member in the group.
235
- */
236
- export type WireIdentity = {
237
- /**
238
- * Unique client identifier e.g. `T4Coy4vdRzianwfOgXpn6A:6add501bacd1d90e@whitehouse.gov`
239
- */
240
- clientId?: ClientIdLike;
241
- /**
242
- * Status of the credential at the moment this object is created.
243
- */
244
- status: DeviceStatus;
245
- /**
246
- * MLS thumbprint
247
- */
248
- thumbprint: string;
249
- /**
250
- * Indicates whether the credential is Basic or X509.
251
- */
252
- credentialType: CredentialType;
253
- /**
254
- * The X509 certificate details; populated only when `credential_type` is X509.
255
- */
256
- x509Identity?: X509Identity;
257
- };
258
- /**
259
- * Generated factory for {@link WireIdentity} record objects.
260
- */
261
- export declare const WireIdentity: Readonly<{
262
- create: (partial: Partial<WireIdentity> & Required<Omit<WireIdentity, "clientId" | "x509Identity">>) => WireIdentity;
263
- new: (partial: Partial<WireIdentity> & Required<Omit<WireIdentity, "clientId" | "x509Identity">>) => WireIdentity;
264
- defaults: () => Partial<WireIdentity>;
265
- }>;
266
- /**
267
- * A decrypted message that was buffered due to out-of-order delivery by the distribution service.
268
- *
269
- * These are returned in the `buffered_messages` field of a `DecryptedMessage` when a commit is
270
- * processed. They represent messages for the new epoch that arrived before the commit that created it.
271
- */
272
- export type BufferedDecryptedMessage = {
273
- /**
274
- * Decrypted plaintext
275
- */
276
- message?: Uint8Array;
277
- /**
278
- * False if processing this message caused the client to be removed from the group, i.e. due to a Remove commit.
279
- */
280
- isActive: boolean;
281
- /**
282
- * Commit delay in seconds.
283
- *
284
- * When set, clients must delay this long before processing a commit.
285
- * This reduces load on the backend, which otherwise would receive epoch change notifications from all clients
286
- * simultaneously.
287
- */
288
- commitDelay?: bigint;
289
- /**
290
- * `ClientId` of the sender of the message being decrypted. Only present for application messages.
291
- */
292
- senderClientId?: ClientIdLike;
293
- /**
294
- * Identity claims present in the sender credential.
295
- */
296
- identity: WireIdentity;
297
- };
298
- /**
299
- * Generated factory for {@link BufferedDecryptedMessage} record objects.
300
- */
301
- export declare const BufferedDecryptedMessage: Readonly<{
302
- create: (partial: Partial<BufferedDecryptedMessage> & Required<Omit<BufferedDecryptedMessage, "message" | "commitDelay" | "senderClientId">>) => BufferedDecryptedMessage;
303
- new: (partial: Partial<BufferedDecryptedMessage> & Required<Omit<BufferedDecryptedMessage, "message" | "commitDelay" | "senderClientId">>) => BufferedDecryptedMessage;
304
- defaults: () => Partial<BufferedDecryptedMessage>;
305
- }>;
306
44
  /**
307
45
  * Metadata describing the conditions of the build of this software.
308
46
  */
@@ -1190,7 +928,7 @@ export declare const MlsError: Readonly<{
1190
928
  /**
1191
929
  * Errors produced by the MLS layer.
1192
930
  */
1193
- export type MlsError = InstanceType<(typeof MlsError)["ConversationAlreadyExists" | "DuplicateMessage" | "BufferedFutureMessage" | "WrongEpoch" | "BufferedCommit" | "MessageEpochTooOld" | "SelfCommitIgnored" | "UnmergedPendingGroup" | "StaleProposal" | "StaleCommit" | "OrphanWelcome" | "MessageRejected" | "Other"]>;
931
+ export type MlsError = InstanceType<typeof MlsError["ConversationAlreadyExists" | "DuplicateMessage" | "BufferedFutureMessage" | "WrongEpoch" | "BufferedCommit" | "MessageEpochTooOld" | "SelfCommitIgnored" | "UnmergedPendingGroup" | "StaleProposal" | "StaleCommit" | "OrphanWelcome" | "MessageRejected" | "Other"]>;
1194
932
  export declare enum ProteusError_Tags {
1195
933
  SessionNotFound = "SessionNotFound",
1196
934
  DuplicateMessage = "DuplicateMessage",
@@ -1459,7 +1197,7 @@ export declare const ProteusError: Readonly<{
1459
1197
  /**
1460
1198
  * Errors produced by the Proteus layer.
1461
1199
  */
1462
- export type ProteusError = InstanceType<(typeof ProteusError)["SessionNotFound" | "DuplicateMessage" | "RemoteIdentityChanged" | "Other"]>;
1200
+ export type ProteusError = InstanceType<typeof ProteusError["SessionNotFound" | "DuplicateMessage" | "RemoteIdentityChanged" | "Other"]>;
1463
1201
  export declare enum CoreCryptoError_Tags {
1464
1202
  Mls = "Mls",
1465
1203
  Proteus = "Proteus",
@@ -1916,7 +1654,7 @@ export declare const CoreCryptoError: Readonly<{
1916
1654
  /**
1917
1655
  * The primary error type returned across the CoreCrypto FFI boundary.
1918
1656
  */
1919
- export type CoreCryptoError = InstanceType<(typeof CoreCryptoError)["Mls" | "Proteus" | "E2ei" | "TransactionFailed" | "Other"]>;
1657
+ export type CoreCryptoError = InstanceType<typeof CoreCryptoError["Mls" | "Proteus" | "E2ei" | "TransactionFailed" | "Other"]>;
1920
1658
  type WelcomeLike = Welcome;
1921
1659
  /**
1922
1660
  * A TLS-serialized Welcome message.
@@ -2026,49 +1764,112 @@ export declare const CommitBundle: Readonly<{
2026
1764
  new: (partial: Partial<CommitBundle> & Required<Omit<CommitBundle, "welcome" | "encryptedMessage">>) => CommitBundle;
2027
1765
  defaults: () => Partial<CommitBundle>;
2028
1766
  }>;
1767
+ type ClientIdLike = ClientId;
2029
1768
  /**
2030
- * A decrypted message and various associated metadata.
1769
+ * A unique identifier for an MLS client.
1770
+ *
1771
+ * Each app instance a user is running, such as desktop or mobile, is a separate client
1772
+ * with its own client id. A single user may therefore have multiple clients.
1773
+ * More information: <https://messaginglayersecurity.rocks/mls-architecture/draft-ietf-mls-architecture.html#name-group-members-and-clients>
2031
1774
  */
2032
- export type DecryptedMessage = {
1775
+ export declare class ClientId extends UniffiAbstractObject {
1776
+ readonly [uniffiTypeNameSymbol] = "ClientId";
1777
+ readonly [destructorGuardSymbol]: UniffiGcObject;
1778
+ readonly [pointerLiteralSymbol]: UniffiHandle;
2033
1779
  /**
2034
- * Decrypted plaintext
1780
+ * Create a new client id.
2035
1781
  */
2036
- message?: Uint8Array;
1782
+ constructor(userId: UuidLike, deviceId: DeviceIdLike, domain: string);
2037
1783
  /**
2038
- * False if processing this message caused the client to be removed from the group, i.e. due to a Remove commit.
1784
+ * Copy the wrapped data into a new byte array.
2039
1785
  */
2040
- isActive: boolean;
1786
+ copyBytes(): Uint8Array;
2041
1787
  /**
2042
- * Commit delay in seconds.
2043
- *
2044
- * When set, clients must delay this long before processing a commit.
2045
- * This reduces load on the backend, which otherwise would receive epoch change notifications from all clients
2046
- * simultaneously.
1788
+ * Copy the wrapped data into a direct representation of the `<user-id>:<device-id>@<domain>` format.
2047
1789
  */
2048
- commitDelay?: bigint;
1790
+ deserialize(): DeserializedClientId;
1791
+ equals(other: ClientId): boolean;
1792
+ hashCode(): bigint;
1793
+ uniffiDestroy(): void;
1794
+ static instanceOf(obj_: any): obj_ is ClientId;
1795
+ }
1796
+ type UuidLike = Uuid;
1797
+ /**
1798
+ * A Uuid.
1799
+ */
1800
+ export declare class Uuid extends UniffiAbstractObject {
1801
+ readonly [uniffiTypeNameSymbol] = "Uuid";
1802
+ readonly [destructorGuardSymbol]: UniffiGcObject;
1803
+ readonly [pointerLiteralSymbol]: UniffiHandle;
2049
1804
  /**
2050
- * `ClientId` of the sender of the message being decrypted. Only present for application messages.
1805
+ * Parse a `Uuid` from a string.
2051
1806
  */
2052
- senderClientId?: ClientIdLike;
1807
+ constructor(uuid: string);
1808
+ toString(): string;
1809
+ equals(other: Uuid): boolean;
1810
+ hashCode(): bigint;
1811
+ uniffiDestroy(): void;
1812
+ static instanceOf(obj_: any): obj_ is Uuid;
1813
+ }
1814
+ type DeviceIdLike = DeviceId;
1815
+ /**
1816
+ * A Device ID.
1817
+ */
1818
+ export declare class DeviceId extends UniffiAbstractObject {
1819
+ readonly [uniffiTypeNameSymbol] = "DeviceId";
1820
+ readonly [destructorGuardSymbol]: UniffiGcObject;
1821
+ readonly [pointerLiteralSymbol]: UniffiHandle;
2053
1822
  /**
2054
- * Identity claims present in the sender credential.
1823
+ * New device id from an unsigned 64-bit integer.
2055
1824
  */
2056
- identity: WireIdentity;
1825
+ constructor(id: bigint);
2057
1826
  /**
2058
- * Only set when the decrypted message is a commit.
2059
- *
2060
- * Contains buffered messages for next epoch which were received before the commit creating the epoch
2061
- * because the DS did not fan them out in order.
1827
+ * Construct a `DeviceId` from 8 bytes encoded as a hex string.
1828
+ */
1829
+ static fromHexString(hexString: string): DeviceIdLike;
1830
+ /**
1831
+ * Encode the `DeviceId` as a 16-character lowercase hex string, with leading 0s.
1832
+ */
1833
+ toHexString(): string;
1834
+ /**
1835
+ * Get the number corresponding to this `DeviceId`.
2062
1836
  */
2063
- bufferedMessages?: Array<BufferedDecryptedMessage>;
1837
+ toU64(): bigint;
1838
+ equals(other: DeviceId): boolean;
1839
+ hashCode(): bigint;
1840
+ uniffiDestroy(): void;
1841
+ static instanceOf(obj_: any): obj_ is DeviceId;
1842
+ }
1843
+ /**
1844
+ * This directly represents a `ClientId` of the `<userid>:<device-id>@<domain>` format.
1845
+ * Instantiate via [ClientId::deserialize].
1846
+ */
1847
+ export type DeserializedClientId = {
1848
+ /**
1849
+ * The client id this was deserialized from
1850
+ */
1851
+ clientId: ClientIdLike;
1852
+ /**
1853
+ * The user id component
1854
+ */
1855
+ userId: UuidLike;
1856
+ /**
1857
+ * The device id component
1858
+ */
1859
+ deviceId: DeviceIdLike;
1860
+ /**
1861
+ * The domain
1862
+ */
1863
+ domain: string;
2064
1864
  };
2065
1865
  /**
2066
- * Generated factory for {@link DecryptedMessage} record objects.
1866
+ * Generated factory for {@link DeserializedClientId} record objects.
2067
1867
  */
2068
- export declare const DecryptedMessage: Readonly<{
2069
- create: (partial: Partial<DecryptedMessage> & Required<Omit<DecryptedMessage, "message" | "commitDelay" | "senderClientId" | "bufferedMessages">>) => DecryptedMessage;
2070
- new: (partial: Partial<DecryptedMessage> & Required<Omit<DecryptedMessage, "message" | "commitDelay" | "senderClientId" | "bufferedMessages">>) => DecryptedMessage;
2071
- defaults: () => Partial<DecryptedMessage>;
1868
+ export declare const DeserializedClientId: Readonly<{
1869
+ create: (partial: Partial<DeserializedClientId> & Required<Omit<DeserializedClientId, never>>) => DeserializedClientId;
1870
+ new: (partial: Partial<DeserializedClientId> & Required<Omit<DeserializedClientId, never>>) => DeserializedClientId;
1871
+ defaults: () => Partial<DeserializedClientId>;
1872
+ toString(self_: DeserializedClientId): string;
2072
1873
  }>;
2073
1874
  /**
2074
1875
  * A `HistorySecret` encodes sufficient client state that it can be used to instantiate an
@@ -2159,6 +1960,121 @@ export declare const ProteusAutoPrekeyBundle: Readonly<{
2159
1960
  new: (partial: Partial<ProteusAutoPrekeyBundle> & Required<Omit<ProteusAutoPrekeyBundle, never>>) => ProteusAutoPrekeyBundle;
2160
1961
  defaults: () => Partial<ProteusAutoPrekeyBundle>;
2161
1962
  }>;
1963
+ /**
1964
+ * The standalone status of a device credential in an MLS group at a given moment.
1965
+ *
1966
+ * This does not represent states where a device is not using MLS or end-to-end identity.
1967
+ */
1968
+ export declare enum DeviceStatus {
1969
+ /**
1970
+ * The device credential is valid.
1971
+ */
1972
+ Valid = 1,
1973
+ /**
1974
+ * The device credential's certificate has expired.
1975
+ */
1976
+ Expired = 2,
1977
+ /**
1978
+ * The device credential's certificate has been revoked.
1979
+ *
1980
+ * Note: revocation is not yet implemented.
1981
+ */
1982
+ Revoked = 3
1983
+ }
1984
+ /**
1985
+ * The type of credential used to authenticate an MLS client's identity.
1986
+ */
1987
+ export declare enum CredentialType {
1988
+ /**
1989
+ * A basic credential backed by a raw key pair, without any certificate infrastructure.
1990
+ */
1991
+ Basic = 1,
1992
+ /**
1993
+ * An X509 certificate credential, typically obtained through the end-to-end identity enrollment process.
1994
+ */
1995
+ X509 = 2
1996
+ }
1997
+ /**
1998
+ * Typealias from the type name used in the UDL file to the builtin type. This
1999
+ * is needed because the UDL type name is used in function/method signatures.
2000
+ */
2001
+ export type Timestamp = Date;
2002
+ /**
2003
+ * Fields from a `WireIdentity` that are specific to X509 credentials.
2004
+ */
2005
+ export type X509Identity = {
2006
+ /**
2007
+ * User handle e.g. `john_wire`
2008
+ */
2009
+ handle: string;
2010
+ /**
2011
+ * Name as displayed in the messaging application e.g. `John Fitzgerald Kennedy`
2012
+ */
2013
+ displayName: string;
2014
+ /**
2015
+ * DNS domain for which this identity proof was generated e.g. `whitehouse.gov`
2016
+ */
2017
+ domain: string;
2018
+ /**
2019
+ * PEM-encoded X509 certificate identifying this client in the MLS group.
2020
+ */
2021
+ certificate: string;
2022
+ /**
2023
+ * X509 certificate serial number
2024
+ */
2025
+ serialNumber: string;
2026
+ /**
2027
+ * Certificate validity start time (the X509 notBefore field).
2028
+ */
2029
+ notBefore: Timestamp;
2030
+ /**
2031
+ * Certificate validity end time (the X509 notAfter field).
2032
+ */
2033
+ notAfter: Timestamp;
2034
+ };
2035
+ /**
2036
+ * Generated factory for {@link X509Identity} record objects.
2037
+ */
2038
+ export declare const X509Identity: Readonly<{
2039
+ create: (partial: Partial<X509Identity> & Required<Omit<X509Identity, never>>) => X509Identity;
2040
+ new: (partial: Partial<X509Identity> & Required<Omit<X509Identity, never>>) => X509Identity;
2041
+ defaults: () => Partial<X509Identity>;
2042
+ }>;
2043
+ /**
2044
+ * The identity claims identifying a client.
2045
+ *
2046
+ * Those claims are verifiable by any member in the group.
2047
+ */
2048
+ export type WireIdentity = {
2049
+ /**
2050
+ * Unique client identifier e.g. `T4Coy4vdRzianwfOgXpn6A:6add501bacd1d90e@whitehouse.gov`
2051
+ */
2052
+ clientId?: ClientIdLike;
2053
+ /**
2054
+ * Status of the credential at the moment this object is created.
2055
+ */
2056
+ status: DeviceStatus;
2057
+ /**
2058
+ * MLS thumbprint
2059
+ */
2060
+ thumbprint: string;
2061
+ /**
2062
+ * Indicates whether the credential is Basic or X509.
2063
+ */
2064
+ credentialType: CredentialType;
2065
+ /**
2066
+ * The X509 certificate details; populated only when `credential_type` is X509.
2067
+ */
2068
+ x509Identity?: X509Identity;
2069
+ };
2070
+ /**
2071
+ * Generated factory for {@link WireIdentity} record objects.
2072
+ */
2073
+ export declare const WireIdentity: Readonly<{
2074
+ create: (partial: Partial<WireIdentity> & Required<Omit<WireIdentity, "clientId" | "x509Identity">>) => WireIdentity;
2075
+ new: (partial: Partial<WireIdentity> & Required<Omit<WireIdentity, "clientId" | "x509Identity">>) => WireIdentity;
2076
+ defaults: () => Partial<WireIdentity>;
2077
+ }>;
2162
2078
  /**
2163
2079
  * MLS cipher suites
2164
2080
  */
@@ -2237,6 +2153,160 @@ export declare const X509CredentialAcquisitionConfiguration: Readonly<{
2237
2153
  new: (partial: Partial<X509CredentialAcquisitionConfiguration> & Required<Omit<X509CredentialAcquisitionConfiguration, "team">>) => X509CredentialAcquisitionConfiguration;
2238
2154
  defaults: () => Partial<X509CredentialAcquisitionConfiguration>;
2239
2155
  }>;
2156
+ declare enum BufferedDecryptedMessage_Tags {
2157
+ Text = "Text",
2158
+ Commit = "Commit",
2159
+ Proposal = "Proposal"
2160
+ }
2161
+ /**
2162
+ * A decrypted message that was buffered due to out-of-order delivery by the delivery service.
2163
+ * It represents messages for the new epoch that arrived before the commit that created it.
2164
+ */
2165
+ export declare const BufferedDecryptedMessage: Readonly<{
2166
+ instanceOf: (obj: any) => obj is BufferedDecryptedMessage;
2167
+ Text: {
2168
+ new (inner: {
2169
+ plaintext: Uint8Array;
2170
+ senderClientId: ClientIdLike;
2171
+ identity: WireIdentity;
2172
+ }): {
2173
+ readonly tag: BufferedDecryptedMessage_Tags.Text;
2174
+ readonly inner: Readonly<{
2175
+ plaintext: Uint8Array;
2176
+ senderClientId: ClientIdLike;
2177
+ identity: WireIdentity;
2178
+ }>;
2179
+ /**
2180
+ * @private
2181
+ * This field is private and should not be used, use `tag` instead.
2182
+ */
2183
+ readonly [uniffiTypeNameSymbol]: "BufferedDecryptedMessage";
2184
+ };
2185
+ "new"(inner: {
2186
+ plaintext: Uint8Array;
2187
+ senderClientId: ClientIdLike;
2188
+ identity: WireIdentity;
2189
+ }): {
2190
+ readonly tag: BufferedDecryptedMessage_Tags.Text;
2191
+ readonly inner: Readonly<{
2192
+ plaintext: Uint8Array;
2193
+ senderClientId: ClientIdLike;
2194
+ identity: WireIdentity;
2195
+ }>;
2196
+ /**
2197
+ * @private
2198
+ * This field is private and should not be used, use `tag` instead.
2199
+ */
2200
+ readonly [uniffiTypeNameSymbol]: "BufferedDecryptedMessage";
2201
+ };
2202
+ instanceOf(obj: any): obj is {
2203
+ readonly tag: BufferedDecryptedMessage_Tags.Text;
2204
+ readonly inner: Readonly<{
2205
+ plaintext: Uint8Array;
2206
+ senderClientId: ClientIdLike;
2207
+ identity: WireIdentity;
2208
+ }>;
2209
+ /**
2210
+ * @private
2211
+ * This field is private and should not be used, use `tag` instead.
2212
+ */
2213
+ readonly [uniffiTypeNameSymbol]: "BufferedDecryptedMessage";
2214
+ };
2215
+ };
2216
+ Commit: {
2217
+ new (inner: {
2218
+ isActive: boolean;
2219
+ identity: WireIdentity;
2220
+ }): {
2221
+ readonly tag: BufferedDecryptedMessage_Tags.Commit;
2222
+ readonly inner: Readonly<{
2223
+ isActive: boolean;
2224
+ identity: WireIdentity;
2225
+ }>;
2226
+ /**
2227
+ * @private
2228
+ * This field is private and should not be used, use `tag` instead.
2229
+ */
2230
+ readonly [uniffiTypeNameSymbol]: "BufferedDecryptedMessage";
2231
+ };
2232
+ "new"(inner: {
2233
+ isActive: boolean;
2234
+ identity: WireIdentity;
2235
+ }): {
2236
+ readonly tag: BufferedDecryptedMessage_Tags.Commit;
2237
+ readonly inner: Readonly<{
2238
+ isActive: boolean;
2239
+ identity: WireIdentity;
2240
+ }>;
2241
+ /**
2242
+ * @private
2243
+ * This field is private and should not be used, use `tag` instead.
2244
+ */
2245
+ readonly [uniffiTypeNameSymbol]: "BufferedDecryptedMessage";
2246
+ };
2247
+ instanceOf(obj: any): obj is {
2248
+ readonly tag: BufferedDecryptedMessage_Tags.Commit;
2249
+ readonly inner: Readonly<{
2250
+ isActive: boolean;
2251
+ identity: WireIdentity;
2252
+ }>;
2253
+ /**
2254
+ * @private
2255
+ * This field is private and should not be used, use `tag` instead.
2256
+ */
2257
+ readonly [uniffiTypeNameSymbol]: "BufferedDecryptedMessage";
2258
+ };
2259
+ };
2260
+ Proposal: {
2261
+ new (inner: {
2262
+ delay?: bigint;
2263
+ identity: WireIdentity;
2264
+ }): {
2265
+ readonly tag: BufferedDecryptedMessage_Tags.Proposal;
2266
+ readonly inner: Readonly<{
2267
+ delay?: bigint;
2268
+ identity: WireIdentity;
2269
+ }>;
2270
+ /**
2271
+ * @private
2272
+ * This field is private and should not be used, use `tag` instead.
2273
+ */
2274
+ readonly [uniffiTypeNameSymbol]: "BufferedDecryptedMessage";
2275
+ };
2276
+ "new"(inner: {
2277
+ delay?: bigint;
2278
+ identity: WireIdentity;
2279
+ }): {
2280
+ readonly tag: BufferedDecryptedMessage_Tags.Proposal;
2281
+ readonly inner: Readonly<{
2282
+ delay?: bigint;
2283
+ identity: WireIdentity;
2284
+ }>;
2285
+ /**
2286
+ * @private
2287
+ * This field is private and should not be used, use `tag` instead.
2288
+ */
2289
+ readonly [uniffiTypeNameSymbol]: "BufferedDecryptedMessage";
2290
+ };
2291
+ instanceOf(obj: any): obj is {
2292
+ readonly tag: BufferedDecryptedMessage_Tags.Proposal;
2293
+ readonly inner: Readonly<{
2294
+ delay?: bigint;
2295
+ identity: WireIdentity;
2296
+ }>;
2297
+ /**
2298
+ * @private
2299
+ * This field is private and should not be used, use `tag` instead.
2300
+ */
2301
+ readonly [uniffiTypeNameSymbol]: "BufferedDecryptedMessage";
2302
+ };
2303
+ };
2304
+ }>;
2305
+ /**
2306
+ * A decrypted message that was buffered due to out-of-order delivery by the delivery service.
2307
+ * It represents messages for the new epoch that arrived before the commit that created it.
2308
+ */
2309
+ export type BufferedDecryptedMessage = InstanceType<typeof BufferedDecryptedMessage["Text" | "Commit" | "Proposal"]>;
2240
2310
  /**
2241
2311
  * Defines the log level for CoreCrypto.
2242
2312
  */
@@ -2248,6 +2318,163 @@ export declare enum CoreCryptoLogLevel {
2248
2318
  Warn = 5,
2249
2319
  Error = 6
2250
2320
  }
2321
+ declare enum DecryptedMessage_Tags {
2322
+ Text = "Text",
2323
+ Commit = "Commit",
2324
+ Proposal = "Proposal"
2325
+ }
2326
+ /**
2327
+ * Represents the items a consumer might require after decrypting a message.
2328
+ */
2329
+ export declare const DecryptedMessage: Readonly<{
2330
+ instanceOf: (obj: any) => obj is DecryptedMessage;
2331
+ Text: {
2332
+ new (inner: {
2333
+ plaintext: Uint8Array;
2334
+ senderClientId: ClientIdLike;
2335
+ identity: WireIdentity;
2336
+ }): {
2337
+ readonly tag: DecryptedMessage_Tags.Text;
2338
+ readonly inner: Readonly<{
2339
+ plaintext: Uint8Array;
2340
+ senderClientId: ClientIdLike;
2341
+ identity: WireIdentity;
2342
+ }>;
2343
+ /**
2344
+ * @private
2345
+ * This field is private and should not be used, use `tag` instead.
2346
+ */
2347
+ readonly [uniffiTypeNameSymbol]: "DecryptedMessage";
2348
+ };
2349
+ "new"(inner: {
2350
+ plaintext: Uint8Array;
2351
+ senderClientId: ClientIdLike;
2352
+ identity: WireIdentity;
2353
+ }): {
2354
+ readonly tag: DecryptedMessage_Tags.Text;
2355
+ readonly inner: Readonly<{
2356
+ plaintext: Uint8Array;
2357
+ senderClientId: ClientIdLike;
2358
+ identity: WireIdentity;
2359
+ }>;
2360
+ /**
2361
+ * @private
2362
+ * This field is private and should not be used, use `tag` instead.
2363
+ */
2364
+ readonly [uniffiTypeNameSymbol]: "DecryptedMessage";
2365
+ };
2366
+ instanceOf(obj: any): obj is {
2367
+ readonly tag: DecryptedMessage_Tags.Text;
2368
+ readonly inner: Readonly<{
2369
+ plaintext: Uint8Array;
2370
+ senderClientId: ClientIdLike;
2371
+ identity: WireIdentity;
2372
+ }>;
2373
+ /**
2374
+ * @private
2375
+ * This field is private and should not be used, use `tag` instead.
2376
+ */
2377
+ readonly [uniffiTypeNameSymbol]: "DecryptedMessage";
2378
+ };
2379
+ };
2380
+ Commit: {
2381
+ new (inner: {
2382
+ isActive: boolean;
2383
+ bufferedMessages?: Array<BufferedDecryptedMessage>;
2384
+ identity: WireIdentity;
2385
+ }): {
2386
+ readonly tag: DecryptedMessage_Tags.Commit;
2387
+ readonly inner: Readonly<{
2388
+ isActive: boolean;
2389
+ bufferedMessages?: Array<BufferedDecryptedMessage>;
2390
+ identity: WireIdentity;
2391
+ }>;
2392
+ /**
2393
+ * @private
2394
+ * This field is private and should not be used, use `tag` instead.
2395
+ */
2396
+ readonly [uniffiTypeNameSymbol]: "DecryptedMessage";
2397
+ };
2398
+ "new"(inner: {
2399
+ isActive: boolean;
2400
+ bufferedMessages?: Array<BufferedDecryptedMessage>;
2401
+ identity: WireIdentity;
2402
+ }): {
2403
+ readonly tag: DecryptedMessage_Tags.Commit;
2404
+ readonly inner: Readonly<{
2405
+ isActive: boolean;
2406
+ bufferedMessages?: Array<BufferedDecryptedMessage>;
2407
+ identity: WireIdentity;
2408
+ }>;
2409
+ /**
2410
+ * @private
2411
+ * This field is private and should not be used, use `tag` instead.
2412
+ */
2413
+ readonly [uniffiTypeNameSymbol]: "DecryptedMessage";
2414
+ };
2415
+ instanceOf(obj: any): obj is {
2416
+ readonly tag: DecryptedMessage_Tags.Commit;
2417
+ readonly inner: Readonly<{
2418
+ isActive: boolean;
2419
+ bufferedMessages?: Array<BufferedDecryptedMessage>;
2420
+ identity: WireIdentity;
2421
+ }>;
2422
+ /**
2423
+ * @private
2424
+ * This field is private and should not be used, use `tag` instead.
2425
+ */
2426
+ readonly [uniffiTypeNameSymbol]: "DecryptedMessage";
2427
+ };
2428
+ };
2429
+ Proposal: {
2430
+ new (inner: {
2431
+ delay?: bigint;
2432
+ identity: WireIdentity;
2433
+ }): {
2434
+ readonly tag: DecryptedMessage_Tags.Proposal;
2435
+ readonly inner: Readonly<{
2436
+ delay?: bigint;
2437
+ identity: WireIdentity;
2438
+ }>;
2439
+ /**
2440
+ * @private
2441
+ * This field is private and should not be used, use `tag` instead.
2442
+ */
2443
+ readonly [uniffiTypeNameSymbol]: "DecryptedMessage";
2444
+ };
2445
+ "new"(inner: {
2446
+ delay?: bigint;
2447
+ identity: WireIdentity;
2448
+ }): {
2449
+ readonly tag: DecryptedMessage_Tags.Proposal;
2450
+ readonly inner: Readonly<{
2451
+ delay?: bigint;
2452
+ identity: WireIdentity;
2453
+ }>;
2454
+ /**
2455
+ * @private
2456
+ * This field is private and should not be used, use `tag` instead.
2457
+ */
2458
+ readonly [uniffiTypeNameSymbol]: "DecryptedMessage";
2459
+ };
2460
+ instanceOf(obj: any): obj is {
2461
+ readonly tag: DecryptedMessage_Tags.Proposal;
2462
+ readonly inner: Readonly<{
2463
+ delay?: bigint;
2464
+ identity: WireIdentity;
2465
+ }>;
2466
+ /**
2467
+ * @private
2468
+ * This field is private and should not be used, use `tag` instead.
2469
+ */
2470
+ readonly [uniffiTypeNameSymbol]: "DecryptedMessage";
2471
+ };
2472
+ };
2473
+ }>;
2474
+ /**
2475
+ * Represents the items a consumer might require after decrypting a message.
2476
+ */
2477
+ export type DecryptedMessage = InstanceType<typeof DecryptedMessage["Text" | "Commit" | "Proposal"]>;
2251
2478
  /**
2252
2479
  * The end-to-end identity verification state of a conversation.
2253
2480
  *
@@ -2323,7 +2550,7 @@ export declare const EpochChangedReportingError: {
2323
2550
  /**
2324
2551
  * An error returned by an `EpochObserver` callback implementation.
2325
2552
  */
2326
- export type EpochChangedReportingError = InstanceType<(typeof EpochChangedReportingError)["Ffi"]>;
2553
+ export type EpochChangedReportingError = InstanceType<typeof EpochChangedReportingError["Ffi"]>;
2327
2554
  /**
2328
2555
  * HttpMethod used for PKI hooks.
2329
2556
  */
@@ -2406,7 +2633,7 @@ export declare const LoggingError: {
2406
2633
  /**
2407
2634
  * An error returned by a `CoreCryptoLogger` callback implementation.
2408
2635
  */
2409
- export type LoggingError = InstanceType<(typeof LoggingError)["Ffi"]>;
2636
+ export type LoggingError = InstanceType<typeof LoggingError["Ffi"]>;
2410
2637
  declare enum MlsTransportError_Tags {
2411
2638
  MessageRejected = "MessageRejected"
2412
2639
  }
@@ -2507,7 +2734,7 @@ export declare const MlsTransportError: Readonly<{
2507
2734
  /**
2508
2735
  * Errors returned by MLS transport callbacks exposed through FFI.
2509
2736
  */
2510
- export type MlsTransportError = InstanceType<(typeof MlsTransportError)["MessageRejected"]>;
2737
+ export type MlsTransportError = InstanceType<typeof MlsTransportError["MessageRejected"]>;
2511
2738
  declare enum NewHistoryClientReportingError_Tags {
2512
2739
  Ffi = "Ffi"
2513
2740
  }
@@ -2561,7 +2788,7 @@ export declare const NewHistoryClientReportingError: {
2561
2788
  /**
2562
2789
  * An error returned by a `HistoryObserver` callback implementation.
2563
2790
  */
2564
- export type NewHistoryClientReportingError = InstanceType<(typeof NewHistoryClientReportingError)["Ffi"]>;
2791
+ export type NewHistoryClientReportingError = InstanceType<typeof NewHistoryClientReportingError["Ffi"]>;
2565
2792
  declare enum PkiEnvironmentHooksError_Tags {
2566
2793
  Error = "Error"
2567
2794
  }
@@ -2662,7 +2889,7 @@ export declare const PkiEnvironmentHooksError: Readonly<{
2662
2889
  /**
2663
2890
  * An error returned by a `PkiEnvironmentHooks` callback implementation.
2664
2891
  */
2665
- export type PkiEnvironmentHooksError = InstanceType<(typeof PkiEnvironmentHooksError)["Error"]>;
2892
+ export type PkiEnvironmentHooksError = InstanceType<typeof PkiEnvironmentHooksError["Error"]>;
2666
2893
  /**
2667
2894
  * Signature schemes supported by MLS, as defined in RFC 9420.
2668
2895
  */
@@ -2688,6 +2915,16 @@ export declare enum SignatureScheme {
2688
2915
  */
2689
2916
  Ed448 = 2056
2690
2917
  }
2918
+ declare enum TargetedMessagePolicy {
2919
+ /**
2920
+ * Won't be persisted and will only be visible to currently online members who immediately process it.
2921
+ */
2922
+ Transient = 0,
2923
+ /**
2924
+ * May be persisted and buffered, will also be delivered and processed by currently offline members.
2925
+ */
2926
+ Persisted = 1
2927
+ }
2691
2928
  /**
2692
2929
  * Typealias from the type name used in the UDL file to the builtin type. This
2693
2930
  * is needed because the UDL type name is used in function/method signatures.
@@ -3085,6 +3322,15 @@ declare class CoreCryptoContext extends UniffiAbstractObject {
3085
3322
  encryptMessage(conversationId: ConversationIdLike, message: Uint8Array, asyncOpts_?: {
3086
3323
  signal: AbortSignal;
3087
3324
  }): Promise<Uint8Array>;
3325
+ /**
3326
+ * Encrypts a plaintext message for one member of the given conversation.
3327
+ *
3328
+ * Any feature using a targeted, transient or transient targeted message MUST specify why the lower security
3329
+ * guarantees (compared to MLS application messages) are acceptable and/or how they are mitigated.
3330
+ */
3331
+ encryptTargetedMessage(conversationId: ConversationIdLike, recipient: ClientIdLike, policy: TargetedMessagePolicy, message: Uint8Array, asyncOpts_?: {
3332
+ signal: AbortSignal;
3333
+ }): Promise<Uint8Array>;
3088
3334
  /**
3089
3335
  * Derives and exports a secret of `key_length` bytes for the given conversation.
3090
3336
  *
@@ -3374,13 +3620,23 @@ export declare class PkiEnvironment extends UniffiAbstractObject {
3374
3620
  }): Promise<void>;
3375
3621
  /**
3376
3622
  * Add a PEM-encoded certificate as a trust anchor.
3377
- *
3378
- * NOTE: currently we only support storing a single trust anchor, calling this method multiple
3379
- * times will overwrite any previously added trust anchor.
3380
3623
  */
3381
3624
  addTrustAnchor(certPem: string, asyncOpts_?: {
3382
3625
  signal: AbortSignal;
3383
3626
  }): Promise<void>;
3627
+ /**
3628
+ * Get all trust anchors as PEM-encoded certificates.
3629
+ */
3630
+ getTrustAnchors(asyncOpts_?: {
3631
+ signal: AbortSignal;
3632
+ }): Promise<Array<string>>;
3633
+ /**
3634
+ * Remove a trust anchor by providing the certificates Subject Public Key Info (SPKI) fingerprint as bytes.
3635
+ * Trying to remove trust anchor that doesn't exist in the database will just succeed.
3636
+ */
3637
+ removeTrustAnchor(fingerprint: Uint8Array, asyncOpts_?: {
3638
+ signal: AbortSignal;
3639
+ }): Promise<void>;
3384
3640
  uniffiDestroy(): void;
3385
3641
  static instanceOf(obj_: any): obj_ is PkiEnvironment;
3386
3642
  }