Example #1
0
        public string[] GetPublicKey()
        {
            RSACrypto crypto = new RSACrypto();
            RSAItem   item = new RSAItem();
            string    privateKey = "", publicKey = "";

            crypto.CreateKeys(out privateKey, out publicKey);
            item.PrivateKey = privateKey;
            item.PublickKey = publicKey;
            item.Guid       = Guid.NewGuid().ToString();
            item.CreateTime = DateTime.Now;
            RedisHelper.Add(item.Guid, item);
            string[] arry = new string[2];
            arry[0] = item.Guid;
            arry[1] = RSAConvert.PemPublicKeyByXml(item.PrivateKey);
            return(arry);
        }