accept static method

Future<PQSecureChannel> accept(
  1. Stream<List<int>> input,
  2. StreamSink<List<int>> output, {
  3. required SigningKeyPair identity,
  4. required String serverId,
  5. ClientAuthorizer? authorizeClient,
  6. PostQuantumCryptoEngine? engine,
  7. PQSecureChannelOptions options = const PQSecureChannelOptions(),
  8. void destroy()?,
})

Accepts one client over input / output, proving the server's identity under the name serverId.

With authorizeClient, the client must authenticate with its own signing key, and the callback decides whether that key may connect. destroy is as in connect.

Throws PQSecureChannelException if the handshake fails; the connection is closed in that case.

Implementation

static Future<PQSecureChannel> accept(
  Stream<List<int>> input,
  StreamSink<List<int>> output, {
  required SigningKeyPair identity,
  required String serverId,
  ClientAuthorizer? authorizeClient,
  PostQuantumCryptoEngine? engine,
  PQSecureChannelOptions options = const PQSecureChannelOptions(),
  void Function()? destroy,
}) => acceptInternal(
  input,
  output,
  identity: identity,
  serverId: serverId,
  authorizeClient: authorizeClient,
  engine: engine,
  options: options,
  destroy: destroy,
);