Example #1
0
 /// <summary>
 /// 生成下载凭证
 /// </summary>
 /// <param name="url">原始链接</param>
 /// <returns></returns>
 public string CreateDownloadToken(string url)
 {
     return(_signature.Sign(url));
 }
Example #2
0
        /// <summary>
        /// 生成推流地址使用的凭证
        /// </summary>
        /// <param name="mac">账号(密钥)</param>
        /// <param name="path">URL路径</param>
        /// <returns></returns>
        public static string CreateStreamPublishToken(Mac mac, string path)
        {
            QiniuSignature sx = new QiniuSignature(mac);

            return(sx.Sign(path));
        }
Example #3
0
        /// <summary>
        /// 生成流管理凭证
        /// </summary>
        /// <param name="mac">账号(密钥)</param>
        /// <param name="data">待签数据</param>
        /// <returns></returns>
        public static string CreateStreamManageToken(Mac mac, string data)
        {
            QiniuSignature sx = new QiniuSignature(mac);

            return(string.Format("Qiniu {0}", sx.Sign(data)));
        }
Example #4
0
        /// <summary>
        /// 生成下载凭证
        /// </summary>
        /// <param name="mac">账号(密钥)</param>
        /// <param name="url">原始链接</param>
        /// <returns></returns>
        public static string CreateDownloadToken(Mac mac, string url)
        {
            QiniuSignature sx = new QiniuSignature(mac);

            return(sx.Sign(url));
        }