public static string Convert(Stream pemData)
        {
            var  pemObject = new PemReader(new StreamReader(pemData)).ReadObject();
            RSA  key;
            bool isPrivate;

            if (pemObject is AsymmetricCipherKeyPair)
            {
                isPrivate = true;
                var privateKeyParams = ((AsymmetricCipherKeyPair)pemObject).Private;
                key = DotNetUtilities.ToRSA((RsaPrivateCrtKeyParameters)privateKeyParams);
            }
            else if (pemObject is RsaKeyParameters)
            {
                isPrivate = false;
                key       = DotNetUtilities.ToRSA((RsaKeyParameters)pemObject);
            }
            else
            {
                throw new ArgumentException("object is not PEM encoded RSA key " +
                                            $"(decoded: {pemObject.GetType().Name})",
                                            nameof(pemData));
            }
            return(RsaKeyLoader.ToXmlString(key, isPrivate));
        }
        public static string GenerateKeys(string privateKeyPath = "private-key.xml",
                                          string publicKeyPath  = "public-key.xml")
        {
            var key = RSA.Create();

            key.KeySize = PaymentHandler.KeySize;
            File.WriteAllText(privateKeyPath, RsaKeyLoader.ToXmlString(key, includePrivateParameters: true));
            File.WriteAllText(publicKeyPath, RsaKeyLoader.ToXmlString(key, includePrivateParameters: false));

            return($"Files written to {Path.GetDirectoryName(Path.GetFullPath(privateKeyPath))}\n" +
                   $"	{privateKeyPath}: keep this one secure and never pass to anyone\n"+
                   $"	{publicKeyPath}:  pass this one to NewVoiceMedia operations");
        }