Exemplo n.º 1
0
        public static string getPrivKey(string name)
        {
            string privPubKey = null;

            try
            {
                MyKey.get(name);
                privPubKey = MyKey.privPubKey;
                privPubKey = decryptRSAKey(privPubKey);
            }
            catch (Exception ex)
            {
                LogService.add(ex.ToString());
            }

            return(privPubKey);
        }
Exemplo n.º 2
0
        public static string getPubKey(string name)
        {
            string pubKey = null;

            try
            {
                MyKey.get(name);
                string privPubKey = MyKey.privPubKey;
                privPubKey = decryptRSAKey(privPubKey);

                RSACryptoServiceProvider rsa = new RSACryptoServiceProvider();
                rsa.FromXmlString(privPubKey);
                pubKey = rsa.ToXmlString(false);
            }
            catch (Exception ex)
            {
                LogService.add(ex.ToString());
            }

            return(pubKey);
        }