Partial implementation of v4 signing. Warning! Will not build.