CraAuthentication class

WAMP-CRA authentication implementation (client & router shared).

Inheritance

Constructors

CraAuthentication(String secret, {AuthenticationStringEncoding stringEncoding = AuthenticationStringEncoding.utf8})

Properties

hashCode → int
The hash code for this object.
no setterinherited
onChallenge → Stream<Extra>
When the challenge starts the stream will provide the current Extra in case the client needs some additional information to challenge the server.
no setteroverride
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
secret ↔ String
getter/setter pair
stringEncoding → AuthenticationStringEncoding
final

Methods

cancelPendingChallenge() → Future<void>
Cancels work associated with the current authentication attempt.
inherited
challenge(Extra extra) → Future<Authenticate>
Called when the router sends a challenge (CHALLENGE frame).
override
dispose() → Future<void>
Releases authentication-method resources.
inherited
getName() → String
Authentication method name used in HELLO (e.g. 'ticket').
override
hello(String? realm, Details details) → Future<void>
This method is called to modify the hello details for a given realm.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited
verifyFinal({required String? authId, required String? authMethod, required Map<String, Object?>? authExtra}) → Future<void>
Verifies authentication data returned by the router before session use.
inherited

Operators

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

Static Methods

deriveKey(String secret, List<int> salt, {int iterations = defaultIterations, int keylen = defaultKeyLength, int hmacLength = 64, AuthenticationStringEncoding stringEncoding = AuthenticationStringEncoding.utf8}) → Uint8List
encodeByteHmac(Uint8List key, int keylen, List<int> challenge, {int hmacLength = 64}) → Uint8List
encodeHmac(Uint8List key, int keylen, List<int> challenge, {int hmacLength = 64}) → String
encodeString(String value, {AuthenticationStringEncoding stringEncoding = AuthenticationStringEncoding.utf8}) → List<int>
Encodes value using the selected authentication compatibility mode.
signChallenge({required String secret, required Extra challenge, AuthenticationStringEncoding stringEncoding = AuthenticationStringEncoding.utf8}) → String
verifySignature({required String secret, required Extra challenge, required String signature, AuthenticationStringEncoding stringEncoding = AuthenticationStringEncoding.utf8}) → bool

Constants

defaultIterations → const int
defaultKeyLength → const int
defaultKeySalt → const List<int>