File Sharing API: deprecated cipherKey parameter for JavaScript SDK

DeprecatedFile Sharing is a current API. The cipherKey parameter of sendFile() and downloadFile() is an older way to encrypt files. New apps should configure a crypto module. Go to File Sharing

This page documents the superseded cipherKey parameter of sendFile() and downloadFile() in the PubNub JavaScript SDK. File Sharing is a current API, and only this parameter is deprecated. The parameter remains for apps that already pass it. New apps configure a cryptoModule and leave cipherKey out. For the current methods, see File Sharing.

Cipher key (deprecated)​

Deprecated

The cipherKey parameter of sendFile() and downloadFile() is deprecated. Configure the crypto module on your PubNub instance instead.

cipherKey#
Type: string
Default: no default
Key that encrypts the file in sendFile() and decrypts it in downloadFile(). A file that one call encrypts needs the same key in the other call. Passing a cipherKey directly to sendFile or downloadFile bypasses the CryptoModule and forces legacy 128-bit encryption. The legacy encryption keeps working without configuration changes. To use 256-bit Advanced Encryption Standard cipher block chaining (AES-CBC) encryption, set the crypto module to the AES-CBC module.

The parameter exists on both methods. sendFile() uses it only in Node.js and in browsers, because React Native does not encrypt file content.

Usage with a message and custom cipher key​

1

Usage with custom cipher key​

1

Was this page useful?

Last updated on