public static RSAParameters GetKey(string key) { byte[] jsonPublicKeyBytes = Convert.FromBase64String(key); string jsonPublicKey = _encoder.GetString(jsonPublicKeyBytes); RSAParametersModel rsaParametersModel = JsonConvert.DeserializeObject <RSAParametersModel>(jsonPublicKey); return(rsaParametersModel.ToRSAParameters()); }