@signalapp/libsignal-client 0.32.1 → 0.33.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.
- package/Native.d.ts +38 -0
- package/dist/WebpSanitizer.d.ts +11 -0
- package/dist/WebpSanitizer.js +31 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +3 -2
- package/dist/zkgroup/backups/BackupAuthCredential.d.ts +11 -0
- package/dist/zkgroup/backups/BackupAuthCredential.js +28 -0
- package/dist/zkgroup/backups/BackupAuthCredentialPresentation.d.ts +8 -0
- package/dist/zkgroup/backups/BackupAuthCredentialPresentation.js +18 -0
- package/dist/zkgroup/backups/BackupAuthCredentialRequest.d.ts +10 -0
- package/dist/zkgroup/backups/BackupAuthCredentialRequest.js +26 -0
- package/dist/zkgroup/backups/BackupAuthCredentialRequestContext.d.ts +14 -0
- package/dist/zkgroup/backups/BackupAuthCredentialRequestContext.js +28 -0
- package/dist/zkgroup/backups/BackupAuthCredentialResponse.d.ts +6 -0
- package/dist/zkgroup/backups/BackupAuthCredentialResponse.js +15 -0
- package/dist/zkgroup/index.d.ts +5 -0
- package/dist/zkgroup/index.js +13 -1
- package/package.json +1 -1
- package/prebuilds/darwin-arm64/node.napi.node +0 -0
- package/prebuilds/darwin-x64/node.napi.node +0 -0
- package/prebuilds/linux-arm64/node.napi.node +0 -0
- package/prebuilds/linux-x64/node.napi.node +0 -0
- package/prebuilds/win32-arm64/node.napi.node +0 -0
- package/prebuilds/win32-x64/node.napi.node +0 -0
package/Native.d.ts
CHANGED
|
@@ -51,6 +51,9 @@ export abstract class InputStream {
|
|
|
51
51
|
_skip(amount: number): Promise<void>;
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
+
export abstract class SyncInputStream extends Buffer {
|
|
55
|
+
}
|
|
56
|
+
|
|
54
57
|
interface Wrapper<T> {
|
|
55
58
|
readonly _nativeHandle: T
|
|
56
59
|
}
|
|
@@ -72,6 +75,18 @@ export function AuthCredentialResponse_CheckValidContents(buffer: Buffer): void;
|
|
|
72
75
|
export function AuthCredentialWithPniResponse_CheckValidContents(buffer: Buffer): void;
|
|
73
76
|
export function AuthCredentialWithPni_CheckValidContents(buffer: Buffer): void;
|
|
74
77
|
export function AuthCredential_CheckValidContents(buffer: Buffer): void;
|
|
78
|
+
export function BackupAuthCredentialPresentation_CheckValidContents(presentationBytes: Buffer): void;
|
|
79
|
+
export function BackupAuthCredentialPresentation_Verify(presentationBytes: Buffer, now: Timestamp, serverParamsBytes: Buffer): void;
|
|
80
|
+
export function BackupAuthCredentialRequestContext_CheckValidContents(contextBytes: Buffer): void;
|
|
81
|
+
export function BackupAuthCredentialRequestContext_GetRequest(contextBytes: Buffer): Buffer;
|
|
82
|
+
export function BackupAuthCredentialRequestContext_New(backupKey: Buffer, uuid: Uuid): Buffer;
|
|
83
|
+
export function BackupAuthCredentialRequestContext_ReceiveResponse(contextBytes: Buffer, responseBytes: Buffer, paramsBytes: Buffer, expectedReceiptLevel: Buffer): Buffer;
|
|
84
|
+
export function BackupAuthCredentialRequest_CheckValidContents(requestBytes: Buffer): void;
|
|
85
|
+
export function BackupAuthCredentialRequest_IssueDeterministic(requestBytes: Buffer, redemptionTime: Timestamp, receiptLevel: Buffer, paramsBytes: Buffer, randomness: Buffer): Buffer;
|
|
86
|
+
export function BackupAuthCredentialResponse_CheckValidContents(responseBytes: Buffer): void;
|
|
87
|
+
export function BackupAuthCredential_CheckValidContents(paramsBytes: Buffer): void;
|
|
88
|
+
export function BackupAuthCredential_GetBackupId(credentialBytes: Buffer): Buffer;
|
|
89
|
+
export function BackupAuthCredential_PresentDeterministic(credentialBytes: Buffer, serverParamsBytes: Buffer, randomness: Buffer): Buffer;
|
|
75
90
|
export function CallLinkAuthCredentialPresentation_CheckValidContents(presentationBytes: Buffer): void;
|
|
76
91
|
export function CallLinkAuthCredentialPresentation_GetUserId(presentationBytes: Buffer): Serialized<UuidCiphertext>;
|
|
77
92
|
export function CallLinkAuthCredentialPresentation_Verify(presentationBytes: Buffer, now: Timestamp, serverParamsBytes: Buffer, callLinkParamsBytes: Buffer): void;
|
|
@@ -344,6 +359,27 @@ export function SignedPreKeyRecord_GetSignature(obj: Wrapper<SignedPreKeyRecord>
|
|
|
344
359
|
export function SignedPreKeyRecord_GetTimestamp(obj: Wrapper<SignedPreKeyRecord>): Timestamp;
|
|
345
360
|
export function SignedPreKeyRecord_New(id: number, timestamp: Timestamp, pubKey: Wrapper<PublicKey>, privKey: Wrapper<PrivateKey>, signature: Buffer): SignedPreKeyRecord;
|
|
346
361
|
export function SignedPreKeyRecord_Serialize(obj: Wrapper<SignedPreKeyRecord>): Buffer;
|
|
362
|
+
export function TESTING_ErrorOnBorrowAsync(_input: null): Promise<void>;
|
|
363
|
+
export function TESTING_ErrorOnBorrowIo(asyncRuntime: Wrapper<NonSuspendingBackgroundThreadRuntime>, _input: null): Promise<void>;
|
|
364
|
+
export function TESTING_ErrorOnBorrowSync(_input: null): void;
|
|
365
|
+
export function TESTING_ErrorOnReturnAsync(_needsCleanup: null): Promise<null>;
|
|
366
|
+
export function TESTING_ErrorOnReturnIo(asyncRuntime: Wrapper<NonSuspendingBackgroundThreadRuntime>, _needsCleanup: null): Promise<null>;
|
|
367
|
+
export function TESTING_ErrorOnReturnSync(_needsCleanup: null): null;
|
|
368
|
+
export function TESTING_FutureFailure(asyncRuntime: Wrapper<NonSuspendingBackgroundThreadRuntime>, _input: number): Promise<number>;
|
|
369
|
+
export function TESTING_FutureSuccess(asyncRuntime: Wrapper<NonSuspendingBackgroundThreadRuntime>, input: number): Promise<number>;
|
|
370
|
+
export function TESTING_NonSuspendingBackgroundThreadRuntime_New(): NonSuspendingBackgroundThreadRuntime;
|
|
371
|
+
export function TESTING_PanicInBodyAsync(_input: null): Promise<void>;
|
|
372
|
+
export function TESTING_PanicInBodyIo(asyncRuntime: Wrapper<NonSuspendingBackgroundThreadRuntime>, _input: null): Promise<void>;
|
|
373
|
+
export function TESTING_PanicInBodySync(_input: null): void;
|
|
374
|
+
export function TESTING_PanicOnBorrowAsync(_input: null): Promise<void>;
|
|
375
|
+
export function TESTING_PanicOnBorrowIo(asyncRuntime: Wrapper<NonSuspendingBackgroundThreadRuntime>, _input: null): Promise<void>;
|
|
376
|
+
export function TESTING_PanicOnBorrowSync(_input: null): void;
|
|
377
|
+
export function TESTING_PanicOnLoadAsync(_needsCleanup: null, _input: null): Promise<void>;
|
|
378
|
+
export function TESTING_PanicOnLoadIo(asyncRuntime: Wrapper<NonSuspendingBackgroundThreadRuntime>, _needsCleanup: null, _input: null): Promise<void>;
|
|
379
|
+
export function TESTING_PanicOnLoadSync(_needsCleanup: null, _input: null): void;
|
|
380
|
+
export function TESTING_PanicOnReturnAsync(_needsCleanup: null): Promise<null>;
|
|
381
|
+
export function TESTING_PanicOnReturnIo(asyncRuntime: Wrapper<NonSuspendingBackgroundThreadRuntime>, _needsCleanup: null): Promise<null>;
|
|
382
|
+
export function TESTING_PanicOnReturnSync(_needsCleanup: null): null;
|
|
347
383
|
export function UnidentifiedSenderMessageContent_Deserialize(data: Buffer): UnidentifiedSenderMessageContent;
|
|
348
384
|
export function UnidentifiedSenderMessageContent_GetContentHint(m: Wrapper<UnidentifiedSenderMessageContent>): number;
|
|
349
385
|
export function UnidentifiedSenderMessageContent_GetContents(obj: Wrapper<UnidentifiedSenderMessageContent>): Buffer;
|
|
@@ -362,6 +398,7 @@ export function UuidCiphertext_CheckValidContents(buffer: Buffer): void;
|
|
|
362
398
|
export function ValidatingMac_Finalize(mac: Wrapper<ValidatingMac>): number;
|
|
363
399
|
export function ValidatingMac_Initialize(key: Buffer, chunkSize: number, digests: Buffer): ValidatingMac;
|
|
364
400
|
export function ValidatingMac_Update(mac: Wrapper<ValidatingMac>, bytes: Buffer, offset: number, length: number): number;
|
|
401
|
+
export function WebpSanitizer_Sanitize(input: SyncInputStream, len: Buffer): void;
|
|
365
402
|
export function initLogger(maxLevel: LogLevel, callback: (level: LogLevel, target: string, file: string | null, line: number | null, message: string) => void): void
|
|
366
403
|
interface Aes256GcmSiv { readonly __type: unique symbol; }
|
|
367
404
|
interface AuthCredential { readonly __type: unique symbol; }
|
|
@@ -382,6 +419,7 @@ interface KyberKeyPair { readonly __type: unique symbol; }
|
|
|
382
419
|
interface KyberPreKeyRecord { readonly __type: unique symbol; }
|
|
383
420
|
interface KyberPublicKey { readonly __type: unique symbol; }
|
|
384
421
|
interface KyberSecretKey { readonly __type: unique symbol; }
|
|
422
|
+
interface NonSuspendingBackgroundThreadRuntime { readonly __type: unique symbol; }
|
|
385
423
|
interface PlaintextContent { readonly __type: unique symbol; }
|
|
386
424
|
interface PreKeyBundle { readonly __type: unique symbol; }
|
|
387
425
|
interface PreKeyRecord { readonly __type: unique symbol; }
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
/**
|
|
3
|
+
* Sanitize a WebP input.
|
|
4
|
+
*
|
|
5
|
+
* @param input A WebP format input stream.
|
|
6
|
+
* @param length The exact length of the input stream.
|
|
7
|
+
* @throws IoError If an IO error on the input occurs.
|
|
8
|
+
* @throws InvalidMediaInputError If the input could not be parsed because it was invalid.
|
|
9
|
+
* @throws UnsupportedMediaInputError If the input could not be parsed because it's unsupported in some way.
|
|
10
|
+
*/
|
|
11
|
+
export declare function sanitize(input: Buffer): void;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
//
|
|
3
|
+
// Copyright 2023 Signal Messenger, LLC.
|
|
4
|
+
// SPDX-License-Identifier: AGPL-3.0-only
|
|
5
|
+
//
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.sanitize = void 0;
|
|
8
|
+
/**
|
|
9
|
+
* A WebP format “sanitizer”.
|
|
10
|
+
*
|
|
11
|
+
* The sanitizer currently simply checks the validity of a WebP file input, so that passing a malformed file to an
|
|
12
|
+
* unsafe parser can be avoided.
|
|
13
|
+
*
|
|
14
|
+
* @module WebpSanitizer
|
|
15
|
+
*/
|
|
16
|
+
const Native = require("../Native");
|
|
17
|
+
const BigIntUtil_1 = require("./zkgroup/internal/BigIntUtil");
|
|
18
|
+
/**
|
|
19
|
+
* Sanitize a WebP input.
|
|
20
|
+
*
|
|
21
|
+
* @param input A WebP format input stream.
|
|
22
|
+
* @param length The exact length of the input stream.
|
|
23
|
+
* @throws IoError If an IO error on the input occurs.
|
|
24
|
+
* @throws InvalidMediaInputError If the input could not be parsed because it was invalid.
|
|
25
|
+
* @throws UnsupportedMediaInputError If the input could not be parsed because it's unsupported in some way.
|
|
26
|
+
*/
|
|
27
|
+
function sanitize(input) {
|
|
28
|
+
Native.WebpSanitizer_Sanitize(input, (0, BigIntUtil_1.bufferFromBigUInt64BE)(BigInt(input.length)));
|
|
29
|
+
}
|
|
30
|
+
exports.sanitize = sanitize;
|
|
31
|
+
//# sourceMappingURL=WebpSanitizer.js.map
|
package/dist/index.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ export * from './Address';
|
|
|
5
5
|
export * as usernames from './usernames';
|
|
6
6
|
export * as io from './io';
|
|
7
7
|
export * as Mp4Sanitizer from './Mp4Sanitizer';
|
|
8
|
+
export * as WebpSanitizer from './WebpSanitizer';
|
|
8
9
|
import * as Native from '../Native';
|
|
9
10
|
export declare enum CiphertextMessageType {
|
|
10
11
|
Whisper = 2,
|
package/dist/index.js
CHANGED
|
@@ -27,8 +27,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
27
27
|
});
|
|
28
28
|
};
|
|
29
29
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30
|
-
exports.
|
|
31
|
-
exports.initLogger = exports.LogLevel = exports.HsmEnclaveClient = exports.Cds2Client = exports.sealedSenderDecryptToUsmc = exports.sealedSenderDecryptMessage = exports.sealedSenderMultiRecipientMessageForSingleRecipient = exports.sealedSenderMultiRecipientEncrypt = void 0;
|
|
30
|
+
exports.sealedSenderEncryptMessage = exports.signalDecryptPreKey = exports.signalDecrypt = exports.signalEncrypt = exports.processPreKeyBundle = exports.DecryptionErrorMessage = exports.PlaintextContent = exports.CiphertextMessage = exports.SealedSenderDecryptionResult = exports.groupDecrypt = exports.groupEncrypt = exports.SenderKeyStore = exports.KyberPreKeyStore = exports.SignedPreKeyStore = exports.PreKeyStore = exports.IdentityKeyStore = exports.SessionStore = exports.UnidentifiedSenderMessageContent = exports.SenderKeyMessage = exports.processSenderKeyDistributionMessage = exports.SenderKeyDistributionMessage = exports.SenderCertificate = exports.SenderKeyRecord = exports.ServerCertificate = exports.SessionRecord = exports.PreKeySignalMessage = exports.SignalMessage = exports.KyberPreKeyRecord = exports.SignedPreKeyRecord = exports.PreKeyRecord = exports.PreKeyBundle = exports.IdentityKeyPair = exports.KEMKeyPair = exports.KEMSecretKey = exports.KEMPublicKey = exports.PrivateKey = exports.PublicKey = exports.Aes256GcmSiv = exports.Fingerprint = exports.DisplayableFingerprint = exports.ScannableFingerprint = exports.hkdf = exports.HKDF = exports.ContentHint = exports.Direction = exports.CiphertextMessageType = exports.WebpSanitizer = exports.Mp4Sanitizer = exports.io = exports.usernames = void 0;
|
|
31
|
+
exports.initLogger = exports.LogLevel = exports.HsmEnclaveClient = exports.Cds2Client = exports.sealedSenderDecryptToUsmc = exports.sealedSenderDecryptMessage = exports.sealedSenderMultiRecipientMessageForSingleRecipient = exports.sealedSenderMultiRecipientEncrypt = exports.sealedSenderEncrypt = void 0;
|
|
32
32
|
const uuid = require("uuid");
|
|
33
33
|
const Errors = require("./Errors");
|
|
34
34
|
__exportStar(require("./Errors"), exports);
|
|
@@ -37,6 +37,7 @@ __exportStar(require("./Address"), exports);
|
|
|
37
37
|
exports.usernames = require("./usernames");
|
|
38
38
|
exports.io = require("./io");
|
|
39
39
|
exports.Mp4Sanitizer = require("./Mp4Sanitizer");
|
|
40
|
+
exports.WebpSanitizer = require("./WebpSanitizer");
|
|
40
41
|
const Native = require("../Native");
|
|
41
42
|
Native.registerErrors(Errors);
|
|
42
43
|
// These enums must be kept in sync with their Rust counterparts.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import ByteArray from '../internal/ByteArray';
|
|
3
|
+
import GenericServerPublicParams from '../GenericServerPublicParams';
|
|
4
|
+
import BackupAuthCredentialPresentation from './BackupAuthCredentialPresentation';
|
|
5
|
+
export default class BackupAuthCredential extends ByteArray {
|
|
6
|
+
private readonly __type?;
|
|
7
|
+
constructor(contents: Buffer);
|
|
8
|
+
present(serverParams: GenericServerPublicParams): BackupAuthCredentialPresentation;
|
|
9
|
+
presentWithRandom(serverParams: GenericServerPublicParams, random: Buffer): BackupAuthCredentialPresentation;
|
|
10
|
+
getBackupId(): Buffer;
|
|
11
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
//
|
|
3
|
+
// Copyright 2023 Signal Messenger, LLC.
|
|
4
|
+
// SPDX-License-Identifier: AGPL-3.0-only
|
|
5
|
+
//
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
const crypto_1 = require("crypto");
|
|
8
|
+
const Native = require("../../../Native");
|
|
9
|
+
const ByteArray_1 = require("../internal/ByteArray");
|
|
10
|
+
const Constants_1 = require("../internal/Constants");
|
|
11
|
+
const BackupAuthCredentialPresentation_1 = require("./BackupAuthCredentialPresentation");
|
|
12
|
+
class BackupAuthCredential extends ByteArray_1.default {
|
|
13
|
+
constructor(contents) {
|
|
14
|
+
super(contents, Native.BackupAuthCredential_CheckValidContents);
|
|
15
|
+
}
|
|
16
|
+
present(serverParams) {
|
|
17
|
+
const random = (0, crypto_1.randomBytes)(Constants_1.RANDOM_LENGTH);
|
|
18
|
+
return this.presentWithRandom(serverParams, random);
|
|
19
|
+
}
|
|
20
|
+
presentWithRandom(serverParams, random) {
|
|
21
|
+
return new BackupAuthCredentialPresentation_1.default(Native.BackupAuthCredential_PresentDeterministic(this.contents, serverParams.contents, random));
|
|
22
|
+
}
|
|
23
|
+
getBackupId() {
|
|
24
|
+
return Native.BackupAuthCredential_GetBackupId(this.contents);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
exports.default = BackupAuthCredential;
|
|
28
|
+
//# sourceMappingURL=BackupAuthCredential.js.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import ByteArray from '../internal/ByteArray';
|
|
3
|
+
import GenericServerSecretParams from '../GenericServerSecretParams';
|
|
4
|
+
export default class BackupAuthCredentialPresentation extends ByteArray {
|
|
5
|
+
private readonly __type?;
|
|
6
|
+
constructor(contents: Buffer);
|
|
7
|
+
verify(serverParams: GenericServerSecretParams, now?: Date): void;
|
|
8
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
//
|
|
3
|
+
// Copyright 2023 Signal Messenger, LLC.
|
|
4
|
+
// SPDX-License-Identifier: AGPL-3.0-only
|
|
5
|
+
//
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
const ByteArray_1 = require("../internal/ByteArray");
|
|
8
|
+
const Native = require("../../../Native");
|
|
9
|
+
class BackupAuthCredentialPresentation extends ByteArray_1.default {
|
|
10
|
+
constructor(contents) {
|
|
11
|
+
super(contents, Native.BackupAuthCredentialPresentation_CheckValidContents);
|
|
12
|
+
}
|
|
13
|
+
verify(serverParams, now = new Date()) {
|
|
14
|
+
Native.BackupAuthCredentialPresentation_Verify(this.contents, Math.floor(now.getTime() / 1000), serverParams.contents);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
exports.default = BackupAuthCredentialPresentation;
|
|
18
|
+
//# sourceMappingURL=BackupAuthCredentialPresentation.js.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import ByteArray from '../internal/ByteArray';
|
|
3
|
+
import GenericServerSecretParams from '../GenericServerSecretParams';
|
|
4
|
+
import BackupAuthCredentialResponse from './BackupAuthCredentialResponse';
|
|
5
|
+
export default class BackupAuthCredentialRequest extends ByteArray {
|
|
6
|
+
private readonly __type?;
|
|
7
|
+
constructor(contents: Buffer);
|
|
8
|
+
issueCredential(timestamp: number, receiptLevel: bigint, params: GenericServerSecretParams): BackupAuthCredentialResponse;
|
|
9
|
+
issueCredentialWithRandom(timestamp: number, receiptLevel: bigint, params: GenericServerSecretParams, random: Buffer): BackupAuthCredentialResponse;
|
|
10
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
//
|
|
3
|
+
// Copyright 2023 Signal Messenger, LLC.
|
|
4
|
+
// SPDX-License-Identifier: AGPL-3.0-only
|
|
5
|
+
//
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
const crypto_1 = require("crypto");
|
|
8
|
+
const Native = require("../../../Native");
|
|
9
|
+
const ByteArray_1 = require("../internal/ByteArray");
|
|
10
|
+
const Constants_1 = require("../internal/Constants");
|
|
11
|
+
const BackupAuthCredentialResponse_1 = require("./BackupAuthCredentialResponse");
|
|
12
|
+
const BigIntUtil_1 = require("../internal/BigIntUtil");
|
|
13
|
+
class BackupAuthCredentialRequest extends ByteArray_1.default {
|
|
14
|
+
constructor(contents) {
|
|
15
|
+
super(contents, Native.BackupAuthCredentialRequest_CheckValidContents);
|
|
16
|
+
}
|
|
17
|
+
issueCredential(timestamp, receiptLevel, params) {
|
|
18
|
+
const random = (0, crypto_1.randomBytes)(Constants_1.RANDOM_LENGTH);
|
|
19
|
+
return this.issueCredentialWithRandom(timestamp, receiptLevel, params, random);
|
|
20
|
+
}
|
|
21
|
+
issueCredentialWithRandom(timestamp, receiptLevel, params, random) {
|
|
22
|
+
return new BackupAuthCredentialResponse_1.default(Native.BackupAuthCredentialRequest_IssueDeterministic(this.contents, timestamp, (0, BigIntUtil_1.bufferFromBigUInt64BE)(receiptLevel), params.contents, random));
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
exports.default = BackupAuthCredentialRequest;
|
|
26
|
+
//# sourceMappingURL=BackupAuthCredentialRequest.js.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import ByteArray from '../internal/ByteArray';
|
|
3
|
+
import BackupAuthCredentialRequest from './BackupAuthCredentialRequest';
|
|
4
|
+
import BackupAuthCredentialResponse from './BackupAuthCredentialResponse';
|
|
5
|
+
import BackupAuthCredential from './BackupAuthCredential';
|
|
6
|
+
import GenericServerPublicParams from '../GenericServerPublicParams';
|
|
7
|
+
import { Uuid } from '../..';
|
|
8
|
+
export default class BackupAuthCredentialRequestContext extends ByteArray {
|
|
9
|
+
private readonly __type?;
|
|
10
|
+
constructor(contents: Buffer);
|
|
11
|
+
static create(backupKey: Buffer, aci: Uuid): BackupAuthCredentialRequestContext;
|
|
12
|
+
getRequest(): BackupAuthCredentialRequest;
|
|
13
|
+
receive(response: BackupAuthCredentialResponse, params: GenericServerPublicParams, expectedReceiptLevel: bigint): BackupAuthCredential;
|
|
14
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
//
|
|
3
|
+
// Copyright 2023 Signal Messenger, LLC.
|
|
4
|
+
// SPDX-License-Identifier: AGPL-3.0-only
|
|
5
|
+
//
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
const uuid = require("uuid");
|
|
8
|
+
const ByteArray_1 = require("../internal/ByteArray");
|
|
9
|
+
const Native = require("../../../Native");
|
|
10
|
+
const BackupAuthCredentialRequest_1 = require("./BackupAuthCredentialRequest");
|
|
11
|
+
const BackupAuthCredential_1 = require("./BackupAuthCredential");
|
|
12
|
+
const BigIntUtil_1 = require("../internal/BigIntUtil");
|
|
13
|
+
class BackupAuthCredentialRequestContext extends ByteArray_1.default {
|
|
14
|
+
constructor(contents) {
|
|
15
|
+
super(contents, Native.BackupAuthCredentialRequestContext_CheckValidContents);
|
|
16
|
+
}
|
|
17
|
+
static create(backupKey, aci) {
|
|
18
|
+
return new BackupAuthCredentialRequestContext(Native.BackupAuthCredentialRequestContext_New(backupKey, Buffer.from(uuid.parse(aci))));
|
|
19
|
+
}
|
|
20
|
+
getRequest() {
|
|
21
|
+
return new BackupAuthCredentialRequest_1.default(Native.BackupAuthCredentialRequestContext_GetRequest(this.contents));
|
|
22
|
+
}
|
|
23
|
+
receive(response, params, expectedReceiptLevel) {
|
|
24
|
+
return new BackupAuthCredential_1.default(Native.BackupAuthCredentialRequestContext_ReceiveResponse(this.contents, response.contents, params.contents, (0, BigIntUtil_1.bufferFromBigUInt64BE)(expectedReceiptLevel)));
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
exports.default = BackupAuthCredentialRequestContext;
|
|
28
|
+
//# sourceMappingURL=BackupAuthCredentialRequestContext.js.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
//
|
|
3
|
+
// Copyright 2023 Signal Messenger, LLC.
|
|
4
|
+
// SPDX-License-Identifier: AGPL-3.0-only
|
|
5
|
+
//
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
const ByteArray_1 = require("../internal/ByteArray");
|
|
8
|
+
const Native = require("../../../Native");
|
|
9
|
+
class BackupAuthCredentialResponse extends ByteArray_1.default {
|
|
10
|
+
constructor(contents) {
|
|
11
|
+
super(contents, Native.BackupAuthCredentialResponse_CheckValidContents);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
exports.default = BackupAuthCredentialResponse;
|
|
15
|
+
//# sourceMappingURL=BackupAuthCredentialResponse.js.map
|
package/dist/zkgroup/index.d.ts
CHANGED
|
@@ -45,3 +45,8 @@ export { default as CreateCallLinkCredentialPresentation } from './calllinks/Cre
|
|
|
45
45
|
export { default as CreateCallLinkCredentialRequest } from './calllinks/CreateCallLinkCredentialRequest';
|
|
46
46
|
export { default as CreateCallLinkCredentialRequestContext } from './calllinks/CreateCallLinkCredentialRequestContext';
|
|
47
47
|
export { default as CreateCallLinkCredentialResponse } from './calllinks/CreateCallLinkCredentialResponse';
|
|
48
|
+
export { default as BackupAuthCredential } from './backups/BackupAuthCredential';
|
|
49
|
+
export { default as BackupAuthCredentialPresentation } from './backups/BackupAuthCredentialPresentation';
|
|
50
|
+
export { default as BackupAuthCredentialRequest } from './backups/BackupAuthCredentialRequest';
|
|
51
|
+
export { default as BackupAuthCredentialRequestContext } from './backups/BackupAuthCredentialRequestContext';
|
|
52
|
+
export { default as BackupAuthCredentialResponse } from './backups/BackupAuthCredentialResponse';
|
package/dist/zkgroup/index.js
CHANGED
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
5
5
|
//
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.CreateCallLinkCredentialResponse = exports.CreateCallLinkCredentialRequestContext = exports.CreateCallLinkCredentialRequest = exports.CreateCallLinkCredentialPresentation = exports.CreateCallLinkCredential = exports.CallLinkAuthCredentialResponse = exports.CallLinkAuthCredentialPresentation = exports.CallLinkAuthCredential = exports.CallLinkSecretParams = exports.CallLinkPublicParams = exports.ReceiptSerial = exports.ReceiptCredentialResponse = exports.ReceiptCredentialRequestContext = exports.ReceiptCredentialRequest = exports.ReceiptCredentialPresentation = exports.ReceiptCredential = exports.ServerZkReceiptOperations = exports.ClientZkReceiptOperations = exports.ExpiringProfileKeyCredentialResponse = exports.ExpiringProfileKeyCredential = exports.ProfileKeyVersion = exports.ProfileKeyCredentialRequestContext = exports.ProfileKeyCredentialRequest = exports.ProfileKeyCredentialPresentation = exports.ProfileKeyCommitment = exports.ProfileKey = exports.ServerZkProfileOperations = exports.ClientZkProfileOperations = exports.UuidCiphertext = exports.ProfileKeyCiphertext = exports.GroupSecretParams = exports.GroupPublicParams = exports.GroupMasterKey = exports.GroupIdentifier = exports.ClientZkGroupCipher = exports.AuthCredentialWithPniResponse = exports.AuthCredentialWithPni = exports.AuthCredentialPresentation = exports.AuthCredentialResponse = exports.AuthCredential = exports.ServerZkAuthOperations = exports.ClientZkAuthOperations = exports.NotarySignature = exports.GenericServerSecretParams = exports.GenericServerPublicParams = exports.ServerSecretParams = exports.ServerPublicParams = void 0;
|
|
7
|
+
exports.BackupAuthCredentialRequest = exports.BackupAuthCredentialPresentation = exports.BackupAuthCredential = exports.CreateCallLinkCredentialResponse = exports.CreateCallLinkCredentialRequestContext = exports.CreateCallLinkCredentialRequest = exports.CreateCallLinkCredentialPresentation = exports.CreateCallLinkCredential = exports.CallLinkAuthCredentialResponse = exports.CallLinkAuthCredentialPresentation = exports.CallLinkAuthCredential = exports.CallLinkSecretParams = exports.CallLinkPublicParams = exports.ReceiptSerial = exports.ReceiptCredentialResponse = exports.ReceiptCredentialRequestContext = exports.ReceiptCredentialRequest = exports.ReceiptCredentialPresentation = exports.ReceiptCredential = exports.ServerZkReceiptOperations = exports.ClientZkReceiptOperations = exports.ExpiringProfileKeyCredentialResponse = exports.ExpiringProfileKeyCredential = exports.ProfileKeyVersion = exports.ProfileKeyCredentialRequestContext = exports.ProfileKeyCredentialRequest = exports.ProfileKeyCredentialPresentation = exports.ProfileKeyCommitment = exports.ProfileKey = exports.ServerZkProfileOperations = exports.ClientZkProfileOperations = exports.UuidCiphertext = exports.ProfileKeyCiphertext = exports.GroupSecretParams = exports.GroupPublicParams = exports.GroupMasterKey = exports.GroupIdentifier = exports.ClientZkGroupCipher = exports.AuthCredentialWithPniResponse = exports.AuthCredentialWithPni = exports.AuthCredentialPresentation = exports.AuthCredentialResponse = exports.AuthCredential = exports.ServerZkAuthOperations = exports.ClientZkAuthOperations = exports.NotarySignature = exports.GenericServerSecretParams = exports.GenericServerPublicParams = exports.ServerSecretParams = exports.ServerPublicParams = void 0;
|
|
8
|
+
exports.BackupAuthCredentialResponse = exports.BackupAuthCredentialRequestContext = void 0;
|
|
8
9
|
// Root
|
|
9
10
|
var ServerPublicParams_1 = require("./ServerPublicParams");
|
|
10
11
|
Object.defineProperty(exports, "ServerPublicParams", { enumerable: true, get: function () { return ServerPublicParams_1.default; } });
|
|
@@ -105,4 +106,15 @@ var CreateCallLinkCredentialRequestContext_1 = require("./calllinks/CreateCallLi
|
|
|
105
106
|
Object.defineProperty(exports, "CreateCallLinkCredentialRequestContext", { enumerable: true, get: function () { return CreateCallLinkCredentialRequestContext_1.default; } });
|
|
106
107
|
var CreateCallLinkCredentialResponse_1 = require("./calllinks/CreateCallLinkCredentialResponse");
|
|
107
108
|
Object.defineProperty(exports, "CreateCallLinkCredentialResponse", { enumerable: true, get: function () { return CreateCallLinkCredentialResponse_1.default; } });
|
|
109
|
+
// Backup Auth
|
|
110
|
+
var BackupAuthCredential_1 = require("./backups/BackupAuthCredential");
|
|
111
|
+
Object.defineProperty(exports, "BackupAuthCredential", { enumerable: true, get: function () { return BackupAuthCredential_1.default; } });
|
|
112
|
+
var BackupAuthCredentialPresentation_1 = require("./backups/BackupAuthCredentialPresentation");
|
|
113
|
+
Object.defineProperty(exports, "BackupAuthCredentialPresentation", { enumerable: true, get: function () { return BackupAuthCredentialPresentation_1.default; } });
|
|
114
|
+
var BackupAuthCredentialRequest_1 = require("./backups/BackupAuthCredentialRequest");
|
|
115
|
+
Object.defineProperty(exports, "BackupAuthCredentialRequest", { enumerable: true, get: function () { return BackupAuthCredentialRequest_1.default; } });
|
|
116
|
+
var BackupAuthCredentialRequestContext_1 = require("./backups/BackupAuthCredentialRequestContext");
|
|
117
|
+
Object.defineProperty(exports, "BackupAuthCredentialRequestContext", { enumerable: true, get: function () { return BackupAuthCredentialRequestContext_1.default; } });
|
|
118
|
+
var BackupAuthCredentialResponse_1 = require("./backups/BackupAuthCredentialResponse");
|
|
119
|
+
Object.defineProperty(exports, "BackupAuthCredentialResponse", { enumerable: true, get: function () { return BackupAuthCredentialResponse_1.default; } });
|
|
108
120
|
//# sourceMappingURL=index.js.map
|
package/package.json
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|