Beispiel #1
0
        T GetUserByKey <T>(string key) where T : User
        {
            string UserJson;

            if (RSAEncryption.TryDecrypt(Base64Encryption.Decrypt(PrivateKey), key, out UserJson))
            {
                return(UserJson.ToObj <T>());
            }
            else
            {
                return(null);
            }
        }
Beispiel #2
0
 public static string GetSrc(ServiceUser user)
 {
     return(RSAEncryption.Encrypt(Base64Encryption.Decrypt(PublicKey), user.ToJson()));
 }