integration: add keys API integration tests

@xiangli-cmu I don't feel good about much of this, but I didn't write it, just ported it across with the minimal necessary changes for now :-)