Browse Source

IOSAD-191 Add PEPIdentity+SecureCoding. Delete isConfirmed property in PEPIdentity.

IOSAD-191
David Alarcon 2 years ago
parent
commit
659ca7c74a
5 changed files with 72 additions and 10 deletions
  1. +17
    -0
      PEPObjCAdapterTypes/PublicHeaders/PEPIdentity+SecureCoding.h
  2. +0
    -5
      PEPObjCAdapterTypes/PublicHeaders/PEPIdentity.h
  3. +43
    -0
      PEPObjCAdapterTypes/src/PEPIdentity+SecureCoding.m
  4. +0
    -5
      PEPObjCAdapterTypes/src/PEPIdentity.m
  5. +12
    -0
      pEpObjCAdapter.xcodeproj/project.pbxproj

+ 17
- 0
PEPObjCAdapterTypes/PublicHeaders/PEPIdentity+SecureCoding.h View File

@ -0,0 +1,17 @@
//
// PEPIdentity+SecureCoding.h
// pEpObjCAdapter
//
// Created by David Alarcon on 25/1/21.
// Copyright © 2021 pp. All rights reserved.
//
#import "PEPIdentity.h"
NS_ASSUME_NONNULL_BEGIN
@interface PEPIdentity (SecureCoding) <NSSecureCoding>
@end
NS_ASSUME_NONNULL_END

+ 0
- 5
PEPObjCAdapterTypes/PublicHeaders/PEPIdentity.h View File

@ -53,11 +53,6 @@
/// ORed together.
@property int flags;
/**
Comm type contains the PEP_ct_confirmed flag?
*/
@property (readonly) BOOL isConfirmed;
- (nonnull instancetype)initWithAddress:(NSString * _Nonnull)address
userID:(NSString * _Nullable)userID
userName:(NSString * _Nullable)userName


+ 43
- 0
PEPObjCAdapterTypes/src/PEPIdentity+SecureCoding.m View File

@ -0,0 +1,43 @@
//
// PEPIdentity+SecureCoding.m
// pEpObjCAdapter
//
// Created by David Alarcon on 25/1/21.
// Copyright © 2021 pp. All rights reserved.
//
#import "PEPIdentity+SecureCoding.h"
@implementation PEPIdentity (SecureCoding)
- (void)encodeWithCoder:(nonnull NSCoder *)coder {
[coder encodeObject:self.address forKey:@"address"];
[coder encodeObject:self.userID forKey:@"userID"];
[coder encodeObject:self.userName forKey:@"userName"];
[coder encodeObject:self.fingerPrint forKey:@"fingerPrint"];
[coder encodeObject:self.language forKey:@"language"];
[coder encodeInt:self.commType forKey:@"commType"];
[coder encodeBool:self.isOwn forKey:@"isOwn"];
[coder encodeInt:self.flags forKey:@"flags"];
}
- (nullable instancetype)initWithCoder:(nonnull NSCoder *)decoder {
if (self = [self init]) {
self.address = [decoder decodeObjectOfClass:[NSString class] forKey:@"address"];
self.userID = [decoder decodeObjectOfClass:[NSString class] forKey:@"userID"];
self.userName = [decoder decodeObjectOfClass:[NSString class] forKey:@"userName"];
self.fingerPrint = [decoder decodeObjectOfClass:[NSString class] forKey:@"fingerPrint"];
self.language = [decoder decodeObjectOfClass:[NSString class] forKey:@"language"];
self.commType = [decoder decodeIntForKey:@"commType"];
self.isOwn = [decoder decodeBoolForKey:@"isOwn"];
self.flags = [decoder decodeIntForKey:@"flags"];
}
return self;
}
+ (BOOL)supportsSecureCoding {
return YES;
}
@end

+ 0
- 5
PEPObjCAdapterTypes/src/PEPIdentity.m View File

