Some work on porting dirmngr (unfinished)