v0.1.2
sasl_scram
一個提供 sasl/scram 驗證的套件。同時管理 scram-1 和 scram-256。
4喜歡 6.5萬近 30 天下載150Pub 分數
AndroidiOSWebmacOSWindowsLinux
Sasl/scram 憑證機制
以下為英文專案原文快照,最新內容請造訪 GitHub。
Implementation of the Salted Challenge Response Authentication Mechanism in Dart.
A simple usage example:
import 'dart:typed_data';
import 'package:crypto/crypto.dart';
import 'package:sasl_scram/sasl_scram.dart';
void main() {
final bytesReceivedFromServer = Uint8List(0); // No data needed when starting authentication
final authenticator = ScramAuthenticator(
'SCRAM-SHA-256', // Optionally choose hash method from a list provided by the server
sha256,
UsernamePasswordCredential(username: 'dart', password: 'dart'),
);
final bytesToSentToServer = authenticator.handleMessage(
SaslMessageType.AuthenticationSASL, // Get type type from the server message
bytesReceivedFromServer, // Append the remaining bytes
);
print(bytesToSentToServer); // Wrap these bytes with your message which goes back to the server
}
Please file feature requests and bugs at the issue tracker.