AliyunOSSiOSTests/OSSSingerTest.m [278:326]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NSString *bucket = @"bucket";
    NSString *key = @"1234+-/123/1.txt";
    NSString *region = @"cn-hangzhou";
    NSString *product = @"oss";
    NSTimeInterval t = 1702747512.0L;
    [NSDate oss_setClockSkew:[NSDate new].timeIntervalSince1970 - t];
    
    NSMutableDictionary *headers = @{}.mutableCopy;
    NSMutableDictionary *parameters = @{}.mutableCopy;
    NSMutableSet<NSString *> *signHeaders = [NSMutableSet new];

    headers[@"x-oss-head1"] = @"value";
    headers[@"abc"] = @"value";
    headers[@"ZAbc"] = @"value";
    headers[@"XYZ"] = @"value";
    headers[@"XYZ"] = @"value";
    headers[@"content-type"] = @"text/plain";
    headers[@"x-oss-content-sha256"] = @"UNSIGNED-PAYLOAD";
    
    parameters[@"param1"] = @"value1";
    parameters[@"|param1"] = @"value2";
    parameters[@"+param1"] = @"value3";
    parameters[@"|param1"] = @"value4";
    parameters[@"+param2"] = @"";
    parameters[@"|param2"] = @"";
    parameters[@"param2"] = @"";
    
    [signHeaders addObject:@"abc"];
    [signHeaders addObject:@"ZAbc"];

    OSSAllRequestNeededMessage *requestMessage = [OSSAllRequestNeededMessage new];
    requestMessage.httpMethod = @"PUT";
    requestMessage.bucketName = bucket;
    requestMessage.objectKey = key;
    requestMessage.headerParams = headers;
    requestMessage.params = parameters;
    requestMessage.additionalHeaderNames = signHeaders;
    
    NSString *resource = [@"/" stringByAppendingString:((bucket != nil) ? [bucket stringByAppendingString:@"/"] : @"")];
    resource = [resource stringByAppendingString:(key != nil ? key : @"")];
    OSSSignerParams *signerParam = [OSSSignerParams new];
    signerParam.credentialProvider = credentialProvider;
    signerParam.resourcePath = resource;
    signerParam.product = product;
    signerParam.region = region;
    
    id<OSSRequestSigner> signer = [OSSSignerBase createRequestSignerWithSignerVersion:version
                                                                         signerParams:signerParam];
    [signer sign:requestMessage];
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



AliyunOSSiOSTests/OSSSingerTest.m [367:415]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NSString *bucket = @"bucket";
    NSString *key = @"1234+-/123/1.txt";
    NSString *region = @"cn-hangzhou";
    NSString *product = @"oss";
    NSTimeInterval t = 1702747512.0L;
    [NSDate oss_setClockSkew:[NSDate new].timeIntervalSince1970 - t];
    
    NSMutableDictionary *headers = @{}.mutableCopy;
    NSMutableDictionary *parameters = @{}.mutableCopy;
    NSMutableSet<NSString *> *signHeaders = [NSMutableSet new];

    headers[@"x-oss-head1"] = @"value";
    headers[@"abc"] = @"value";
    headers[@"ZAbc"] = @"value";
    headers[@"XYZ"] = @"value";
    headers[@"XYZ"] = @"value";
    headers[@"content-type"] = @"text/plain";
    headers[@"x-oss-content-sha256"] = @"UNSIGNED-PAYLOAD";
    
    parameters[@"param1"] = @"value1";
    parameters[@"|param1"] = @"value2";
    parameters[@"+param1"] = @"value3";
    parameters[@"|param1"] = @"value4";
    parameters[@"+param2"] = @"";
    parameters[@"|param2"] = @"";
    parameters[@"param2"] = @"";
    
    [signHeaders addObject:@"abc"];
    [signHeaders addObject:@"ZAbc"];

    OSSAllRequestNeededMessage *requestMessage = [OSSAllRequestNeededMessage new];
    requestMessage.httpMethod = @"PUT";
    requestMessage.bucketName = bucket;
    requestMessage.objectKey = key;
    requestMessage.headerParams = headers;
    requestMessage.params = parameters;
    requestMessage.additionalHeaderNames = signHeaders;
    
    NSString *resource = [@"/" stringByAppendingString:((bucket != nil) ? [bucket stringByAppendingString:@"/"] : @"")];
    resource = [resource stringByAppendingString:(key != nil ? key : @"")];
    OSSSignerParams *signerParam = [OSSSignerParams new];
    signerParam.credentialProvider = credentialProvider;
    signerParam.resourcePath = resource;
    signerParam.product = product;
    signerParam.region = region;
    
    id<OSSRequestSigner> signer = [OSSSignerBase createRequestSignerWithSignerVersion:version
                                                                         signerParams:signerParam];
    [signer sign:requestMessage];
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



