composeChallenge method

Uint8List composeChallenge({
  1. required String username,
  2. required String service,
  3. required String publicKeyAlgorithm,
  4. required Uint8List publicKey,
})

Composes the data blob to be signed by the client with its public key.

Implementation

Uint8List composeChallenge({
  required String username,
  required String service,
  required String publicKeyAlgorithm,
  required Uint8List publicKey,
}) {
  final writer = SSHMessageWriter();
  writer.writeString(_sessionId!);
  writer.writeUint8(SSH_Message_Userauth_Request.messageId);
  writer.writeUtf8(username);
  writer.writeUtf8(service);
  writer.writeUtf8('publickey');
  writer.writeBool(true);
  writer.writeUtf8(publicKeyAlgorithm);
  writer.writeString(publicKey);
  return writer.takeBytes();
}