PrivateEncryptedChannel class

IMPORTANT! Your server library has to support the encrypted channels feature in order to use this kind of channel.

Encrypted channels do not support triggering the client events by the protocol.

End-to-end encrypted channels provide the same subscription restrictions as private channels. In addition, the data field of events published to end-to-end encrypted channels is encrypted using an implementation of the Secretbox encryption standard defined in NaCl before it leaves your server. Only authorized subscribers have access to the channel specific decryption key.

See also:

Inheritance
Available Extensions

Constructors

PrivateEncryptedChannel.internal({required ChannelsManagerStreamGetter publicStreamGetter, required ChannelPublicEventEmitter publicEventEmitter, required ChannelsManagerConnectionDelegate connectionDelegate, required String name, required EndpointAuthorizableChannelAuthorizationDelegate<PrivateEncryptedChannelAuthorizationData> authorizationDelegate, required PrivateEncryptedChannelEventDataEncodeDelegate eventDataEncodeDelegate})

Properties

authData PrivateEncryptedChannelAuthorizationData?
Current authorization data of this channel.
no setterinherited
authorizationDelegate EndpointAuthorizableChannelAuthorizationDelegate<PrivateEncryptedChannelAuthorizationData>
final
authRequestCycle int
Gives a current lifecycle of a request made to an endpoint.
no setterinherited
connectionDelegate → ChannelsManagerConnectionDelegate
A delegate that is passed by ChannelsManager. Exposes necessary API of PusherChannelsClientLifeCycleController.
final
currentStatus ChannelStatus?
Gives the current status of the state.
no setterinherited
eventDataEncodeDelegate PrivateEncryptedChannelEventDataEncodeDelegate
Used to encode the decrypted message.
final
hashCode int
The hash code for this object.
no setterinherited
name String
Name of this channel
final
publicEventEmitter → ChannelPublicEventEmitter
Delegates a sink of the ChannelsManager's StreamController.
final
publicStreamGetter ChannelsManagerStreamGetter
A atream injection applied by an instance of ChannelsManager
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
state PrivateEncryptedChannelState?
A current state of this channel
no setterinherited

Methods

bind(String eventName) Stream<ChannelReadEvent>
Return a stream capturing events with respective eventName.
inherited
bindToAll() Stream<ChannelReadEvent>
Returns a stream with all the events captured by this channel.
inherited
canHandleEvent(ChannelReadEvent event) bool
inherited
getStateTest() PrivateEncryptedChannelState?
inherited
getStateWithNewStatus(ChannelStatus status) PrivateEncryptedChannelState
override
getStateWithNewSubscriptionCount(int? subscriptionCount) PrivateEncryptedChannelState
override
handleEvent(ChannelReadEvent event) → void
Handles events received from an instance of ChannelsManager
inherited
handleOtherExternalEvents(ChannelReadEvent readEvent) → void
Emits the event using publicEventEmitter if it managed to decrypt the event data successfully.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
setAuthKeyFromDelegate() Future<void>
Sets a new lifecycle, tries to make request to get the auth data of type A.
inherited
startNewAuthRequestCycle() int
Increases the lifecycle count before making request to block changes made from the old request.
inherited
subscribe() → void
Unlike the public channels, this channel:
override
subscribeIfNotUnsubscribed() → void
Performs subscription if this channel was not unsubscibed intentionally. Recommended to use while listening for PusherChannelsClient.onConnectionEstablished
inherited
toString() String
A string representation of this object.
inherited
unsubscribe() → void
Sends the unsubscription event through the connectionDelegate.
override
updateState(PrivateEncryptedChannelState newState) → void
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

defaultEventDataEncoder(Uint8List bytes) String