Utility function to convert between a KeyPair to a Map.
Available on KeyPair, provided by the KeyPairConverter extension