开发者社区> 问答> 正文

iOS中OSS使用的困惑




[color=rgb(20.000000%, 20.000000%, 20.000000%)][font='font000000001b40eb89'][ossService setGenerateToken:^(NSString *method, NSString *md5, NSString *type, NSString *date, NSString *xoss,NSString *resource) {
[color=rgb(20.000000%, 20.000000%, 20.000000%)]       [font='font000000001b40eb89']NSString *signature = nil;
[color=rgb(20.000000%, 20.000000%, 20.000000%)]       [font='font000000001b40eb89']NSString *content = [NSString stringWithFormat:@"%@\n%@\n%@\n%@\n%@%@", method, md5, type, date,xoss, resource];
[color=rgb(20.000000%, 20.000000%, 20.000000%)]       [font='font000000001b40eb89']signature = [OSSTool calBase64Sha1WithData:content withKey:secretKey];
[color=rgb(20.000000%, 20.000000%, 20.000000%)][font='font000000001b40eb89']        signature = [NSString stringWithFormat:@"OSS %@:%@", accessKey, signature];
[color=rgb(20.000000%, 20.000000%, 20.000000%)][font='font000000001b40eb89']       NSLog(@"signature:%@", signature);
       return signature;
[color=rgb(20.000000%, 20.000000%, 20.000000%)]   [font='font000000001b40eb89']}];
这个方法直接就进不去!!!
[color=rgb(20.000000%, 20.000000%, 20.000000%)][font='font000000001b40eb89']

NSString *content = [NSString stringWithFormat:@"%@\n%@\n%@\n%@\n%@%@", method, md5, type, date, xoss, resource];
signature = [OSSTool calBase64Sha1WithData:content withKey:secretKey]; signature = [NSString stringWithFormat:@"OSS %@:%@", accessKey, signature]; NSLog(@"signature:%@", signature);
上面两行就完全没有执行机会!!!


[ accessKey和 secretKey都已经配置

[size=font-size: 8.000000pt,8.000000pt][color=rgb(20.000000%, 20.000000%, 20.000000%)][font='font000000001b40eb89']



展开
收起
cococao 2015-06-29 14:08:58 5908 0
1 条回答
写回答
取消 提交回答
  • 能不能把你的代理整理一下啊。全是一些色彩代码。
    2015-06-29 14:40:06
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
OSS运维进阶实战手册 立即下载
《OSS运维基础实战手册》 立即下载
OSS运维基础实战手册 立即下载