You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+20-13Lines changed: 20 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -67,7 +67,7 @@ var pusher = new Pusher({
67
67
cluster:'CLUSTER', // if `host` is present, it will override the `cluster` option.
68
68
host:'HOST', // optional, defaults to api.pusherapp.com
69
69
port:PORT, // optional, defaults to 80 for non-TLS connections and 443 for TLS connections
70
-
encryptionMasterKey:ENCRYPTION_MASTER_KEY, // a 32 character long key used to derive secrets for end to end encryption (see below!)
70
+
encryptionMasterKeyBase64:ENCRYPTION_MASTER_KEY, // a base64 string which encodes 32 bytes, used to derive the per-channel encryption keys (see below!)
71
71
});
72
72
```
73
73
@@ -82,7 +82,7 @@ var pusher = Pusher.forCluster("CLUSTER", {
82
82
secret:'SECRET_KEY',
83
83
useTLS:USE_TLS, // optional, defaults to false
84
84
port:PORT, // optional, defaults to 80 for non-TLS connections and 443 for TLS connections
85
-
encryptionMasterKey:ENCRYPTION_MASTER_KEY, // a 32 character long key used to derive secrets for end to end encryption (see below!)
85
+
encryptionMasterKeyBase64:ENCRYPTION_MASTER_KEY, // a base64 string which encodes 32 bytes, used to derive the per-channel encryption keys (see below!)
86
86
});
87
87
```
88
88
@@ -188,15 +188,22 @@ This library supports end-to-end encryption of your private channels. This means
188
188
189
189
1. You should first set up Private channels. This involves [creating an authentication endpoint on your server](https://pusher.com/docs/authenticating_users).
190
190
191
-
2. Next, Specify your 32 character `encryption_master_key`. This is secret and you should never share this with anyone. Not even Pusher.
191
+
2. Next, generate your 32 byte master encryption key, encode it as base64 and pass it to the Pusher constructor.
192
+
193
+
This is secret and you should never share this with anyone.
thrownewError("encryptionMasterKey must be a string");
29
36
}
30
37
if(options.encryptionMasterKey.length!==32){
31
-
thrownewError("encryptionMasterKey must be 32 characters long, but the string '"+options.encryptionMasterKey+"' is "+options.encryptionMasterKey.length+" characters long");
38
+
thrownewError("encryptionMasterKey must be 32 bytes long, but the string '"+
39
+
options.encryptionMasterKey+"' is "+options.encryptionMasterKey.length+" bytes long");
0 commit comments