Fixed some bugs. loadKeyPair and saveKeyPair are functional for the 3 types of keys