def with_keypair(
        cls,
        name: str,
        password: str | None = None,
        uid: str | None = None,
        gid: str | None = None,
        folders: list[str] | None = None,
        mount_dir: str | None = None,
    ) -> SFTPUser:
        """Construct a new SFTPUser with an auto-generated RSA keypair"""
        keypair = _generate_keypair()
        return SFTPUser(
            name=name,
            public_key=keypair.public_key,
            private_key=keypair.private_key,
            password=password,
            uid=uid,
            gid=gid,
            folders=folders,
            mount_dir=mount_dir,
        )
Construct a new SFTPUser with an auto-generated RSA keypair
modules/sftp/testcontainers/sftp/__init__.py