@signalapp/libsignal-client
Advanced tools
Comparing version 0.60.1 to 0.60.2
@@ -36,3 +36,9 @@ /// <reference types="node" /> | ||
} | ||
/** A key used for many aspects of backups. */ | ||
/** | ||
* A key used for many aspects of backups. | ||
* | ||
* Clients are typically concerned with two long-lived keys: a "messages" key (sometimes called "the | ||
* root backup key" or just "the backup key") that's derived from an {@link AccountEntropyPool}, and | ||
* a "media" key (formally the "media root backup key") that's not derived from anything else. | ||
*/ | ||
export declare class BackupKey extends ByteArray { | ||
@@ -50,16 +56,43 @@ private readonly __type?; | ||
static generateRandom(): BackupKey; | ||
/** Derives the backup ID to use given the current device's ACI. */ | ||
/** | ||
* Derives the backup ID to use given the current device's ACI. | ||
* | ||
* Used for both message and media backups. | ||
*/ | ||
deriveBackupId(aci: Aci): Buffer; | ||
/** Derives the backup EC key to use given the current device's ACI. */ | ||
/** | ||
* Derives the backup EC key to use given the current device's ACI. | ||
* | ||
* Used for both message and media backups. | ||
*/ | ||
deriveEcKey(aci: Aci): PrivateKey; | ||
/** Derives the AES key used for encrypted fields in local backup metadata. */ | ||
/** | ||
* Derives the AES key used for encrypted fields in local backup metadata. | ||
* | ||
* Only relevant for message backup keys. | ||
*/ | ||
deriveLocalBackupMetadataKey(): Buffer; | ||
/** Derives the ID for uploading media with the name `mediaName`. */ | ||
/** | ||
* Derives the ID for uploading media with the name `mediaName`. | ||
* | ||
* Only relevant for media backup keys. | ||
*/ | ||
deriveMediaId(mediaName: string): Buffer; | ||
/** | ||
* Derives the composite encryption key for uploading media with the given ID. | ||
* Derives the composite encryption key for re-encrypting media with the given ID. | ||
* | ||
* This is a concatenation of an HMAC key (32 bytes) and an AES-CBC key (also 32 bytes). | ||
* | ||
* Only relevant for media backup keys. | ||
*/ | ||
deriveMediaEncryptionKey(mediaId: Buffer): Buffer; | ||
/** | ||
* Derives the composite encryption key for uploading thumbnails with the given ID to the "transit | ||
* tier" CDN. | ||
* | ||
* This is a concatenation of an HMAC key (32 bytes) and an AES-CBC key (also 32 bytes). | ||
* | ||
* Only relevant for media backup keys. | ||
*/ | ||
deriveThumbnailTransitEncryptionKey(mediaId: Buffer): Buffer; | ||
} |
@@ -57,3 +57,9 @@ "use strict"; | ||
exports.AccountEntropyPool = AccountEntropyPool; | ||
/** A key used for many aspects of backups. */ | ||
/** | ||
* A key used for many aspects of backups. | ||
* | ||
* Clients are typically concerned with two long-lived keys: a "messages" key (sometimes called "the | ||
* root backup key" or just "the backup key") that's derived from an {@link AccountEntropyPool}, and | ||
* a "media" key (formally the "media root backup key") that's not derived from anything else. | ||
*/ | ||
class BackupKey extends ByteArray_1.default { | ||
@@ -74,15 +80,31 @@ constructor(contents) { | ||
} | ||
/** Derives the backup ID to use given the current device's ACI. */ | ||
/** | ||
* Derives the backup ID to use given the current device's ACI. | ||
* | ||
* Used for both message and media backups. | ||
*/ | ||
deriveBackupId(aci) { | ||
return Native.BackupKey_DeriveBackupId(this.contents, aci.getServiceIdFixedWidthBinary()); | ||
} | ||
/** Derives the backup EC key to use given the current device's ACI. */ | ||
/** | ||
* Derives the backup EC key to use given the current device's ACI. | ||
* | ||
* Used for both message and media backups. | ||
*/ | ||
deriveEcKey(aci) { | ||
return EcKeys_1.PrivateKey._fromNativeHandle(Native.BackupKey_DeriveEcKey(this.contents, aci.getServiceIdFixedWidthBinary())); | ||
} | ||
/** Derives the AES key used for encrypted fields in local backup metadata. */ | ||
/** | ||
* Derives the AES key used for encrypted fields in local backup metadata. | ||
* | ||
* Only relevant for message backup keys. | ||
*/ | ||
deriveLocalBackupMetadataKey() { | ||
return Native.BackupKey_DeriveLocalBackupMetadataKey(this.contents); | ||
} | ||
/** Derives the ID for uploading media with the name `mediaName`. */ | ||
/** | ||
* Derives the ID for uploading media with the name `mediaName`. | ||
* | ||
* Only relevant for media backup keys. | ||
*/ | ||
deriveMediaId(mediaName) { | ||
@@ -92,5 +114,7 @@ return Native.BackupKey_DeriveMediaId(this.contents, mediaName); | ||
/** | ||
* Derives the composite encryption key for uploading media with the given ID. | ||
* Derives the composite encryption key for re-encrypting media with the given ID. | ||
* | ||
* This is a concatenation of an HMAC key (32 bytes) and an AES-CBC key (also 32 bytes). | ||
* | ||
* Only relevant for media backup keys. | ||
*/ | ||
@@ -100,2 +124,13 @@ deriveMediaEncryptionKey(mediaId) { | ||
} | ||
/** | ||
* Derives the composite encryption key for uploading thumbnails with the given ID to the "transit | ||
* tier" CDN. | ||
* | ||
* This is a concatenation of an HMAC key (32 bytes) and an AES-CBC key (also 32 bytes). | ||
* | ||
* Only relevant for media backup keys. | ||
*/ | ||
deriveThumbnailTransitEncryptionKey(mediaId) { | ||
return Native.BackupKey_DeriveThumbnailTransitEncryptionKey(this.contents, mediaId); | ||
} | ||
} | ||
@@ -102,0 +137,0 @@ exports.BackupKey = BackupKey; |
@@ -42,2 +42,4 @@ /// <reference types="node" /> | ||
* Key used to encrypt and decrypt a message backup bundle. | ||
* | ||
* @see {@link BackupKey} | ||
*/ | ||
@@ -44,0 +46,0 @@ export declare class MessageBackupKey { |
@@ -36,2 +36,4 @@ "use strict"; | ||
* Key used to encrypt and decrypt a message backup bundle. | ||
* | ||
* @see {@link BackupKey} | ||
*/ | ||
@@ -38,0 +40,0 @@ class MessageBackupKey { |
@@ -180,2 +180,3 @@ // | ||
export function BackupKey_DeriveMediaId(backupKey: Buffer, mediaName: string): Buffer; | ||
export function BackupKey_DeriveThumbnailTransitEncryptionKey(backupKey: Buffer, mediaId: Buffer): Buffer; | ||
export function CallLinkAuthCredentialPresentation_CheckValidContents(presentationBytes: Buffer): void; | ||
@@ -182,0 +183,0 @@ export function CallLinkAuthCredentialPresentation_GetUserId(presentationBytes: Buffer): Serialized<UuidCiphertext>; |
{ | ||
"name": "@signalapp/libsignal-client", | ||
"version": "0.60.1", | ||
"version": "0.60.2", | ||
"license": "AGPL-3.0-only", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
84030347
6883