Skip to content

Commit

Permalink
Support KMS server-side encryption.
Browse files Browse the repository at this point in the history
  • Loading branch information
bonebox committed May 2, 2015
1 parent e152106 commit 8505c7c
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 0 deletions.
1 change: 1 addition & 0 deletions AWSS3/AWSS3Model.h
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ typedef NS_ENUM(NSInteger, AWSS3Protocols) {
typedef NS_ENUM(NSInteger, AWSS3ServerSideEncryption) {
AWSS3ServerSideEncryptionUnknown,
AWSS3ServerSideEncryptionAES256,
AWSS3ServerSideEncryptionKMS,
};

typedef NS_ENUM(NSInteger, AWSS3StorageClass) {
Expand Down
55 changes: 55 additions & 0 deletions AWSS3/AWSS3Model.m
Original file line number Diff line number Diff line change
Expand Up @@ -191,11 +191,16 @@ + (NSValueTransformer *)serverSideEncryptionJSONTransformer {
if ([value isEqualToString:@"AES256"]) {
return @(AWSS3ServerSideEncryptionAES256);
}
if ([value isEqualToString:@"aws:kms"]) {
return @(AWSS3ServerSideEncryptionKMS);
}
return @(AWSS3ServerSideEncryptionUnknown);
} reverseBlock:^NSString *(NSNumber *value) {
switch ([value integerValue]) {
case AWSS3ServerSideEncryptionAES256:
return @"AES256";
case AWSS3ServerSideEncryptionKMS:
return @"aws:kms";
case AWSS3ServerSideEncryptionUnknown:
default:
return nil;
Expand Down Expand Up @@ -417,11 +422,16 @@ + (NSValueTransformer *)serverSideEncryptionJSONTransformer {
if ([value isEqualToString:@"AES256"]) {
return @(AWSS3ServerSideEncryptionAES256);
}
if ([value isEqualToString:@"aws:kms"]) {
return @(AWSS3ServerSideEncryptionKMS);
}
return @(AWSS3ServerSideEncryptionUnknown);
} reverseBlock:^NSString *(NSNumber *value) {
switch ([value integerValue]) {
case AWSS3ServerSideEncryptionAES256:
return @"AES256";
case AWSS3ServerSideEncryptionKMS:
return @"aws:kms";
case AWSS3ServerSideEncryptionUnknown:
default:
return nil;
Expand Down Expand Up @@ -514,11 +524,16 @@ + (NSValueTransformer *)serverSideEncryptionJSONTransformer {
if ([value isEqualToString:@"AES256"]) {
return @(AWSS3ServerSideEncryptionAES256);
}
if ([value isEqualToString:@"aws:kms"]) {
return @(AWSS3ServerSideEncryptionKMS);
}
return @(AWSS3ServerSideEncryptionUnknown);
} reverseBlock:^NSString *(NSNumber *value) {
switch ([value integerValue]) {
case AWSS3ServerSideEncryptionAES256:
return @"AES256";
case AWSS3ServerSideEncryptionKMS:
return @"aws:kms";
case AWSS3ServerSideEncryptionUnknown:
default:
return nil;
Expand Down Expand Up @@ -1224,11 +1239,16 @@ + (NSValueTransformer *)serverSideEncryptionJSONTransformer {
if ([value isEqualToString:@"AES256"]) {
return @(AWSS3ServerSideEncryptionAES256);
}
if ([value isEqualToString:@"aws:kms"]) {
return @(AWSS3ServerSideEncryptionKMS);
}
return @(AWSS3ServerSideEncryptionUnknown);
} reverseBlock:^NSString *(NSNumber *value) {
switch ([value integerValue]) {
case AWSS3ServerSideEncryptionAES256:
return @"AES256";
case AWSS3ServerSideEncryptionKMS:
return @"aws:kms";
case AWSS3ServerSideEncryptionUnknown:
default:
return nil;
Expand Down Expand Up @@ -1461,11 +1481,16 @@ + (NSValueTransformer *)serverSideEncryptionJSONTransformer {
if ([value isEqualToString:@"AES256"]) {
return @(AWSS3ServerSideEncryptionAES256);
}
if ([value isEqualToString:@"aws:kms"]) {
return @(AWSS3ServerSideEncryptionKMS);
}
return @(AWSS3ServerSideEncryptionUnknown);
} reverseBlock:^NSString *(NSNumber *value) {
switch ([value integerValue]) {
case AWSS3ServerSideEncryptionAES256:
return @"AES256";
case AWSS3ServerSideEncryptionKMS:
return @"aws:kms";
case AWSS3ServerSideEncryptionUnknown:
default:
return nil;
Expand Down Expand Up @@ -2444,11 +2469,16 @@ + (NSValueTransformer *)serverSideEncryptionJSONTransformer {
if ([value isEqualToString:@"AES256"]) {
return @(AWSS3ServerSideEncryptionAES256);
}
if ([value isEqualToString:@"aws:kms"]) {
return @(AWSS3ServerSideEncryptionKMS);
}
return @(AWSS3ServerSideEncryptionUnknown);
} reverseBlock:^NSString *(NSNumber *value) {
switch ([value integerValue]) {
case AWSS3ServerSideEncryptionAES256:
return @"AES256";
case AWSS3ServerSideEncryptionKMS:
return @"aws:kms";
case AWSS3ServerSideEncryptionUnknown:
default:
return nil;
Expand Down Expand Up @@ -2544,11 +2574,16 @@ + (NSValueTransformer *)serverSideEncryptionJSONTransformer {
if ([value isEqualToString:@"AES256"]) {
return @(AWSS3ServerSideEncryptionAES256);
}
if ([value isEqualToString:@"aws:kms"]) {
return @(AWSS3ServerSideEncryptionKMS);
}
return @(AWSS3ServerSideEncryptionUnknown);
} reverseBlock:^NSString *(NSNumber *value) {
switch ([value integerValue]) {
case AWSS3ServerSideEncryptionAES256:
return @"AES256";
case AWSS3ServerSideEncryptionKMS:
return @"aws:kms";
case AWSS3ServerSideEncryptionUnknown:
default:
return nil;
Expand Down Expand Up @@ -2737,11 +2772,16 @@ + (NSValueTransformer *)serverSideEncryptionJSONTransformer {
if ([value isEqualToString:@"AES256"]) {
return @(AWSS3ServerSideEncryptionAES256);
}
if ([value isEqualToString:@"aws:kms"]) {
return @(AWSS3ServerSideEncryptionKMS);
}
return @(AWSS3ServerSideEncryptionUnknown);
} reverseBlock:^NSString *(NSNumber *value) {
switch ([value integerValue]) {
case AWSS3ServerSideEncryptionAES256:
return @"AES256";
case AWSS3ServerSideEncryptionKMS:
return @"aws:kms";
case AWSS3ServerSideEncryptionUnknown:
default:
return nil;
Expand Down Expand Up @@ -2881,11 +2921,16 @@ + (NSValueTransformer *)serverSideEncryptionJSONTransformer {
if ([value isEqualToString:@"AES256"]) {
return @(AWSS3ServerSideEncryptionAES256);
}
if ([value isEqualToString:@"aws:kms"]) {
return @(AWSS3ServerSideEncryptionKMS);
}
return @(AWSS3ServerSideEncryptionUnknown);
} reverseBlock:^NSString *(NSNumber *value) {
switch ([value integerValue]) {
case AWSS3ServerSideEncryptionAES256:
return @"AES256";
case AWSS3ServerSideEncryptionKMS:
return @"aws:kms";
case AWSS3ServerSideEncryptionUnknown:
default:
return nil;
Expand Down Expand Up @@ -3263,11 +3308,16 @@ + (NSValueTransformer *)serverSideEncryptionJSONTransformer {
if ([value isEqualToString:@"AES256"]) {
return @(AWSS3ServerSideEncryptionAES256);
}
if ([value isEqualToString:@"aws:kms"]) {
return @(AWSS3ServerSideEncryptionKMS);
}
return @(AWSS3ServerSideEncryptionUnknown);
} reverseBlock:^NSString *(NSNumber *value) {
switch ([value integerValue]) {
case AWSS3ServerSideEncryptionAES256:
return @"AES256";
case AWSS3ServerSideEncryptionKMS:
return @"aws:kms";
case AWSS3ServerSideEncryptionUnknown:
default:
return nil;
Expand Down Expand Up @@ -3335,11 +3385,16 @@ + (NSValueTransformer *)serverSideEncryptionJSONTransformer {
if ([value isEqualToString:@"AES256"]) {
return @(AWSS3ServerSideEncryptionAES256);
}
if ([value isEqualToString:@"aws:kms"]) {
return @(AWSS3ServerSideEncryptionKMS);
}
return @(AWSS3ServerSideEncryptionUnknown);
} reverseBlock:^NSString *(NSNumber *value) {
switch ([value integerValue]) {
case AWSS3ServerSideEncryptionAES256:
return @"AES256";
case AWSS3ServerSideEncryptionKMS:
return @"aws:kms";
case AWSS3ServerSideEncryptionUnknown:
default:
return nil;
Expand Down

0 comments on commit 8505c7c

Please sign in to comment.