@signalapp/libsignal-client 0.88.3 → 0.89.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/AccountKeys.d.ts +8 -8
- package/dist/AccountKeys.js +4 -2
- package/dist/Address.d.ts +8 -8
- package/dist/Address.js +7 -2
- package/dist/EcKeys.d.ts +14 -14
- package/dist/EcKeys.js +4 -0
- package/dist/Errors.d.ts +7 -3
- package/dist/Errors.js +8 -0
- package/dist/MessageBackup.d.ts +8 -8
- package/dist/MessageBackup.js +13 -0
- package/dist/Minidump.d.ts +1 -1
- package/dist/Mp4Sanitizer.d.ts +1 -1
- package/dist/Mp4Sanitizer.js +1 -0
- package/dist/Native.d.ts +24 -19
- package/dist/Native.js +3 -3
- package/dist/ProtocolTypes.d.ts +45 -0
- package/dist/ProtocolTypes.js +106 -0
- package/dist/SealedSenderMultiRecipientMessage.d.ts +3 -3
- package/dist/SealedSenderMultiRecipientMessage.js +4 -0
- package/dist/WebpSanitizer.d.ts +1 -1
- package/dist/acknowledgments.md +1 -1
- package/dist/incremental_mac.d.ts +5 -7
- package/dist/incremental_mac.js +7 -5
- package/dist/index.d.ts +85 -129
- package/dist/index.js +66 -128
- package/dist/internal.js +1 -0
- package/dist/io.d.ts +2 -2
- package/dist/net/Chat.d.ts +3 -3
- package/dist/net/Chat.js +14 -0
- package/dist/net/FakeChat.d.ts +4 -4
- package/dist/net/FakeChat.js +4 -0
- package/dist/net/KeyTransparency.d.ts +7 -7
- package/dist/net/KeyTransparency.js +3 -0
- package/dist/net/Registration.d.ts +4 -4
- package/dist/net/Registration.js +5 -0
- package/dist/net/SvrB.d.ts +6 -6
- package/dist/net/SvrB.js +6 -0
- package/dist/net/chat/UnauthKeysService.d.ts +30 -0
- package/dist/net/chat/UnauthKeysService.js +20 -0
- package/dist/net/chat/UnauthMessagesService.d.ts +1 -1
- package/dist/net/chat/UnauthMessagesService.js +1 -0
- package/dist/net/chat/UnauthUsernamesService.d.ts +3 -3
- package/dist/net/chat/UnauthUsernamesService.js +2 -2
- package/dist/net.d.ts +4 -3
- package/dist/net.js +7 -1
- package/dist/usernames.d.ts +8 -8
- package/dist/uuid.d.ts +1 -0
- package/dist/uuid.js +5 -1
- package/dist/zkgroup/GenericServerPublicParams.d.ts +1 -1
- package/dist/zkgroup/GenericServerPublicParams.js +1 -0
- package/dist/zkgroup/GenericServerSecretParams.d.ts +2 -2
- package/dist/zkgroup/GenericServerSecretParams.js +1 -0
- package/dist/zkgroup/NotarySignature.d.ts +1 -1
- package/dist/zkgroup/NotarySignature.js +3 -3
- package/dist/zkgroup/ServerPublicParams.d.ts +4 -4
- package/dist/zkgroup/ServerPublicParams.js +1 -0
- package/dist/zkgroup/ServerSecretParams.d.ts +5 -5
- package/dist/zkgroup/ServerSecretParams.js +1 -0
- package/dist/zkgroup/auth/AuthCredentialPresentation.d.ts +1 -1
- package/dist/zkgroup/auth/AuthCredentialPresentation.js +1 -0
- package/dist/zkgroup/auth/AuthCredentialWithPni.d.ts +1 -1
- package/dist/zkgroup/auth/AuthCredentialWithPni.js +1 -0
- package/dist/zkgroup/auth/AuthCredentialWithPniResponse.d.ts +1 -1
- package/dist/zkgroup/auth/AuthCredentialWithPniResponse.js +1 -0
- package/dist/zkgroup/auth/ClientZkAuthOperations.d.ts +1 -1
- package/dist/zkgroup/auth/ClientZkAuthOperations.js +1 -0
- package/dist/zkgroup/auth/ServerZkAuthOperations.d.ts +1 -1
- package/dist/zkgroup/auth/ServerZkAuthOperations.js +1 -0
- package/dist/zkgroup/backups/BackupAuthCredential.d.ts +3 -3
- package/dist/zkgroup/backups/BackupAuthCredential.js +1 -0
- package/dist/zkgroup/backups/BackupAuthCredentialPresentation.d.ts +2 -2
- package/dist/zkgroup/backups/BackupAuthCredentialPresentation.js +1 -0
- package/dist/zkgroup/backups/BackupAuthCredentialRequest.d.ts +2 -2
- package/dist/zkgroup/backups/BackupAuthCredentialRequest.js +1 -0
- package/dist/zkgroup/backups/BackupAuthCredentialRequestContext.d.ts +3 -3
- package/dist/zkgroup/backups/BackupAuthCredentialRequestContext.js +3 -2
- package/dist/zkgroup/backups/BackupAuthCredentialResponse.d.ts +1 -1
- package/dist/zkgroup/backups/BackupAuthCredentialResponse.js +1 -0
- package/dist/zkgroup/calllinks/CallLinkAuthCredential.d.ts +2 -2
- package/dist/zkgroup/calllinks/CallLinkAuthCredential.js +1 -0
- package/dist/zkgroup/calllinks/CallLinkAuthCredentialPresentation.d.ts +1 -1
- package/dist/zkgroup/calllinks/CallLinkAuthCredentialPresentation.js +1 -0
- package/dist/zkgroup/calllinks/CallLinkAuthCredentialResponse.d.ts +2 -2
- package/dist/zkgroup/calllinks/CallLinkAuthCredentialResponse.js +1 -0
- package/dist/zkgroup/calllinks/CallLinkPublicParams.d.ts +1 -1
- package/dist/zkgroup/calllinks/CallLinkPublicParams.js +1 -0
- package/dist/zkgroup/calllinks/CallLinkSecretParams.d.ts +2 -2
- package/dist/zkgroup/calllinks/CallLinkSecretParams.js +1 -0
- package/dist/zkgroup/calllinks/CreateCallLinkCredential.d.ts +3 -3
- package/dist/zkgroup/calllinks/CreateCallLinkCredential.js +1 -0
- package/dist/zkgroup/calllinks/CreateCallLinkCredentialPresentation.d.ts +2 -2
- package/dist/zkgroup/calllinks/CreateCallLinkCredentialPresentation.js +1 -0
- package/dist/zkgroup/calllinks/CreateCallLinkCredentialRequest.d.ts +2 -2
- package/dist/zkgroup/calllinks/CreateCallLinkCredentialRequest.js +1 -0
- package/dist/zkgroup/calllinks/CreateCallLinkCredentialRequestContext.d.ts +3 -3
- package/dist/zkgroup/calllinks/CreateCallLinkCredentialRequestContext.js +1 -0
- package/dist/zkgroup/calllinks/CreateCallLinkCredentialResponse.d.ts +1 -1
- package/dist/zkgroup/calllinks/CreateCallLinkCredentialResponse.js +1 -0
- package/dist/zkgroup/groups/ClientZkGroupCipher.d.ts +3 -3
- package/dist/zkgroup/groups/ClientZkGroupCipher.js +1 -0
- package/dist/zkgroup/groups/GroupIdentifier.d.ts +1 -1
- package/dist/zkgroup/groups/GroupIdentifier.js +3 -3
- package/dist/zkgroup/groups/GroupMasterKey.d.ts +1 -1
- package/dist/zkgroup/groups/GroupMasterKey.js +3 -3
- package/dist/zkgroup/groups/GroupPublicParams.d.ts +1 -1
- package/dist/zkgroup/groups/GroupPublicParams.js +1 -0
- package/dist/zkgroup/groups/GroupSecretParams.d.ts +2 -2
- package/dist/zkgroup/groups/GroupSecretParams.js +1 -0
- package/dist/zkgroup/groups/ProfileKeyCiphertext.d.ts +1 -1
- package/dist/zkgroup/groups/ProfileKeyCiphertext.js +1 -0
- package/dist/zkgroup/groups/UuidCiphertext.d.ts +2 -2
- package/dist/zkgroup/groups/UuidCiphertext.js +1 -0
- package/dist/zkgroup/groupsend/GroupSendDerivedKeyPair.d.ts +1 -1
- package/dist/zkgroup/groupsend/GroupSendEndorsement.d.ts +1 -1
- package/dist/zkgroup/groupsend/GroupSendEndorsementsResponse.d.ts +2 -2
- package/dist/zkgroup/groupsend/GroupSendFullToken.d.ts +1 -1
- package/dist/zkgroup/groupsend/GroupSendToken.d.ts +1 -1
- package/dist/zkgroup/internal/ByteArray.d.ts +5 -5
- package/dist/zkgroup/internal/ByteArray.js +1 -0
- package/dist/zkgroup/profiles/ClientZkProfileOperations.d.ts +2 -2
- package/dist/zkgroup/profiles/ClientZkProfileOperations.js +1 -0
- package/dist/zkgroup/profiles/ExpiringProfileKeyCredential.d.ts +1 -1
- package/dist/zkgroup/profiles/ExpiringProfileKeyCredential.js +1 -0
- package/dist/zkgroup/profiles/ExpiringProfileKeyCredentialResponse.d.ts +1 -1
- package/dist/zkgroup/profiles/ExpiringProfileKeyCredentialResponse.js +1 -0
- package/dist/zkgroup/profiles/ProfileKey.d.ts +2 -2
- package/dist/zkgroup/profiles/ProfileKey.js +3 -3
- package/dist/zkgroup/profiles/ProfileKeyCommitment.d.ts +1 -1
- package/dist/zkgroup/profiles/ProfileKeyCommitment.js +1 -0
- package/dist/zkgroup/profiles/ProfileKeyCredentialPresentation.d.ts +1 -1
- package/dist/zkgroup/profiles/ProfileKeyCredentialPresentation.js +1 -0
- package/dist/zkgroup/profiles/ProfileKeyCredentialRequest.d.ts +1 -1
- package/dist/zkgroup/profiles/ProfileKeyCredentialRequest.js +1 -0
- package/dist/zkgroup/profiles/ProfileKeyCredentialRequestContext.d.ts +1 -1
- package/dist/zkgroup/profiles/ProfileKeyCredentialRequestContext.js +1 -0
- package/dist/zkgroup/profiles/ProfileKeyVersion.d.ts +1 -1
- package/dist/zkgroup/profiles/ProfileKeyVersion.js +3 -3
- package/dist/zkgroup/profiles/ServerZkProfileOperations.d.ts +1 -1
- package/dist/zkgroup/profiles/ServerZkProfileOperations.js +1 -0
- package/dist/zkgroup/receipts/ClientZkReceiptOperations.d.ts +2 -2
- package/dist/zkgroup/receipts/ClientZkReceiptOperations.js +1 -0
- package/dist/zkgroup/receipts/ReceiptCredential.d.ts +1 -1
- package/dist/zkgroup/receipts/ReceiptCredential.js +1 -0
- package/dist/zkgroup/receipts/ReceiptCredentialPresentation.d.ts +1 -1
- package/dist/zkgroup/receipts/ReceiptCredentialPresentation.js +3 -3
- package/dist/zkgroup/receipts/ReceiptCredentialRequest.d.ts +1 -1
- package/dist/zkgroup/receipts/ReceiptCredentialRequest.js +1 -0
- package/dist/zkgroup/receipts/ReceiptCredentialRequestContext.d.ts +1 -1
- package/dist/zkgroup/receipts/ReceiptCredentialRequestContext.js +3 -3
- package/dist/zkgroup/receipts/ReceiptCredentialResponse.d.ts +1 -1
- package/dist/zkgroup/receipts/ReceiptCredentialResponse.js +1 -0
- package/dist/zkgroup/receipts/ReceiptSerial.d.ts +1 -1
- package/dist/zkgroup/receipts/ReceiptSerial.js +3 -3
- package/dist/zkgroup/receipts/ServerZkReceiptOperations.d.ts +1 -1
- package/dist/zkgroup/receipts/ServerZkReceiptOperations.js +1 -0
- package/package.json +3 -3
- package/prebuilds/darwin-arm64/@signalapp+libsignal-client.node +0 -0
- package/prebuilds/darwin-x64/@signalapp+libsignal-client.node +0 -0
- package/prebuilds/linux-arm64/@signalapp+libsignal-client.node +0 -0
- package/prebuilds/linux-x64/@signalapp+libsignal-client.node +0 -0
- package/prebuilds/win32-arm64/@signalapp+libsignal-client.node +0 -0
- package/prebuilds/win32-x64/@signalapp+libsignal-client.node +0 -0
package/dist/net/Registration.js
CHANGED
|
@@ -12,6 +12,8 @@ import { FakeChatRemote } from './FakeChat.js';
|
|
|
12
12
|
* This wraps a {@link Net} to provide a reliable registration service client.
|
|
13
13
|
*/
|
|
14
14
|
export class RegistrationService {
|
|
15
|
+
_nativeHandle;
|
|
16
|
+
tokioAsyncContext;
|
|
15
17
|
constructor(_nativeHandle, tokioAsyncContext) {
|
|
16
18
|
this._nativeHandle = _nativeHandle;
|
|
17
19
|
this.tokioAsyncContext = tokioAsyncContext;
|
|
@@ -149,12 +151,14 @@ function toBridgedPublicPreKey(key) {
|
|
|
149
151
|
};
|
|
150
152
|
}
|
|
151
153
|
export class AccountAttributes {
|
|
154
|
+
_nativeHandle;
|
|
152
155
|
constructor({ recoveryPassword, aciRegistrationId, pniRegistrationId, registrationLock, unidentifiedAccessKey, unrestrictedUnidentifiedAccess, capabilities, discoverableByPhoneNumber, }) {
|
|
153
156
|
const capabilitiesArray = Array.from(capabilities);
|
|
154
157
|
this._nativeHandle = Native.RegistrationAccountAttributes_Create(recoveryPassword, aciRegistrationId, pniRegistrationId, registrationLock, unidentifiedAccessKey, unrestrictedUnidentifiedAccess, capabilitiesArray, discoverableByPhoneNumber);
|
|
155
158
|
}
|
|
156
159
|
}
|
|
157
160
|
export class RegisterAccountResponse {
|
|
161
|
+
_nativeHandle;
|
|
158
162
|
constructor(_nativeHandle) {
|
|
159
163
|
this._nativeHandle = _nativeHandle;
|
|
160
164
|
}
|
|
@@ -194,6 +198,7 @@ export class RegisterAccountResponse {
|
|
|
194
198
|
}
|
|
195
199
|
}
|
|
196
200
|
class RegisterAccountRequest {
|
|
201
|
+
_nativeHandle;
|
|
197
202
|
constructor(inputs) {
|
|
198
203
|
const { accountPassword, skipDeviceTransfer, aciPublicKey, pniPublicKey, aciSignedPreKey, pniSignedPreKey, aciPqLastResortPreKey, pniPqLastResortPreKey, } = inputs;
|
|
199
204
|
this._nativeHandle = Native.RegisterAccountRequest_Create();
|
package/dist/net/SvrB.d.ts
CHANGED
|
@@ -28,14 +28,14 @@ export type StoreBackupResponse = {
|
|
|
28
28
|
* to fetch the forward secrecy token from SVR-B. This is currently stored in the header of
|
|
29
29
|
* the backup file.
|
|
30
30
|
*/
|
|
31
|
-
metadata: Uint8Array
|
|
31
|
+
metadata: Uint8Array<ArrayBuffer>;
|
|
32
32
|
/**
|
|
33
33
|
* Opaque value that must be persisted and provided to the next call to {@link SvrB#store}.
|
|
34
34
|
*
|
|
35
35
|
* See the {@link SvrB} documentation for lifecycle and persistence handling
|
|
36
36
|
* for this value.
|
|
37
37
|
*/
|
|
38
|
-
nextBackupSecretData: Uint8Array
|
|
38
|
+
nextBackupSecretData: Uint8Array<ArrayBuffer>;
|
|
39
39
|
};
|
|
40
40
|
/**
|
|
41
41
|
* The result of preparing a backup to be stored with forward secrecy guarantees.
|
|
@@ -61,7 +61,7 @@ export type RestoreBackupResponse = {
|
|
|
61
61
|
* See the {@link SvrB} documentation for lifecycle and persistence handling
|
|
62
62
|
* for this value.
|
|
63
63
|
*/
|
|
64
|
-
nextBackupSecretData: Uint8Array
|
|
64
|
+
nextBackupSecretData: Uint8Array<ArrayBuffer>;
|
|
65
65
|
};
|
|
66
66
|
/**
|
|
67
67
|
* Service for Secure Value Recovery for Backups (SVR-B) operations.
|
|
@@ -142,7 +142,7 @@ export declare class SvrB {
|
|
|
142
142
|
* Should not be used if any previous backups exist for this `backupKey`, whether uploaded or
|
|
143
143
|
* restored by the local device. See {@link SvrB} for more information.
|
|
144
144
|
*/
|
|
145
|
-
createNewBackupChain(backupKey: BackupKey): Uint8Array
|
|
145
|
+
createNewBackupChain(backupKey: BackupKey): Uint8Array<ArrayBuffer>;
|
|
146
146
|
/**
|
|
147
147
|
* Prepares a backup for storage with forward secrecy guarantees.
|
|
148
148
|
*
|
|
@@ -172,7 +172,7 @@ export declare class SvrB {
|
|
|
172
172
|
* @throws {SvrAttestationError} if enclave attestation fails. This indicates a possible bug in
|
|
173
173
|
* libsignal or in the enclave.
|
|
174
174
|
*/
|
|
175
|
-
store(backupKey: BackupKey, previousSecretData: Uint8Array
|
|
175
|
+
store(backupKey: BackupKey, previousSecretData: Uint8Array<ArrayBuffer>, options?: {
|
|
176
176
|
abortSignal?: AbortSignal;
|
|
177
177
|
}): Promise<StoreBackupResponse>;
|
|
178
178
|
/**
|
|
@@ -209,7 +209,7 @@ export declare class SvrB {
|
|
|
209
209
|
* @throws {SvrAttestationError} if enclave attestation fails. This indicates a possible bug in
|
|
210
210
|
* libsignal or in the enclave.
|
|
211
211
|
*/
|
|
212
|
-
restore(backupKey: BackupKey, metadata: Uint8Array
|
|
212
|
+
restore(backupKey: BackupKey, metadata: Uint8Array<ArrayBuffer>, options?: {
|
|
213
213
|
abortSignal?: AbortSignal;
|
|
214
214
|
}): Promise<RestoreBackupResponse>;
|
|
215
215
|
/**
|
package/dist/net/SvrB.js
CHANGED
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
import * as Native from '../Native.js';
|
|
6
6
|
import { BackupForwardSecrecyToken } from '../AccountKeys.js';
|
|
7
7
|
class StoreBackupResponseImpl {
|
|
8
|
+
_nativeHandle;
|
|
8
9
|
constructor(handle) {
|
|
9
10
|
this._nativeHandle = handle;
|
|
10
11
|
}
|
|
@@ -20,6 +21,7 @@ class StoreBackupResponseImpl {
|
|
|
20
21
|
}
|
|
21
22
|
}
|
|
22
23
|
class RestoreBackupResponseImpl {
|
|
24
|
+
_nativeHandle;
|
|
23
25
|
constructor(handle) {
|
|
24
26
|
this._nativeHandle = handle;
|
|
25
27
|
}
|
|
@@ -96,6 +98,10 @@ class RestoreBackupResponseImpl {
|
|
|
96
98
|
* @see {@link BackupKey}, {@link MessageBackupKey}, {@link BackupForwardSecrecyToken}
|
|
97
99
|
*/
|
|
98
100
|
export class SvrB {
|
|
101
|
+
asyncContext;
|
|
102
|
+
connectionManager;
|
|
103
|
+
auth;
|
|
104
|
+
environment;
|
|
99
105
|
constructor(asyncContext, connectionManager, auth, environment) {
|
|
100
106
|
this.asyncContext = asyncContext;
|
|
101
107
|
this.connectionManager = connectionManager;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { RequestOptions } from '../Chat.js';
|
|
2
|
+
import { ServiceId } from '../../Address.js';
|
|
3
|
+
import { PublicKey } from '../../EcKeys.js';
|
|
4
|
+
import { PreKeyBundle } from '../../ProtocolTypes.js';
|
|
5
|
+
import GroupSendFullToken from '../../zkgroup/groupsend/GroupSendFullToken.js';
|
|
6
|
+
declare module '../Chat' {
|
|
7
|
+
interface UnauthenticatedChatConnection extends UnauthKeysService {
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
export interface UnauthKeysService {
|
|
11
|
+
/**
|
|
12
|
+
* Fetch the prekeys for a given target user
|
|
13
|
+
*
|
|
14
|
+
* @throws {RequestUnauthorizedError} if `auth` is not valid for the target
|
|
15
|
+
* @throws {ServiceIdNotFound} if the requested identity or device does
|
|
16
|
+
* not exist or device has no available prekeys.
|
|
17
|
+
*/
|
|
18
|
+
getPreKeys: (request: {
|
|
19
|
+
target: ServiceId;
|
|
20
|
+
device: 'all' | {
|
|
21
|
+
deviceId: number;
|
|
22
|
+
};
|
|
23
|
+
auth: {
|
|
24
|
+
accessKey: Uint8Array<ArrayBuffer>;
|
|
25
|
+
} | GroupSendFullToken;
|
|
26
|
+
}, options?: RequestOptions) => Promise<{
|
|
27
|
+
identityKey: PublicKey;
|
|
28
|
+
preKeyBundles: PreKeyBundle[];
|
|
29
|
+
}>;
|
|
30
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 Signal Messenger, LLC.
|
|
3
|
+
// SPDX-License-Identifier: AGPL-3.0-only
|
|
4
|
+
//
|
|
5
|
+
import { UnauthenticatedChatConnection } from '../Chat.js';
|
|
6
|
+
import * as Native from '../../Native.js';
|
|
7
|
+
import { PublicKey } from '../../EcKeys.js';
|
|
8
|
+
import { PreKeyBundle } from '../../ProtocolTypes.js';
|
|
9
|
+
import GroupSendFullToken from '../../zkgroup/groupsend/GroupSendFullToken.js';
|
|
10
|
+
UnauthenticatedChatConnection.prototype.getPreKeys = async function (request, options) {
|
|
11
|
+
const device = request.device === 'all' ? -1 : request.device.deviceId;
|
|
12
|
+
const { identityKey, preKeyBundles } = await this._asyncContext.makeCancellable(options?.abortSignal, request.auth instanceof GroupSendFullToken
|
|
13
|
+
? Native.UnauthenticatedChatConnection_get_pre_keys_access_group_auth(this._asyncContext, this._chatService, request.auth.serialize(), request.target.getServiceIdFixedWidthBinary(), device)
|
|
14
|
+
: Native.UnauthenticatedChatConnection_get_pre_keys_access_key_auth(this._asyncContext, this._chatService, request.auth.accessKey, request.target.getServiceIdFixedWidthBinary(), device));
|
|
15
|
+
return {
|
|
16
|
+
identityKey: PublicKey._fromNativeHandle(identityKey),
|
|
17
|
+
preKeyBundles: preKeyBundles.map((handle) => PreKeyBundle._fromNativeHandle(handle)),
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=UnauthKeysService.js.map
|
|
@@ -7,7 +7,7 @@ declare module '../Chat' {
|
|
|
7
7
|
}
|
|
8
8
|
/** See {@link UnauthMessagesService#sendMultiRecipientMessage}. */
|
|
9
9
|
export type MultiRecipientMessageRequest = Readonly<{
|
|
10
|
-
payload: Uint8Array
|
|
10
|
+
payload: Uint8Array<ArrayBuffer>;
|
|
11
11
|
timestamp: number;
|
|
12
12
|
auth: 'story' | GroupSendFullToken;
|
|
13
13
|
onlineOnly: boolean;
|
|
@@ -12,6 +12,7 @@ import { UnauthenticatedChatConnection } from '../Chat.js';
|
|
|
12
12
|
* are currently unregistered. For `story` auth the list will always be empty.
|
|
13
13
|
*/
|
|
14
14
|
export class MultiRecipientMessageResponse {
|
|
15
|
+
unregisteredIds;
|
|
15
16
|
constructor(unregisteredIds) {
|
|
16
17
|
this.unregisteredIds = unregisteredIds;
|
|
17
18
|
}
|
|
@@ -16,7 +16,7 @@ export interface UnauthUsernamesService {
|
|
|
16
16
|
* if the hash is structurally invalid.
|
|
17
17
|
*/
|
|
18
18
|
lookUpUsernameHash: (request: {
|
|
19
|
-
hash: Uint8Array
|
|
19
|
+
hash: Uint8Array<ArrayBuffer>;
|
|
20
20
|
}, options?: RequestOptions) => Promise<Aci | null>;
|
|
21
21
|
/**
|
|
22
22
|
* Looks up a username link on the service by UUID.
|
|
@@ -31,9 +31,9 @@ export interface UnauthUsernamesService {
|
|
|
31
31
|
*/
|
|
32
32
|
lookUpUsernameLink: (request: {
|
|
33
33
|
uuid: Uuid;
|
|
34
|
-
entropy: Uint8Array
|
|
34
|
+
entropy: Uint8Array<ArrayBuffer>;
|
|
35
35
|
}, options?: RequestOptions) => Promise<{
|
|
36
36
|
username: string;
|
|
37
|
-
hash: Uint8Array
|
|
37
|
+
hash: Uint8Array<ArrayBuffer>;
|
|
38
38
|
} | null>;
|
|
39
39
|
}
|
|
@@ -3,16 +3,16 @@
|
|
|
3
3
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
4
4
|
//
|
|
5
5
|
import { Buffer } from 'node:buffer';
|
|
6
|
-
import * as uuid from 'uuid';
|
|
7
6
|
import * as Native from '../../Native.js';
|
|
8
7
|
import { Aci } from '../../Address.js';
|
|
8
|
+
import { parseUuid } from '../../uuid.js';
|
|
9
9
|
import { UnauthenticatedChatConnection } from '../Chat.js';
|
|
10
10
|
UnauthenticatedChatConnection.prototype.lookUpUsernameHash = async function ({ hash, }, options) {
|
|
11
11
|
const response = await this._asyncContext.makeCancellable(options?.abortSignal, Native.UnauthenticatedChatConnection_look_up_username_hash(this._asyncContext, this._chatService, Buffer.from(hash)));
|
|
12
12
|
return response ? Aci.fromUuidBytes(response) : null;
|
|
13
13
|
};
|
|
14
14
|
UnauthenticatedChatConnection.prototype.lookUpUsernameLink = async function ({ uuid: linkUuid, entropy, }, options) {
|
|
15
|
-
const response = await this._asyncContext.makeCancellable(options?.abortSignal, Native.UnauthenticatedChatConnection_look_up_username_link(this._asyncContext, this._chatService,
|
|
15
|
+
const response = await this._asyncContext.makeCancellable(options?.abortSignal, Native.UnauthenticatedChatConnection_look_up_username_link(this._asyncContext, this._chatService, parseUuid(linkUuid), entropy));
|
|
16
16
|
return response ? { username: response[0], hash: response[1] } : null;
|
|
17
17
|
};
|
|
18
18
|
//# sourceMappingURL=UnauthUsernamesService.js.map
|
package/dist/net.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ import { RegistrationService } from './net/Registration.js';
|
|
|
6
6
|
import { SvrB } from './net/SvrB.js';
|
|
7
7
|
export * from './net/CDSI.js';
|
|
8
8
|
export * from './net/Chat.js';
|
|
9
|
+
export * from './net/chat/UnauthKeysService.js';
|
|
9
10
|
export * from './net/chat/UnauthMessagesService.js';
|
|
10
11
|
export * from './net/chat/UnauthProfilesService.js';
|
|
11
12
|
export * from './net/chat/UnauthUsernamesService.js';
|
|
@@ -36,7 +37,7 @@ export type ChatRequest = Readonly<{
|
|
|
36
37
|
verb: string;
|
|
37
38
|
path: string;
|
|
38
39
|
headers: ReadonlyArray<[string, string]>;
|
|
39
|
-
body?: Uint8Array
|
|
40
|
+
body?: Uint8Array<ArrayBuffer>;
|
|
40
41
|
timeoutMillis?: number;
|
|
41
42
|
}>;
|
|
42
43
|
type ConnectionManager = Native.Wrapper<Native.ConnectionManager>;
|
|
@@ -59,7 +60,7 @@ export type NetConstructorOptions = Readonly<{
|
|
|
59
60
|
TESTING_localServer_cdsiPort: number;
|
|
60
61
|
TESTING_localServer_svr2Port: number;
|
|
61
62
|
TESTING_localServer_svrBPort: number;
|
|
62
|
-
TESTING_localServer_rootCertificateDer: Uint8Array
|
|
63
|
+
TESTING_localServer_rootCertificateDer: Uint8Array<ArrayBuffer>;
|
|
63
64
|
}>;
|
|
64
65
|
/** See {@link Net.setProxy()}. */
|
|
65
66
|
export type ProxyOptions = {
|
|
@@ -71,7 +72,7 @@ export type ProxyOptions = {
|
|
|
71
72
|
};
|
|
72
73
|
/** The "scheme" for Signal TLS proxies. See {@link Net.setProxy()}. */
|
|
73
74
|
export declare const SIGNAL_TLS_PROXY_SCHEME = "org.signal.tls";
|
|
74
|
-
export declare const REMOTE_CONFIG_KEYS: readonly ["chatRequestConnectionCheckTimeoutMillis", "useH2ForUnauthChat", "useH2ForAuthChat", "grpc.AccountsAnonymousLookupUsernameHash", "grpc.AccountsAnonymousLookupUsernameLink", "grpc.AccountsAnonymousCheckAccountExistence", "grpc.MessagesAnonymousSendMultiRecipientMessage", "chatRequestConnectionCheckTimeoutMillis.beta", "useH2ForUnauthChat.beta", "useH2ForAuthChat.beta", "grpc.AccountsAnonymousLookupUsernameHash.beta", "grpc.AccountsAnonymousLookupUsernameLink.beta", "grpc.AccountsAnonymousCheckAccountExistence.beta", "grpc.MessagesAnonymousSendMultiRecipientMessage.beta", "chatPermessageDeflate.prod"];
|
|
75
|
+
export declare const REMOTE_CONFIG_KEYS: readonly ["chatRequestConnectionCheckTimeoutMillis", "useH2ForUnauthChat", "useH2ForAuthChat", "grpc.AccountsAnonymousLookupUsernameHash", "grpc.AccountsAnonymousLookupUsernameLink.2", "grpc.AccountsAnonymousCheckAccountExistence.2", "grpc.MessagesAnonymousSendMultiRecipientMessage.2", "chatRequestConnectionCheckTimeoutMillis.beta", "useH2ForUnauthChat.beta", "useH2ForAuthChat.beta", "grpc.AccountsAnonymousLookupUsernameHash.beta", "grpc.AccountsAnonymousLookupUsernameLink.2.beta", "grpc.AccountsAnonymousCheckAccountExistence.2.beta", "grpc.MessagesAnonymousSendMultiRecipientMessage.2.beta", "chatPermessageDeflate.prod"];
|
|
75
76
|
export declare class Net {
|
|
76
77
|
private readonly options;
|
|
77
78
|
private readonly asyncContext;
|
package/dist/net.js
CHANGED
|
@@ -10,6 +10,7 @@ import { SvrB } from './net/SvrB.js';
|
|
|
10
10
|
import { BridgedStringMap, newNativeHandle } from './internal.js';
|
|
11
11
|
export * from './net/CDSI.js';
|
|
12
12
|
export * from './net/Chat.js';
|
|
13
|
+
export * from './net/chat/UnauthKeysService.js';
|
|
13
14
|
export * from './net/chat/UnauthMessagesService.js';
|
|
14
15
|
export * from './net/chat/UnauthProfilesService.js';
|
|
15
16
|
export * from './net/chat/UnauthUsernamesService.js';
|
|
@@ -37,6 +38,7 @@ export var BuildVariant;
|
|
|
37
38
|
})(BuildVariant || (BuildVariant = {}));
|
|
38
39
|
/** Low-level async runtime control, mostly just exported for testing. */
|
|
39
40
|
export class TokioAsyncContext {
|
|
41
|
+
_nativeHandle;
|
|
40
42
|
constructor(handle) {
|
|
41
43
|
this._nativeHandle = handle;
|
|
42
44
|
}
|
|
@@ -71,6 +73,10 @@ export const REMOTE_CONFIG_KEYS = [
|
|
|
71
73
|
...PROD_REMOTE_CONFIG_KEYS,
|
|
72
74
|
];
|
|
73
75
|
export class Net {
|
|
76
|
+
options;
|
|
77
|
+
asyncContext;
|
|
78
|
+
/** Exposed only for testing. */
|
|
79
|
+
_connectionManager;
|
|
74
80
|
constructor(options) {
|
|
75
81
|
this.options = options;
|
|
76
82
|
this.asyncContext = new TokioAsyncContext(Native.TokioAsyncContext_new());
|
|
@@ -188,7 +194,7 @@ export class Net {
|
|
|
188
194
|
try {
|
|
189
195
|
const proxyConfig = newNativeHandle(Native.ConnectionProxyConfig_new(scheme, host,
|
|
190
196
|
// i32::MIN represents "no port provided"; we don't expect anyone to pass that manually.
|
|
191
|
-
port ?? -
|
|
197
|
+
port ?? -0x8000_0000, username ?? null, password ?? null));
|
|
192
198
|
Native.ConnectionManager_set_proxy(this._connectionManager, proxyConfig);
|
|
193
199
|
}
|
|
194
200
|
catch (e) {
|
package/dist/usernames.d.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
export type UsernameLink = {
|
|
2
|
-
entropy: Uint8Array
|
|
3
|
-
encryptedUsername: Uint8Array
|
|
2
|
+
entropy: Uint8Array<ArrayBuffer>;
|
|
3
|
+
encryptedUsername: Uint8Array<ArrayBuffer>;
|
|
4
4
|
};
|
|
5
5
|
export declare function generateCandidates(nickname: string, minNicknameLength: number, maxNicknameLength: number): string[];
|
|
6
6
|
export declare function fromParts(nickname: string, discriminator: string, minNicknameLength: number, maxNicknameLength: number): {
|
|
7
7
|
username: string;
|
|
8
|
-
hash: Uint8Array
|
|
8
|
+
hash: Uint8Array<ArrayBuffer>;
|
|
9
9
|
};
|
|
10
|
-
export declare function hash(username: string): Uint8Array
|
|
11
|
-
export declare function generateProof(username: string): Uint8Array
|
|
12
|
-
export declare function generateProofWithRandom(username: string, random: Uint8Array): Uint8Array
|
|
10
|
+
export declare function hash(username: string): Uint8Array<ArrayBuffer>;
|
|
11
|
+
export declare function generateProof(username: string): Uint8Array<ArrayBuffer>;
|
|
12
|
+
export declare function generateProofWithRandom(username: string, random: Uint8Array<ArrayBuffer>): Uint8Array<ArrayBuffer>;
|
|
13
13
|
export declare function decryptUsernameLink(usernameLink: UsernameLink): string;
|
|
14
|
-
export declare function createUsernameLink(username: string, previousEntropy?: Uint8Array): UsernameLink;
|
|
15
|
-
export declare function verifyProof(proof: Uint8Array
|
|
14
|
+
export declare function createUsernameLink(username: string, previousEntropy?: Uint8Array<ArrayBuffer>): UsernameLink;
|
|
15
|
+
export declare function verifyProof(proof: Uint8Array<ArrayBuffer>, hash: Uint8Array<ArrayBuffer>): void;
|
package/dist/uuid.d.ts
CHANGED
package/dist/uuid.js
CHANGED
|
@@ -2,5 +2,9 @@
|
|
|
2
2
|
// Copyright 2025 Signal Messenger, LLC.
|
|
3
3
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
4
4
|
//
|
|
5
|
-
|
|
5
|
+
import * as uuid from 'uuid';
|
|
6
|
+
export function parseUuid(input) {
|
|
7
|
+
// @ts-expect-error See https://github.com/uuidjs/uuid/pull/927
|
|
8
|
+
return uuid.parse(input);
|
|
9
|
+
}
|
|
6
10
|
//# sourceMappingURL=uuid.js.map
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
import ByteArray from './internal/ByteArray.js';
|
|
6
6
|
import * as Native from '../Native.js';
|
|
7
7
|
export default class GenericServerPublicParams extends ByteArray {
|
|
8
|
+
__type;
|
|
8
9
|
constructor(contents) {
|
|
9
10
|
super(contents, Native.GenericServerPublicParams_CheckValidContents);
|
|
10
11
|
}
|
|
@@ -3,7 +3,7 @@ import GenericServerPublicParams from './GenericServerPublicParams.js';
|
|
|
3
3
|
export default class GenericServerSecretParams extends ByteArray {
|
|
4
4
|
private readonly __type?;
|
|
5
5
|
static generate(): GenericServerSecretParams;
|
|
6
|
-
static generateWithRandom(random: Uint8Array): GenericServerSecretParams;
|
|
7
|
-
constructor(contents: Uint8Array);
|
|
6
|
+
static generateWithRandom(random: Uint8Array<ArrayBuffer>): GenericServerSecretParams;
|
|
7
|
+
constructor(contents: Uint8Array<ArrayBuffer>);
|
|
8
8
|
getPublicParams(): GenericServerPublicParams;
|
|
9
9
|
}
|
|
@@ -8,6 +8,7 @@ import ByteArray from './internal/ByteArray.js';
|
|
|
8
8
|
import { RANDOM_LENGTH } from './internal/Constants.js';
|
|
9
9
|
import GenericServerPublicParams from './GenericServerPublicParams.js';
|
|
10
10
|
export default class GenericServerSecretParams extends ByteArray {
|
|
11
|
+
__type;
|
|
11
12
|
static generate() {
|
|
12
13
|
const random = randomBytes(RANDOM_LENGTH);
|
|
13
14
|
return GenericServerSecretParams.generateWithRandom(random);
|
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
4
4
|
//
|
|
5
5
|
import ByteArray from './internal/ByteArray.js';
|
|
6
|
-
class NotarySignature extends ByteArray {
|
|
6
|
+
export default class NotarySignature extends ByteArray {
|
|
7
|
+
__type;
|
|
8
|
+
static SIZE = 64;
|
|
7
9
|
constructor(contents) {
|
|
8
10
|
super(contents, NotarySignature.checkLength(NotarySignature.SIZE));
|
|
9
11
|
}
|
|
10
12
|
}
|
|
11
|
-
NotarySignature.SIZE = 64;
|
|
12
|
-
export default NotarySignature;
|
|
13
13
|
//# sourceMappingURL=NotarySignature.js.map
|
|
@@ -2,13 +2,13 @@ import * as Native from '../Native.js';
|
|
|
2
2
|
import NotarySignature from './NotarySignature.js';
|
|
3
3
|
export default class ServerPublicParams {
|
|
4
4
|
readonly _nativeHandle: Native.ServerPublicParams;
|
|
5
|
-
constructor(contents: Uint8Array | Native.ServerPublicParams);
|
|
5
|
+
constructor(contents: Uint8Array<ArrayBuffer> | Native.ServerPublicParams);
|
|
6
6
|
/**
|
|
7
7
|
* Get the serialized form of the params' endorsement key.
|
|
8
8
|
*
|
|
9
9
|
* Allows decoupling RingRTC's use of endorsements from libsignal's.
|
|
10
10
|
*/
|
|
11
|
-
getEndorsementPublicKey(): Uint8Array
|
|
12
|
-
verifySignature(message: Uint8Array
|
|
13
|
-
serialize(): Uint8Array
|
|
11
|
+
getEndorsementPublicKey(): Uint8Array<ArrayBuffer>;
|
|
12
|
+
verifySignature(message: Uint8Array<ArrayBuffer>, notarySignature: NotarySignature): void;
|
|
13
|
+
serialize(): Uint8Array<ArrayBuffer>;
|
|
14
14
|
}
|
|
@@ -3,11 +3,11 @@ import ServerPublicParams from './ServerPublicParams.js';
|
|
|
3
3
|
import NotarySignature from './NotarySignature.js';
|
|
4
4
|
export default class ServerSecretParams {
|
|
5
5
|
static generate(): ServerSecretParams;
|
|
6
|
-
static generateWithRandom(random: Uint8Array): ServerSecretParams;
|
|
6
|
+
static generateWithRandom(random: Uint8Array<ArrayBuffer>): ServerSecretParams;
|
|
7
7
|
readonly _nativeHandle: Native.ServerSecretParams;
|
|
8
|
-
constructor(contents: Uint8Array | Native.ServerSecretParams);
|
|
8
|
+
constructor(contents: Uint8Array<ArrayBuffer> | Native.ServerSecretParams);
|
|
9
9
|
getPublicParams(): ServerPublicParams;
|
|
10
|
-
sign(message: Uint8Array): NotarySignature;
|
|
11
|
-
signWithRandom(random: Uint8Array
|
|
12
|
-
serialize(): Uint8Array
|
|
10
|
+
sign(message: Uint8Array<ArrayBuffer>): NotarySignature;
|
|
11
|
+
signWithRandom(random: Uint8Array<ArrayBuffer>, message: Uint8Array<ArrayBuffer>): NotarySignature;
|
|
12
|
+
serialize(): Uint8Array<ArrayBuffer>;
|
|
13
13
|
}
|
|
@@ -15,6 +15,7 @@ export default class ServerSecretParams {
|
|
|
15
15
|
static generateWithRandom(random) {
|
|
16
16
|
return new ServerSecretParams(Native.ServerSecretParams_GenerateDeterministic(random));
|
|
17
17
|
}
|
|
18
|
+
_nativeHandle;
|
|
18
19
|
constructor(contents) {
|
|
19
20
|
if (contents instanceof Uint8Array) {
|
|
20
21
|
this._nativeHandle = Native.ServerSecretParams_Deserialize(contents);
|
|
@@ -2,7 +2,7 @@ import ByteArray from '../internal/ByteArray.js';
|
|
|
2
2
|
import UuidCiphertext from '../groups/UuidCiphertext.js';
|
|
3
3
|
export default class AuthCredentialPresentation extends ByteArray {
|
|
4
4
|
private readonly __type?;
|
|
5
|
-
constructor(contents: Uint8Array);
|
|
5
|
+
constructor(contents: Uint8Array<ArrayBuffer>);
|
|
6
6
|
getUuidCiphertext(): UuidCiphertext;
|
|
7
7
|
getPniCiphertext(): UuidCiphertext;
|
|
8
8
|
getRedemptionTime(): Date;
|
|
@@ -6,6 +6,7 @@ import ByteArray from '../internal/ByteArray.js';
|
|
|
6
6
|
import * as Native from '../../Native.js';
|
|
7
7
|
import UuidCiphertext from '../groups/UuidCiphertext.js';
|
|
8
8
|
export default class AuthCredentialPresentation extends ByteArray {
|
|
9
|
+
__type;
|
|
9
10
|
constructor(contents) {
|
|
10
11
|
super(contents, Native.AuthCredentialPresentation_CheckValidContents);
|
|
11
12
|
}
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
import ByteArray from '../internal/ByteArray.js';
|
|
6
6
|
import * as Native from '../../Native.js';
|
|
7
7
|
export default class AuthCredentialWithPni extends ByteArray {
|
|
8
|
+
__type;
|
|
8
9
|
constructor(contents) {
|
|
9
10
|
super(contents, Native.AuthCredentialWithPni_CheckValidContents);
|
|
10
11
|
}
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
import ByteArray from '../internal/ByteArray.js';
|
|
6
6
|
import * as Native from '../../Native.js';
|
|
7
7
|
export default class AuthCredentialWithPniResponse extends ByteArray {
|
|
8
|
+
__type;
|
|
8
9
|
constructor(contents) {
|
|
9
10
|
super(contents, Native.AuthCredentialWithPniResponse_CheckValidContents);
|
|
10
11
|
}
|
|
@@ -14,5 +14,5 @@ export default class ClientZkAuthOperations {
|
|
|
14
14
|
*/
|
|
15
15
|
receiveAuthCredentialWithPniAsServiceId(aci: Aci, pni: Pni, redemptionTime: number, authCredentialResponse: AuthCredentialWithPniResponse): AuthCredentialWithPni;
|
|
16
16
|
createAuthCredentialWithPniPresentation(groupSecretParams: GroupSecretParams, authCredential: AuthCredentialWithPni): AuthCredentialPresentation;
|
|
17
|
-
createAuthCredentialWithPniPresentationWithRandom(random: Uint8Array
|
|
17
|
+
createAuthCredentialWithPniPresentationWithRandom(random: Uint8Array<ArrayBuffer>, groupSecretParams: GroupSecretParams, authCredential: AuthCredentialWithPni): AuthCredentialPresentation;
|
|
18
18
|
}
|
|
@@ -8,6 +8,7 @@ import { RANDOM_LENGTH } from '../internal/Constants.js';
|
|
|
8
8
|
import AuthCredentialPresentation from './AuthCredentialPresentation.js';
|
|
9
9
|
import AuthCredentialWithPni from './AuthCredentialWithPni.js';
|
|
10
10
|
export default class ClientZkAuthOperations {
|
|
11
|
+
serverPublicParams;
|
|
11
12
|
constructor(serverPublicParams) {
|
|
12
13
|
this.serverPublicParams = serverPublicParams;
|
|
13
14
|
}
|
|
@@ -7,6 +7,6 @@ export default class ServerZkAuthOperations {
|
|
|
7
7
|
serverSecretParams: ServerSecretParams;
|
|
8
8
|
constructor(serverSecretParams: ServerSecretParams);
|
|
9
9
|
issueAuthCredentialWithPniZkc(aci: Aci, pni: Pni, redemptionTime: number): AuthCredentialWithPniResponse;
|
|
10
|
-
issueAuthCredentialWithPniZkcWithRandom(random: Uint8Array
|
|
10
|
+
issueAuthCredentialWithPniZkcWithRandom(random: Uint8Array<ArrayBuffer>, aci: Aci, pni: Pni, redemptionTime: number): AuthCredentialWithPniResponse;
|
|
11
11
|
verifyAuthCredentialPresentation(groupPublicParams: GroupPublicParams, authCredentialPresentation: AuthCredentialPresentation, now?: Date): void;
|
|
12
12
|
}
|
|
@@ -7,6 +7,7 @@ import { RANDOM_LENGTH } from '../internal/Constants.js';
|
|
|
7
7
|
import * as Native from '../../Native.js';
|
|
8
8
|
import AuthCredentialWithPniResponse from './AuthCredentialWithPniResponse.js';
|
|
9
9
|
export default class ServerZkAuthOperations {
|
|
10
|
+
serverSecretParams;
|
|
10
11
|
constructor(serverSecretParams) {
|
|
11
12
|
this.serverSecretParams = serverSecretParams;
|
|
12
13
|
}
|
|
@@ -5,10 +5,10 @@ import BackupLevel from './BackupLevel.js';
|
|
|
5
5
|
import BackupCredentialType from './BackupCredentialType.js';
|
|
6
6
|
export default class BackupAuthCredential extends ByteArray {
|
|
7
7
|
private readonly __type?;
|
|
8
|
-
constructor(contents: Uint8Array);
|
|
8
|
+
constructor(contents: Uint8Array<ArrayBuffer>);
|
|
9
9
|
present(serverParams: GenericServerPublicParams): BackupAuthCredentialPresentation;
|
|
10
|
-
presentWithRandom(serverParams: GenericServerPublicParams, random: Uint8Array): BackupAuthCredentialPresentation;
|
|
11
|
-
getBackupId(): Uint8Array
|
|
10
|
+
presentWithRandom(serverParams: GenericServerPublicParams, random: Uint8Array<ArrayBuffer>): BackupAuthCredentialPresentation;
|
|
11
|
+
getBackupId(): Uint8Array<ArrayBuffer>;
|
|
12
12
|
getBackupLevel(): BackupLevel;
|
|
13
13
|
getType(): BackupCredentialType;
|
|
14
14
|
}
|
|
@@ -10,6 +10,7 @@ import BackupAuthCredentialPresentation from './BackupAuthCredentialPresentation
|
|
|
10
10
|
import BackupLevel from './BackupLevel.js';
|
|
11
11
|
import BackupCredentialType from './BackupCredentialType.js';
|
|
12
12
|
export default class BackupAuthCredential extends ByteArray {
|
|
13
|
+
__type;
|
|
13
14
|
constructor(contents) {
|
|
14
15
|
super(contents, Native.BackupAuthCredential_CheckValidContents);
|
|
15
16
|
}
|
|
@@ -4,9 +4,9 @@ import BackupLevel from './BackupLevel.js';
|
|
|
4
4
|
import BackupCredentialType from './BackupCredentialType.js';
|
|
5
5
|
export default class BackupAuthCredentialPresentation extends ByteArray {
|
|
6
6
|
private readonly __type?;
|
|
7
|
-
constructor(contents: Uint8Array);
|
|
7
|
+
constructor(contents: Uint8Array<ArrayBuffer>);
|
|
8
8
|
verify(serverParams: GenericServerSecretParams, now?: Date): void;
|
|
9
|
-
getBackupId(): Uint8Array
|
|
9
|
+
getBackupId(): Uint8Array<ArrayBuffer>;
|
|
10
10
|
getBackupLevel(): BackupLevel;
|
|
11
11
|
getType(): BackupCredentialType;
|
|
12
12
|
}
|
|
@@ -7,6 +7,7 @@ import * as Native from '../../Native.js';
|
|
|
7
7
|
import BackupLevel from './BackupLevel.js';
|
|
8
8
|
import BackupCredentialType from './BackupCredentialType.js';
|
|
9
9
|
export default class BackupAuthCredentialPresentation extends ByteArray {
|
|
10
|
+
__type;
|
|
10
11
|
constructor(contents) {
|
|
11
12
|
super(contents, Native.BackupAuthCredentialPresentation_CheckValidContents);
|
|
12
13
|
}
|
|
@@ -5,7 +5,7 @@ import BackupLevel from './BackupLevel.js';
|
|
|
5
5
|
import BackupCredentialType from './BackupCredentialType.js';
|
|
6
6
|
export default class BackupAuthCredentialRequest extends ByteArray {
|
|
7
7
|
private readonly __type?;
|
|
8
|
-
constructor(contents: Uint8Array);
|
|
8
|
+
constructor(contents: Uint8Array<ArrayBuffer>);
|
|
9
9
|
issueCredential(timestamp: number, backupLevel: BackupLevel, type: BackupCredentialType, params: GenericServerSecretParams): BackupAuthCredentialResponse;
|
|
10
|
-
issueCredentialWithRandom(timestamp: number, backupLevel: BackupLevel, type: BackupCredentialType, params: GenericServerSecretParams, random: Uint8Array): BackupAuthCredentialResponse;
|
|
10
|
+
issueCredentialWithRandom(timestamp: number, backupLevel: BackupLevel, type: BackupCredentialType, params: GenericServerSecretParams, random: Uint8Array<ArrayBuffer>): BackupAuthCredentialResponse;
|
|
11
11
|
}
|
|
@@ -8,6 +8,7 @@ import ByteArray from '../internal/ByteArray.js';
|
|
|
8
8
|
import { RANDOM_LENGTH } from '../internal/Constants.js';
|
|
9
9
|
import BackupAuthCredentialResponse from './BackupAuthCredentialResponse.js';
|
|
10
10
|
export default class BackupAuthCredentialRequest extends ByteArray {
|
|
11
|
+
__type;
|
|
11
12
|
constructor(contents) {
|
|
12
13
|
super(contents, Native.BackupAuthCredentialRequest_CheckValidContents);
|
|
13
14
|
}
|
|
@@ -3,11 +3,11 @@ import BackupAuthCredentialRequest from './BackupAuthCredentialRequest.js';
|
|
|
3
3
|
import BackupAuthCredentialResponse from './BackupAuthCredentialResponse.js';
|
|
4
4
|
import BackupAuthCredential from './BackupAuthCredential.js';
|
|
5
5
|
import GenericServerPublicParams from '../GenericServerPublicParams.js';
|
|
6
|
-
import type
|
|
6
|
+
import { type Uuid } from '../../index.js';
|
|
7
7
|
export default class BackupAuthCredentialRequestContext extends ByteArray {
|
|
8
8
|
private readonly __type?;
|
|
9
|
-
constructor(contents: Uint8Array);
|
|
10
|
-
static create(backupKey: Uint8Array
|
|
9
|
+
constructor(contents: Uint8Array<ArrayBuffer>);
|
|
10
|
+
static create(backupKey: Uint8Array<ArrayBuffer>, aci: Uuid): BackupAuthCredentialRequestContext;
|
|
11
11
|
getRequest(): BackupAuthCredentialRequest;
|
|
12
12
|
receive(response: BackupAuthCredentialResponse, redemptionTime: number, params: GenericServerPublicParams): BackupAuthCredential;
|
|
13
13
|
}
|