Updated KeyPair to use dynamic.