AliyunOSSiOSTests/OSSSingerTest.m [461:502]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    [NSDate oss_setClockSkew:[NSDate new].timeIntervalSince1970 - t];
    
    NSMutableDictionary *headers = @{}.mutableCopy;
    NSMutableDictionary *parameters = @{}.mutableCopy;

    headers[@"x-oss-head1"] = @"value";
    headers[@"abc"] = @"value";
    headers[@"ZAbc"] = @"value";
    headers[@"XYZ"] = @"value";
    headers[@"XYZ"] = @"value";
    headers[@"content-type"] = @"application/octet-stream";
    
    parameters[@"param1"] = @"value1";
    parameters[@"|param1"] = @"value2";
    parameters[@"+param1"] = @"value3";
    parameters[@"|param1"] = @"value4";
    parameters[@"+param2"] = @"";
    parameters[@"|param2"] = @"";
    parameters[@"param2"] = @"";
    
    OSSAllRequestNeededMessage *requestMessage = [OSSAllRequestNeededMessage new];
    requestMessage.httpMethod = @"PUT";
    requestMessage.bucketName = bucket;
    requestMessage.objectKey = key;
    requestMessage.headerParams = headers;
    requestMessage.params = parameters;
    requestMessage.isUseUrlSignature = YES;
    
    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;
    signerParam.expiration = 599;
    
    id<OSSRequestPresigner> signer = [OSSSignerBase createRequestPresignerWithSignerVersion:version
                                                                               signerParams:signerParam];
    [signer presign:requestMessage];
    
    XCTAssertTrue([@"OSS4-HMAC-SHA256" isEqualToString:requestMessage.params[@"x-oss-signature-version"]]);
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



AliyunOSSiOSTests/OSSSingerTest.m [526:567]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    [NSDate oss_setClockSkew:[NSDate new].timeIntervalSince1970 - t];
    
    NSMutableDictionary *headers = @{}.mutableCopy;
    NSMutableDictionary *parameters = @{}.mutableCopy;

    headers[@"x-oss-head1"] = @"value";
    headers[@"abc"] = @"value";
    headers[@"ZAbc"] = @"value";
    headers[@"XYZ"] = @"value";
    headers[@"XYZ"] = @"value";
    headers[@"content-type"] = @"application/octet-stream";
    
    parameters[@"param1"] = @"value1";
    parameters[@"|param1"] = @"value2";
    parameters[@"+param1"] = @"value3";
    parameters[@"|param1"] = @"value4";
    parameters[@"+param2"] = @"";
    parameters[@"|param2"] = @"";
    parameters[@"param2"] = @"";
    
    OSSAllRequestNeededMessage *requestMessage = [OSSAllRequestNeededMessage new];
    requestMessage.httpMethod = @"PUT";
    requestMessage.bucketName = bucket;
    requestMessage.objectKey = key;
    requestMessage.headerParams = headers;
    requestMessage.params = parameters;
    requestMessage.isUseUrlSignature = YES;
    
    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;
    signerParam.expiration = 599;
    
    id<OSSRequestPresigner> signer = [OSSSignerBase createRequestPresignerWithSignerVersion:version
                                                                               signerParams:signerParam];
    [signer presign:requestMessage];
    
    XCTAssertTrue([@"OSS4-HMAC-SHA256" isEqualToString:requestMessage.params[@"x-oss-signature-version"]]);
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



