private static IEnumerable <byte> Sign(byte[] data, SignType type) { var hashAlgorithm = HashAlgorithm.Create(type.ToString()); if (hashAlgorithm != null) { return(hashAlgorithm.ComputeHash(data)); } return(null); }
/// <summary> /// Set Sign Color on IAMTimelineComp /// 设置sign类型红琥珀rgb /// </summary> public static int SetSign(ref IAMTimeline m_pTimeline, IAMTimelineComp pComp, long StartTime, long EndTime, SignType pSignType) { int hr = 0; IAMTimelineObj pTransObj; hr = m_pTimeline.CreateEmptyNode(out pTransObj, TimelineMajorType.Effect); IAMTimelineEffectable aEffectable = (IAMTimelineEffectable)pComp; pTransObj.SetStartStop(StartTime, EndTime); pTransObj.SetSubObjectGUID(DESConsts.GUID_EF_Sign); aEffectable.EffectInsBefore(pTransObj, -1); IPropertySetter ipro = (IPropertySetter) new PropertySetter(); DESHelper.AddParameter(ipro, "AdjustType", pSignType.ToString()); hr = pTransObj.SetPropertySetter(ipro); return(hr); }
/// <summary> /// 生成要请求给支付宝的参数数组 /// </summary> /// <param name="sParaTemp">请求前的参数数组</param> /// <returns>要请求的参数数组</returns> public Dictionary <string, string> BuildRequestPara(SortedDictionary <string, string> sParaTemp) { //待签名请求参数数组 Dictionary <string, string> sPara = new Dictionary <string, string>(); //签名结果 string mysign = ""; //过滤签名参数数组 sPara = Core.FilterPara(sParaTemp); //获得签名结果 mysign = BuildRequestMysign(sPara); mysign = HttpContext.Current.Server.UrlEncode(mysign); sPara.Add("sign", mysign); sPara.Add("sign_type", _signType.ToString()); return(sPara); }