@ -68,11 +68,6 @@
language:identity.language];
}
- (BOOL)isConfirmed
{
return self.commType & PEP_ct_confirmed;
}
// MARK: - Equality
/**


+ 12
- 0
pEpObjCAdapter.xcodeproj/project.pbxproj View File

@ -178,6 +178,10 @@
4396CECB2187220200FDD398 /* PEPInternalSessionTestSendMessageDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 4396CEC8218721F900FDD398 /* PEPInternalSessionTestSendMessageDelegate.m */; };
43E02A201C71F65B008F05E9 /* A3FC7F0A_sec.asc in Resources */ = {isa = PBXBuildFile; fileRef = 43E02A1C1C71F65B008F05E9 /* A3FC7F0A_sec.asc */; };
43E02A211C71F65B008F05E9 /* A3FC7F0A.asc in Resources */ = {isa = PBXBuildFile; fileRef = 43E02A1D1C71F65B008F05E9 /* A3FC7F0A.asc */; };
4EA9B43F25BEE0990048427E /* PEPIdentity+SecureCoding.h in Headers */ = {isa = PBXBuildFile; fileRef = 4EA9B43D25BEE0990048427E /* PEPIdentity+SecureCoding.h */; settings = {ATTRIBUTES = (Public, ); }; };
4EA9B44125BEE0990048427E /* PEPIdentity+SecureCoding.m in Sources */ = {isa = PBXBuildFile; fileRef = 4EA9B43E25BEE0990048427E /* PEPIdentity+SecureCoding.m */; };
4EA9B45425BEE3C20048427E /* PEPIdentity+SecureCoding.m in Sources */ = {isa = PBXBuildFile; fileRef = 4EA9B43E25BEE0990048427E /* PEPIdentity+SecureCoding.m */; };
4EA9B45A25BEE3C80048427E /* PEPIdentity+SecureCoding.h in Headers */ = {isa = PBXBuildFile; fileRef = 4EA9B43D25BEE0990048427E /* PEPIdentity+SecureCoding.h */; };
640F79231C9B517C00DBEC4E /* 5CB2C182_sec.asc in Resources */ = {isa = PBXBuildFile; fileRef = 640F79211C9B517C00DBEC4E /* 5CB2C182_sec.asc */; };
640F79241C9B517C00DBEC4E /* 5CB2C182.asc in Resources */ = {isa = PBXBuildFile; fileRef = 640F79221C9B517C00DBEC4E /* 5CB2C182.asc */; };
64415E2F1BE9511C00F6CBB2 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 35FB0ABD1B57F99D00377032 /* Security.framework */; platformFilter = ios; };
@ -377,6 +381,8 @@
43ECE9C725407FF2005F1925 /* PEPMessage+Engine.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "PEPMessage+Engine.m"; sourceTree = "<group>"; };
43ECE9C825407FF3005F1925 /* PEPMessage+Engine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "PEPMessage+Engine.h"; sourceTree = "<group>"; };
43F73BE92166248E00AB4524 /* PEPSync.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PEPSync.m; sourceTree = "<group>"; };
4EA9B43D25BEE0990048427E /* PEPIdentity+SecureCoding.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "PEPIdentity+SecureCoding.h"; sourceTree = "<group>"; };
4EA9B43E25BEE0990048427E /* PEPIdentity+SecureCoding.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "PEPIdentity+SecureCoding.m"; sourceTree = "<group>"; };
640F79211C9B517C00DBEC4E /* 5CB2C182_sec.asc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = 5CB2C182_sec.asc; sourceTree = "<group>"; };
640F79221C9B517C00DBEC4E /* 5CB2C182.asc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = 5CB2C182.asc; sourceTree = "<group>"; };
64415E171BE94FCB00F6CBB2 /* pEpObjCAdapterTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = pEpObjCAdapterTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
@ -505,6 +511,7 @@
15B107A3257520DE00D06C34 /* src */ = {
isa = PBXGroup;
children = (
4EA9B43E25BEE0990048427E /* PEPIdentity+SecureCoding.m */,
15B109FA2575510300D06C34 /* NSObject+Extension.h */,
15B109FB2575510300D06C34 /* NSObject+Extension.m */,
15B109E625754F8800D06C34 /* PEPSessionProtocol.m */,
@ -526,6 +533,7 @@
15B107A8257520DE00D06C34 /* PEPMessage.h */,
15B107A9257520DE00D06C34 /* PEPAttachment.h */,
15B107AA257520DE00D06C34 /* PEPIdentity.h */,
4EA9B43D25BEE0990048427E /* PEPIdentity+SecureCoding.h */,
);
path = PublicHeaders;
sourceTree = "<group>";
@ -731,6 +739,7 @@
150E8FB525755B6900AE2198 /* PEPObjCAdapterTypes_macOS.h in Headers */,
1552D92E25765EDC00A92F71 /* PEPAttachment.h in Headers */,
1552D92A25765EDC00A92F71 /* PEPEngineTypes.h in Headers */,
4EA9B43F25BEE0990048427E /* PEPIdentity+SecureCoding.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@ -785,6 +794,7 @@
1552D981257660C900A92F71 /* PEPInternalSession.h in Headers */,
1552D974257660C900A92F71 /* Logger.h in Headers */,
1552D98A257660C900A92F71 /* NSError+PEP.h in Headers */,
4EA9B45A25BEE3C80048427E /* PEPIdentity+SecureCoding.h in Headers */,
1552D987257660C900A92F71 /* NSArray+Engine.h in Headers */,
1552D9522576607900A92F71 /* PEPObjCAdapter.h in Headers */,
1552D9502576607900A92F71 /* PEPSession.h in Headers */,
@ -1067,6 +1077,7 @@
files = (
150E8FB725755B6900AE2198 /* PEPObjCAdapterTypes_macOS.m in Sources */,
150E8FBF25755B7200AE2198 /* PEPMessage.m in Sources */,
4EA9B44125BEE0990048427E /* PEPIdentity+SecureCoding.m in Sources */,
150E8FC425755B7200AE2198 /* PEPAttachment.m in Sources */,
150E8FC125755B7200AE2198 /* PEPSessionProtocol.m in Sources */,
150E8FC325755B7200AE2198 /* PEPLanguage.m in Sources */,
@ -1141,6 +1152,7 @@
1552D98D257660C900A92F71 /* PEPPassphraseCacheEntry.m in Sources */,
1552D97E257660C900A92F71 /* NSString+NormalizePassphrase.m in Sources */,
1552D97F257660C900A92F71 /* NSNumber+PEPRating.m in Sources */,
4EA9B45425BEE3C20048427E /* PEPIdentity+SecureCoding.m in Sources */,
1552D984257660C900A92F71 /* PEPInternalSession+PassphraseCache.m in Sources */,
1552D96E257660C900A92F71 /* PEPAutoPointer.m in Sources */,
1552D96C257660C900A92F71 /* PEPSync.m in Sources */,


Loading…
Cancel
Save