getUserSessionVerifiers method
Retrieves user session verifiers to send to server for authentication.
This method should be called after creating a User from a challenge via fromUserCredsAndChallenge or fromUserCredsBytesAndChallenge. The returned verifiers must be sent to the server to complete the authentication handshake.
Side effects: Securely erases the internal user ID bytes after they are no longer needed.
Implementation
UserSessionVerifiers getUserSessionVerifiers() {
final verifiers = UserSessionVerifiers(
userId: utf8.decode(_userIdBytes!),
ephemeralUserPublicKey: Uint8List.fromList(_ephemeralUserPublicKeyBytes!),
sessionKeyVerifier: Uint8List.fromList(_userSessionKeyVerifier),
);
// Securely erase userId bytes now that they're no longer needed.
_userIdBytes!.overwriteWithZeros();
_userIdBytes = null;
return verifiers;
}