Esempio n. 1
0
 public Qiniu(string accessKey, string secretKey, string bucket)
 {
     _accessKey = accessKey;
     _secretKey = secretKey;
     PutPolicy  = new QiniuPolicy()
     {
         Scope = bucket
     };
 }
Esempio n. 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));
        }