예제 #1
0
파일: Qiniu.cs 프로젝트: jacksonwj/MKQiniu
 public Qiniu(string accessKey, string secretKey, string bucket)
 {
     _accessKey = accessKey;
     _secretKey = secretKey;
     PutPolicy  = new QiniuPolicy()
     {
         Scope = bucket
     };
 }
예제 #2
0
        internal string Sign(QiniuPolicy policy)
        {
            if (_serializer == null)
            {
                throw new ArgumentNullException("请添加 JSON 序列化组件");
            }

            var base64 = Utils.ToBase64String(_serializer.Serialize(policy));

            return(string.Format("{0}:{1}:{2}", _accessKey, EncodedSign(base64), base64));
        }