@signalapp/libsignal-client 0.30.0 → 0.30.2
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 +11 -11
- package/dist/Address.d.ts +7 -9
- package/dist/Address.js +15 -8
- package/dist/index.d.ts +14 -2
- package/dist/index.js +40 -11
- 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
|
@@ -117,8 +117,8 @@ export function GenericServerPublicParams_CheckValidContents(paramsBytes: Buffer
|
|
|
117
117
|
export function GenericServerSecretParams_CheckValidContents(paramsBytes: Buffer): void;
|
|
118
118
|
export function GenericServerSecretParams_GenerateDeterministic(randomness: Buffer): Buffer;
|
|
119
119
|
export function GenericServerSecretParams_GetPublicParams(paramsBytes: Buffer): Buffer;
|
|
120
|
-
export function GroupCipher_DecryptMessage(sender: Wrapper<ProtocolAddress>, message: Buffer, store: SenderKeyStore
|
|
121
|
-
export function GroupCipher_EncryptMessage(sender: Wrapper<ProtocolAddress>, distributionId: Uuid, message: Buffer, store: SenderKeyStore
|
|
120
|
+
export function GroupCipher_DecryptMessage(sender: Wrapper<ProtocolAddress>, message: Buffer, store: SenderKeyStore): Promise<Buffer>;
|
|
121
|
+
export function GroupCipher_EncryptMessage(sender: Wrapper<ProtocolAddress>, distributionId: Uuid, message: Buffer, store: SenderKeyStore): Promise<CiphertextMessage>;
|
|
122
122
|
export function GroupMasterKey_CheckValidContents(buffer: Buffer): void;
|
|
123
123
|
export function GroupPublicParams_CheckValidContents(buffer: Buffer): void;
|
|
124
124
|
export function GroupPublicParams_GetGroupIdentifier(groupPublicParams: Serialized<GroupPublicParams>): Buffer;
|
|
@@ -241,9 +241,9 @@ export function SealedSenderDecryptionResult_GetSenderE164(obj: Wrapper<SealedSe
|
|
|
241
241
|
export function SealedSenderDecryptionResult_GetSenderUuid(obj: Wrapper<SealedSenderDecryptionResult>): string;
|
|
242
242
|
export function SealedSenderDecryptionResult_Message(obj: Wrapper<SealedSenderDecryptionResult>): Buffer;
|
|
243
243
|
export function SealedSender_DecryptMessage(message: Buffer, trustRoot: Wrapper<PublicKey>, timestamp: Timestamp, localE164: string | null, localUuid: string, localDeviceId: number, sessionStore: SessionStore, identityStore: IdentityKeyStore, prekeyStore: PreKeyStore, signedPrekeyStore: SignedPreKeyStore, kyberPrekeyStore: KyberPreKeyStore): Promise<SealedSenderDecryptionResult>;
|
|
244
|
-
export function SealedSender_DecryptToUsmc(ctext: Buffer, identityStore: IdentityKeyStore
|
|
245
|
-
export function SealedSender_Encrypt(destination: Wrapper<ProtocolAddress>, content: Wrapper<UnidentifiedSenderMessageContent>, identityKeyStore: IdentityKeyStore
|
|
246
|
-
export function SealedSender_MultiRecipientEncrypt(recipients: Wrapper<ProtocolAddress>[], recipientSessions: Wrapper<SessionRecord>[], content: Wrapper<UnidentifiedSenderMessageContent>, identityKeyStore: IdentityKeyStore
|
|
244
|
+
export function SealedSender_DecryptToUsmc(ctext: Buffer, identityStore: IdentityKeyStore): Promise<UnidentifiedSenderMessageContent>;
|
|
245
|
+
export function SealedSender_Encrypt(destination: Wrapper<ProtocolAddress>, content: Wrapper<UnidentifiedSenderMessageContent>, identityKeyStore: IdentityKeyStore): Promise<Buffer>;
|
|
246
|
+
export function SealedSender_MultiRecipientEncrypt(recipients: Wrapper<ProtocolAddress>[], recipientSessions: Wrapper<SessionRecord>[], content: Wrapper<UnidentifiedSenderMessageContent>, identityKeyStore: IdentityKeyStore): Promise<Buffer>;
|
|
247
247
|
export function SealedSender_MultiRecipientMessageForSingleRecipient(encodedMultiRecipientMessage: Buffer): Buffer;
|
|
248
248
|
export function SenderCertificate_Deserialize(data: Buffer): SenderCertificate;
|
|
249
249
|
export function SenderCertificate_GetCertificate(obj: Wrapper<SenderCertificate>): Buffer;
|
|
@@ -257,14 +257,14 @@ export function SenderCertificate_GetServerCertificate(cert: Wrapper<SenderCerti
|
|
|
257
257
|
export function SenderCertificate_GetSignature(obj: Wrapper<SenderCertificate>): Buffer;
|
|
258
258
|
export function SenderCertificate_New(senderUuid: string, senderE164: string | null, senderDeviceId: number, senderKey: Wrapper<PublicKey>, expiration: Timestamp, signerCert: Wrapper<ServerCertificate>, signerKey: Wrapper<PrivateKey>): SenderCertificate;
|
|
259
259
|
export function SenderCertificate_Validate(cert: Wrapper<SenderCertificate>, key: Wrapper<PublicKey>, time: Timestamp): boolean;
|
|
260
|
-
export function SenderKeyDistributionMessage_Create(sender: Wrapper<ProtocolAddress>, distributionId: Uuid, store: SenderKeyStore
|
|
260
|
+
export function SenderKeyDistributionMessage_Create(sender: Wrapper<ProtocolAddress>, distributionId: Uuid, store: SenderKeyStore): Promise<SenderKeyDistributionMessage>;
|
|
261
261
|
export function SenderKeyDistributionMessage_Deserialize(data: Buffer): SenderKeyDistributionMessage;
|
|
262
262
|
export function SenderKeyDistributionMessage_GetChainId(obj: Wrapper<SenderKeyDistributionMessage>): number;
|
|
263
263
|
export function SenderKeyDistributionMessage_GetChainKey(obj: Wrapper<SenderKeyDistributionMessage>): Buffer;
|
|
264
264
|
export function SenderKeyDistributionMessage_GetDistributionId(obj: Wrapper<SenderKeyDistributionMessage>): Uuid;
|
|
265
265
|
export function SenderKeyDistributionMessage_GetIteration(obj: Wrapper<SenderKeyDistributionMessage>): number;
|
|
266
266
|
export function SenderKeyDistributionMessage_New(messageVersion: number, distributionId: Uuid, chainId: number, iteration: number, chainkey: Buffer, pk: Wrapper<PublicKey>): SenderKeyDistributionMessage;
|
|
267
|
-
export function SenderKeyDistributionMessage_Process(sender: Wrapper<ProtocolAddress>, senderKeyDistributionMessage: Wrapper<SenderKeyDistributionMessage>, store: SenderKeyStore
|
|
267
|
+
export function SenderKeyDistributionMessage_Process(sender: Wrapper<ProtocolAddress>, senderKeyDistributionMessage: Wrapper<SenderKeyDistributionMessage>, store: SenderKeyStore): Promise<void>;
|
|
268
268
|
export function SenderKeyDistributionMessage_Serialize(obj: Wrapper<SenderKeyDistributionMessage>): Buffer;
|
|
269
269
|
export function SenderKeyMessage_Deserialize(data: Buffer): SenderKeyMessage;
|
|
270
270
|
export function SenderKeyMessage_GetChainId(obj: Wrapper<SenderKeyMessage>): number;
|
|
@@ -313,10 +313,10 @@ export function ServiceId_ParseFromServiceIdString(input: string): Buffer;
|
|
|
313
313
|
export function ServiceId_ServiceIdBinary(value: Buffer): Buffer;
|
|
314
314
|
export function ServiceId_ServiceIdLog(value: Buffer): string;
|
|
315
315
|
export function ServiceId_ServiceIdString(value: Buffer): string;
|
|
316
|
-
export function SessionBuilder_ProcessPreKeyBundle(bundle: Wrapper<PreKeyBundle>, protocolAddress: Wrapper<ProtocolAddress>, sessionStore: SessionStore, identityKeyStore: IdentityKeyStore
|
|
317
|
-
export function SessionCipher_DecryptPreKeySignalMessage(message: Wrapper<PreKeySignalMessage>, protocolAddress: Wrapper<ProtocolAddress>, sessionStore: SessionStore, identityKeyStore: IdentityKeyStore, prekeyStore: PreKeyStore, signedPrekeyStore: SignedPreKeyStore, kyberPrekeyStore: KyberPreKeyStore
|
|
318
|
-
export function SessionCipher_DecryptSignalMessage(message: Wrapper<SignalMessage>, protocolAddress: Wrapper<ProtocolAddress>, sessionStore: SessionStore, identityKeyStore: IdentityKeyStore
|
|
319
|
-
export function SessionCipher_EncryptMessage(ptext: Buffer, protocolAddress: Wrapper<ProtocolAddress>, sessionStore: SessionStore, identityKeyStore: IdentityKeyStore
|
|
316
|
+
export function SessionBuilder_ProcessPreKeyBundle(bundle: Wrapper<PreKeyBundle>, protocolAddress: Wrapper<ProtocolAddress>, sessionStore: SessionStore, identityKeyStore: IdentityKeyStore): Promise<void>;
|
|
317
|
+
export function SessionCipher_DecryptPreKeySignalMessage(message: Wrapper<PreKeySignalMessage>, protocolAddress: Wrapper<ProtocolAddress>, sessionStore: SessionStore, identityKeyStore: IdentityKeyStore, prekeyStore: PreKeyStore, signedPrekeyStore: SignedPreKeyStore, kyberPrekeyStore: KyberPreKeyStore): Promise<Buffer>;
|
|
318
|
+
export function SessionCipher_DecryptSignalMessage(message: Wrapper<SignalMessage>, protocolAddress: Wrapper<ProtocolAddress>, sessionStore: SessionStore, identityKeyStore: IdentityKeyStore): Promise<Buffer>;
|
|
319
|
+
export function SessionCipher_EncryptMessage(ptext: Buffer, protocolAddress: Wrapper<ProtocolAddress>, sessionStore: SessionStore, identityKeyStore: IdentityKeyStore): Promise<CiphertextMessage>;
|
|
320
320
|
export function SessionRecord_ArchiveCurrentState(sessionRecord: Wrapper<SessionRecord>): void;
|
|
321
321
|
export function SessionRecord_CurrentRatchetKeyMatches(s: Wrapper<SessionRecord>, key: Wrapper<PublicKey>): boolean;
|
|
322
322
|
export function SessionRecord_Deserialize(data: Buffer): SessionRecord;
|
package/dist/Address.d.ts
CHANGED
|
@@ -4,20 +4,18 @@ declare enum ServiceIdKind {
|
|
|
4
4
|
Aci = 0,
|
|
5
5
|
Pni = 1
|
|
6
6
|
}
|
|
7
|
-
|
|
8
|
-
prototype: unknown;
|
|
9
|
-
}> = T['prototype'];
|
|
10
|
-
export declare class ServiceId extends Object {
|
|
7
|
+
export declare abstract class ServiceId extends Object {
|
|
11
8
|
private readonly serviceIdFixedWidthBinary;
|
|
12
|
-
|
|
13
|
-
protected static fromUuidBytesAndKind<T extends typeof ServiceId>(this: T
|
|
9
|
+
constructor(serviceIdFixedWidthBinary: Buffer);
|
|
10
|
+
protected static fromUuidBytesAndKind<T extends typeof ServiceId>(this: new (serviceIdFixedWidthBinary: Buffer) => InstanceType<T>, uuidBytes: ArrayLike<number>, kind: ServiceIdKind): InstanceType<T>;
|
|
14
11
|
getServiceIdBinary(): Buffer;
|
|
15
12
|
getServiceIdFixedWidthBinary(): Buffer;
|
|
16
13
|
getServiceIdString(): string;
|
|
17
14
|
toString(): string;
|
|
18
|
-
|
|
19
|
-
static
|
|
20
|
-
static
|
|
15
|
+
private downcastTo;
|
|
16
|
+
static parseFromServiceIdFixedWidthBinary<T extends typeof ServiceId>(this: T, serviceIdFixedWidthBinary: Buffer): InstanceType<T>;
|
|
17
|
+
static parseFromServiceIdBinary<T extends typeof ServiceId>(this: T, serviceIdBinary: Buffer): InstanceType<T>;
|
|
18
|
+
static parseFromServiceIdString<T extends typeof ServiceId>(this: T, serviceIdString: string): InstanceType<T>;
|
|
21
19
|
getRawUuid(): string;
|
|
22
20
|
getRawUuidBytes(): Buffer;
|
|
23
21
|
isEqual(other: ServiceId): boolean;
|
package/dist/Address.js
CHANGED
|
@@ -14,6 +14,7 @@ var ServiceIdKind;
|
|
|
14
14
|
})(ServiceIdKind || (ServiceIdKind = {}));
|
|
15
15
|
const SERVICE_ID_FIXED_WIDTH_BINARY_LEN = 17;
|
|
16
16
|
class ServiceId extends Object {
|
|
17
|
+
// This has to be public for `InstanceType<T>`, which we use below.
|
|
17
18
|
constructor(serviceIdFixedWidthBinary) {
|
|
18
19
|
super();
|
|
19
20
|
if (serviceIdFixedWidthBinary.length != SERVICE_ID_FIXED_WIDTH_BINARY_LEN) {
|
|
@@ -39,6 +40,13 @@ class ServiceId extends Object {
|
|
|
39
40
|
toString() {
|
|
40
41
|
return Native.ServiceId_ServiceIdLog(this.serviceIdFixedWidthBinary);
|
|
41
42
|
}
|
|
43
|
+
downcastTo(subclass) {
|
|
44
|
+
// Omitting `as object` results in TypeScript mistakenly assuming the branch is always taken.
|
|
45
|
+
if (this instanceof subclass) {
|
|
46
|
+
return this;
|
|
47
|
+
}
|
|
48
|
+
throw new TypeError(`expected ${subclass.name}, got ${this.constructor.name}`);
|
|
49
|
+
}
|
|
42
50
|
static parseFromServiceIdFixedWidthBinary(serviceIdFixedWidthBinary) {
|
|
43
51
|
let result;
|
|
44
52
|
switch (serviceIdFixedWidthBinary[0]) {
|
|
@@ -51,16 +59,15 @@ class ServiceId extends Object {
|
|
|
51
59
|
default:
|
|
52
60
|
throw new TypeError('unknown type in Service-Id-FixedWidthBinary');
|
|
53
61
|
}
|
|
54
|
-
|
|
55
|
-
return result;
|
|
56
|
-
}
|
|
57
|
-
throw new TypeError(`expected ${this.name}, got ${result.constructor.name}`);
|
|
62
|
+
return result.downcastTo(this);
|
|
58
63
|
}
|
|
59
64
|
static parseFromServiceIdBinary(serviceIdBinary) {
|
|
60
|
-
|
|
65
|
+
const result = ServiceId.parseFromServiceIdFixedWidthBinary(Native.ServiceId_ParseFromServiceIdBinary(serviceIdBinary));
|
|
66
|
+
return result.downcastTo(this);
|
|
61
67
|
}
|
|
62
68
|
static parseFromServiceIdString(serviceIdString) {
|
|
63
|
-
|
|
69
|
+
const result = this.parseFromServiceIdFixedWidthBinary(Native.ServiceId_ParseFromServiceIdString(serviceIdString));
|
|
70
|
+
return result.downcastTo(this);
|
|
64
71
|
}
|
|
65
72
|
getRawUuid() {
|
|
66
73
|
return uuid.stringify(this.serviceIdFixedWidthBinary, 1);
|
|
@@ -78,7 +85,7 @@ class Aci extends ServiceId {
|
|
|
78
85
|
return this.fromUuidBytes(uuid.parse(uuidString));
|
|
79
86
|
}
|
|
80
87
|
static fromUuidBytes(uuidBytes) {
|
|
81
|
-
return
|
|
88
|
+
return this.fromUuidBytesAndKind(uuidBytes, ServiceIdKind.Aci);
|
|
82
89
|
}
|
|
83
90
|
}
|
|
84
91
|
exports.Aci = Aci;
|
|
@@ -87,7 +94,7 @@ class Pni extends ServiceId {
|
|
|
87
94
|
return this.fromUuidBytes(uuid.parse(uuidString));
|
|
88
95
|
}
|
|
89
96
|
static fromUuidBytes(uuidBytes) {
|
|
90
|
-
return
|
|
97
|
+
return this.fromUuidBytesAndKind(uuidBytes, ServiceIdKind.Pni);
|
|
91
98
|
}
|
|
92
99
|
}
|
|
93
100
|
exports.Pni = Pni;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
export * from './Errors';
|
|
3
|
-
import { ProtocolAddress } from './Address';
|
|
3
|
+
import { Aci, ProtocolAddress } from './Address';
|
|
4
4
|
export * from './Address';
|
|
5
5
|
export * as usernames from './usernames';
|
|
6
6
|
export * as io from './io';
|
|
@@ -221,7 +221,7 @@ export declare class SenderCertificate {
|
|
|
221
221
|
readonly _nativeHandle: Native.SenderCertificate;
|
|
222
222
|
private constructor();
|
|
223
223
|
static _fromNativeHandle(nativeHandle: Native.SenderCertificate): SenderCertificate;
|
|
224
|
-
static new(senderUuid: string, senderE164: string | null, senderDeviceId: number, senderKey: PublicKey, expiration: number, signerCert: ServerCertificate, signerKey: PrivateKey): SenderCertificate;
|
|
224
|
+
static new(senderUuid: string | Aci, senderE164: string | null, senderDeviceId: number, senderKey: PublicKey, expiration: number, signerCert: ServerCertificate, signerKey: PrivateKey): SenderCertificate;
|
|
225
225
|
static deserialize(buffer: Buffer): SenderCertificate;
|
|
226
226
|
serialize(): Buffer;
|
|
227
227
|
certificate(): Buffer;
|
|
@@ -229,6 +229,12 @@ export declare class SenderCertificate {
|
|
|
229
229
|
key(): PublicKey;
|
|
230
230
|
senderE164(): string | null;
|
|
231
231
|
senderUuid(): string;
|
|
232
|
+
/**
|
|
233
|
+
* Returns an ACI if the sender is a valid UUID, `null` otherwise.
|
|
234
|
+
*
|
|
235
|
+
* In a future release SenderCertificate will *only* support ACIs.
|
|
236
|
+
*/
|
|
237
|
+
senderAci(): Aci | null;
|
|
232
238
|
senderDeviceId(): number;
|
|
233
239
|
serverCertificate(): ServerCertificate;
|
|
234
240
|
signature(): Buffer;
|
|
@@ -328,6 +334,12 @@ export declare class SealedSenderDecryptionResult {
|
|
|
328
334
|
message(): Buffer;
|
|
329
335
|
senderE164(): string | null;
|
|
330
336
|
senderUuid(): string;
|
|
337
|
+
/**
|
|
338
|
+
* Returns an ACI if the sender is a valid UUID, `null` otherwise.
|
|
339
|
+
*
|
|
340
|
+
* In a future release SenderCertificate will *only* support ACIs.
|
|
341
|
+
*/
|
|
342
|
+
senderAci(): Aci | null;
|
|
331
343
|
deviceId(): number;
|
|
332
344
|
}
|
|
333
345
|
interface CiphertextMessageConvertible {
|
package/dist/index.js
CHANGED
|
@@ -544,6 +544,9 @@ class SenderCertificate {
|
|
|
544
544
|
return new SenderCertificate(nativeHandle);
|
|
545
545
|
}
|
|
546
546
|
static new(senderUuid, senderE164, senderDeviceId, senderKey, expiration, signerCert, signerKey) {
|
|
547
|
+
if (typeof senderUuid !== 'string') {
|
|
548
|
+
senderUuid = senderUuid.getServiceIdString();
|
|
549
|
+
}
|
|
547
550
|
return new SenderCertificate(Native.SenderCertificate_New(senderUuid, senderE164, senderDeviceId, senderKey, expiration, signerCert, signerKey));
|
|
548
551
|
}
|
|
549
552
|
static deserialize(buffer) {
|
|
@@ -567,6 +570,19 @@ class SenderCertificate {
|
|
|
567
570
|
senderUuid() {
|
|
568
571
|
return Native.SenderCertificate_GetSenderUuid(this);
|
|
569
572
|
}
|
|
573
|
+
/**
|
|
574
|
+
* Returns an ACI if the sender is a valid UUID, `null` otherwise.
|
|
575
|
+
*
|
|
576
|
+
* In a future release SenderCertificate will *only* support ACIs.
|
|
577
|
+
*/
|
|
578
|
+
senderAci() {
|
|
579
|
+
try {
|
|
580
|
+
return Address_1.Aci.parseFromServiceIdString(this.senderUuid());
|
|
581
|
+
}
|
|
582
|
+
catch (_a) {
|
|
583
|
+
return null;
|
|
584
|
+
}
|
|
585
|
+
}
|
|
570
586
|
senderDeviceId() {
|
|
571
587
|
return Native.SenderCertificate_GetDeviceId(this);
|
|
572
588
|
}
|
|
@@ -587,7 +603,7 @@ class SenderKeyDistributionMessage {
|
|
|
587
603
|
}
|
|
588
604
|
static create(sender, distributionId, store) {
|
|
589
605
|
return __awaiter(this, void 0, void 0, function* () {
|
|
590
|
-
const handle = yield Native.SenderKeyDistributionMessage_Create(sender, Buffer.from(uuid.parse(distributionId)), store
|
|
606
|
+
const handle = yield Native.SenderKeyDistributionMessage_Create(sender, Buffer.from(uuid.parse(distributionId)), store);
|
|
591
607
|
return new SenderKeyDistributionMessage(handle);
|
|
592
608
|
});
|
|
593
609
|
}
|
|
@@ -616,7 +632,7 @@ class SenderKeyDistributionMessage {
|
|
|
616
632
|
exports.SenderKeyDistributionMessage = SenderKeyDistributionMessage;
|
|
617
633
|
function processSenderKeyDistributionMessage(sender, message, store) {
|
|
618
634
|
return __awaiter(this, void 0, void 0, function* () {
|
|
619
|
-
yield Native.SenderKeyDistributionMessage_Process(sender, message, store
|
|
635
|
+
yield Native.SenderKeyDistributionMessage_Process(sender, message, store);
|
|
620
636
|
});
|
|
621
637
|
}
|
|
622
638
|
exports.processSenderKeyDistributionMessage = processSenderKeyDistributionMessage;
|
|
@@ -811,13 +827,13 @@ class SenderKeyStore {
|
|
|
811
827
|
exports.SenderKeyStore = SenderKeyStore;
|
|
812
828
|
function groupEncrypt(sender, distributionId, store, message) {
|
|
813
829
|
return __awaiter(this, void 0, void 0, function* () {
|
|
814
|
-
return CiphertextMessage._fromNativeHandle(yield Native.GroupCipher_EncryptMessage(sender, Buffer.from(uuid.parse(distributionId)), message, store
|
|
830
|
+
return CiphertextMessage._fromNativeHandle(yield Native.GroupCipher_EncryptMessage(sender, Buffer.from(uuid.parse(distributionId)), message, store));
|
|
815
831
|
});
|
|
816
832
|
}
|
|
817
833
|
exports.groupEncrypt = groupEncrypt;
|
|
818
834
|
function groupDecrypt(sender, store, message) {
|
|
819
835
|
return __awaiter(this, void 0, void 0, function* () {
|
|
820
|
-
return Native.GroupCipher_DecryptMessage(sender, message, store
|
|
836
|
+
return Native.GroupCipher_DecryptMessage(sender, message, store);
|
|
821
837
|
});
|
|
822
838
|
}
|
|
823
839
|
exports.groupDecrypt = groupDecrypt;
|
|
@@ -837,6 +853,19 @@ class SealedSenderDecryptionResult {
|
|
|
837
853
|
senderUuid() {
|
|
838
854
|
return Native.SealedSenderDecryptionResult_GetSenderUuid(this);
|
|
839
855
|
}
|
|
856
|
+
/**
|
|
857
|
+
* Returns an ACI if the sender is a valid UUID, `null` otherwise.
|
|
858
|
+
*
|
|
859
|
+
* In a future release SenderCertificate will *only* support ACIs.
|
|
860
|
+
*/
|
|
861
|
+
senderAci() {
|
|
862
|
+
try {
|
|
863
|
+
return Address_1.Aci.parseFromServiceIdString(this.senderUuid());
|
|
864
|
+
}
|
|
865
|
+
catch (_a) {
|
|
866
|
+
return null;
|
|
867
|
+
}
|
|
868
|
+
}
|
|
840
869
|
deviceId() {
|
|
841
870
|
return Native.SealedSenderDecryptionResult_GetDeviceId(this);
|
|
842
871
|
}
|
|
@@ -918,21 +947,21 @@ class DecryptionErrorMessage {
|
|
|
918
947
|
}
|
|
919
948
|
exports.DecryptionErrorMessage = DecryptionErrorMessage;
|
|
920
949
|
function processPreKeyBundle(bundle, address, sessionStore, identityStore) {
|
|
921
|
-
return Native.SessionBuilder_ProcessPreKeyBundle(bundle, address, sessionStore, identityStore
|
|
950
|
+
return Native.SessionBuilder_ProcessPreKeyBundle(bundle, address, sessionStore, identityStore);
|
|
922
951
|
}
|
|
923
952
|
exports.processPreKeyBundle = processPreKeyBundle;
|
|
924
953
|
function signalEncrypt(message, address, sessionStore, identityStore) {
|
|
925
954
|
return __awaiter(this, void 0, void 0, function* () {
|
|
926
|
-
return CiphertextMessage._fromNativeHandle(yield Native.SessionCipher_EncryptMessage(message, address, sessionStore, identityStore
|
|
955
|
+
return CiphertextMessage._fromNativeHandle(yield Native.SessionCipher_EncryptMessage(message, address, sessionStore, identityStore));
|
|
927
956
|
});
|
|
928
957
|
}
|
|
929
958
|
exports.signalEncrypt = signalEncrypt;
|
|
930
959
|
function signalDecrypt(message, address, sessionStore, identityStore) {
|
|
931
|
-
return Native.SessionCipher_DecryptSignalMessage(message, address, sessionStore, identityStore
|
|
960
|
+
return Native.SessionCipher_DecryptSignalMessage(message, address, sessionStore, identityStore);
|
|
932
961
|
}
|
|
933
962
|
exports.signalDecrypt = signalDecrypt;
|
|
934
963
|
function signalDecryptPreKey(message, address, sessionStore, identityStore, prekeyStore, signedPrekeyStore, kyberPrekeyStore) {
|
|
935
|
-
return Native.SessionCipher_DecryptPreKeySignalMessage(message, address, sessionStore, identityStore, prekeyStore, signedPrekeyStore, kyberPrekeyStore
|
|
964
|
+
return Native.SessionCipher_DecryptPreKeySignalMessage(message, address, sessionStore, identityStore, prekeyStore, signedPrekeyStore, kyberPrekeyStore);
|
|
936
965
|
}
|
|
937
966
|
exports.signalDecryptPreKey = signalDecryptPreKey;
|
|
938
967
|
function sealedSenderEncryptMessage(message, address, senderCert, sessionStore, identityStore) {
|
|
@@ -944,13 +973,13 @@ function sealedSenderEncryptMessage(message, address, senderCert, sessionStore,
|
|
|
944
973
|
}
|
|
945
974
|
exports.sealedSenderEncryptMessage = sealedSenderEncryptMessage;
|
|
946
975
|
function sealedSenderEncrypt(content, address, identityStore) {
|
|
947
|
-
return Native.SealedSender_Encrypt(address, content, identityStore
|
|
976
|
+
return Native.SealedSender_Encrypt(address, content, identityStore);
|
|
948
977
|
}
|
|
949
978
|
exports.sealedSenderEncrypt = sealedSenderEncrypt;
|
|
950
979
|
function sealedSenderMultiRecipientEncrypt(content, recipients, identityStore, sessionStore) {
|
|
951
980
|
return __awaiter(this, void 0, void 0, function* () {
|
|
952
981
|
const recipientSessions = yield sessionStore.getExistingSessions(recipients);
|
|
953
|
-
return yield Native.SealedSender_MultiRecipientEncrypt(recipients, recipientSessions, content, identityStore
|
|
982
|
+
return yield Native.SealedSender_MultiRecipientEncrypt(recipients, recipientSessions, content, identityStore);
|
|
954
983
|
});
|
|
955
984
|
}
|
|
956
985
|
exports.sealedSenderMultiRecipientEncrypt = sealedSenderMultiRecipientEncrypt;
|
|
@@ -968,7 +997,7 @@ function sealedSenderDecryptMessage(message, trustRoot, timestamp, localE164, lo
|
|
|
968
997
|
exports.sealedSenderDecryptMessage = sealedSenderDecryptMessage;
|
|
969
998
|
function sealedSenderDecryptToUsmc(message, identityStore) {
|
|
970
999
|
return __awaiter(this, void 0, void 0, function* () {
|
|
971
|
-
const usmc = yield Native.SealedSender_DecryptToUsmc(message, identityStore
|
|
1000
|
+
const usmc = yield Native.SealedSender_DecryptToUsmc(message, identityStore);
|
|
972
1001
|
return UnidentifiedSenderMessageContent._fromNativeHandle(usmc);
|
|
973
1002
|
});
|
|
974
1003
|
}
|
package/package.json
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|