make publickey a resource handle