Move resource private_key stuff to its own branch

Change-Id: I4814b86c3348dd2527ae94841f58fbe213749089
Bug fix.

Change-Id: Ib088150330a118b8ac08f0c2f366dc61f46b063d