public static Key GetPublic(KeyPair KeyPair) { if (KeyPair as RSAKeyPair != null) { return new PublicKeyRSA(KeyPair as RSAKeyPair); } return null; }