FLUTTER ECOSYSTEM

mongo-dart/sasl_scram

Sasl/scram 憑證機制

sasl_scram 專案封面
Stars
3
Forks
0
最近推送(UTC)
2026年2月14日
專案狀態
未封存
mongo-dart GitHub avatar
GITHUB Organization

mongo-dart ↗

語言Dart

此儲存庫發佈的套件

使用的依賴

依賴清單 6 項

原始 README

以下為英文專案原文快照,最新內容請造訪 GitHub。

展開 / 收合專案 README

Sasl Scram for Dart

Implementation of the Salted Challenge Response Authentication Mechanism in Dart.

Usage

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
}

Features and bugs

Please file feature requests and bugs at the issue tracker.