IOS-1480 Merge IOS-1480 into refactor. refactor
authorDirk Zimmermann <dz@pep.security>
Thu, 21 Mar 2019 12:37:32 +0100
branchrefactor
changeset 903e9428f52fd88
parent 787 891ed4330b11
parent 902 32760267cd59
child 905 929095fe2998
child 906 68a503e49d2e
IOS-1480 Merge IOS-1480 into refactor.
pEpObjCAdapter/NSDictionary+Extension.h
pEpObjCAdapter/NSDictionary+Extension.m
pEpObjCAdapter/NSNumber+PEPRating.h
pEpObjCAdapter/PEPAttachment.h
pEpObjCAdapter/PEPIdentity.h
pEpObjCAdapter/PEPLanguage.h
pEpObjCAdapter/PEPMessage.h
pEpObjCAdapter/PEPObjCAdapter.h
pEpObjCAdapter/PEPSession.h
pEpObjCAdapter/PEPSessionProtocol.h
     1.1 --- a/pEpObjCAdapter.xcodeproj/project.pbxproj	Wed Feb 20 09:18:34 2019 +0100
     1.2 +++ b/pEpObjCAdapter.xcodeproj/project.pbxproj	Thu Mar 21 12:37:32 2019 +0100
     1.3 @@ -7,19 +7,9 @@
     1.4  	objects = {
     1.5  
     1.6  /* Begin PBXBuildFile section */
     1.7 -		1508AEAF1F8792AC001D5230 /* PEPCopyableThread.m in Sources */ = {isa = PBXBuildFile; fileRef = 1508AEAE1F8792AC001D5230 /* PEPCopyableThread.m */; };
     1.8 -		15206CAA1F8BA183003FF880 /* PEPSessionProvider.m in Sources */ = {isa = PBXBuildFile; fileRef = 15206CA91F8BA183003FF880 /* PEPSessionProvider.m */; };
     1.9 -		15206CC71F8E078B003FF880 /* PEPSession.m in Sources */ = {isa = PBXBuildFile; fileRef = 15206CC61F8E078B003FF880 /* PEPSession.m */; };
    1.10  		152A9C472010F50400F962ED /* PEPSessionTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 152A9C462010F50400F962ED /* PEPSessionTest.m */; };
    1.11  		152D58EF201B6DB200036219 /* PEPMessageUtilTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 152D58EE201B6DB200036219 /* PEPMessageUtilTest.m */; };
    1.12  		15D3D761200F61BB00A0DA20 /* PEPSessionProviderTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 15D3D760200F61BB00A0DA20 /* PEPSessionProviderTest.m */; };
    1.13 -		43209B3D1ECC2DA7007E7E2E /* NSArray+Extension.m in Sources */ = {isa = PBXBuildFile; fileRef = 43209B271ECC2ACD007E7E2E /* NSArray+Extension.m */; };
    1.14 -		43209B3E1ECC2DAB007E7E2E /* PEPCSVScanner.m in Sources */ = {isa = PBXBuildFile; fileRef = 43209B291ECC2ACD007E7E2E /* PEPCSVScanner.m */; };
    1.15 -		43209B3F1ECC2DB0007E7E2E /* PEPLanguage.m in Sources */ = {isa = PBXBuildFile; fileRef = 43209B2B1ECC2ACD007E7E2E /* PEPLanguage.m */; };
    1.16 -		43209B401ECC2DB4007E7E2E /* PEPMessageUtil.m in Sources */ = {isa = PBXBuildFile; fileRef = 43209B2D1ECC2ACD007E7E2E /* PEPMessageUtil.m */; };
    1.17 -		43209B411ECC2DB8007E7E2E /* PEPObjCAdapter.m in Sources */ = {isa = PBXBuildFile; fileRef = 43209B301ECC2ACD007E7E2E /* PEPObjCAdapter.m */; };
    1.18 -		43209B421ECC2DBC007E7E2E /* PEPQueue.m in Sources */ = {isa = PBXBuildFile; fileRef = 43209B321ECC2ACD007E7E2E /* PEPQueue.m */; };
    1.19 -		43209B431ECC2DC0007E7E2E /* PEPInternalSession.m in Sources */ = {isa = PBXBuildFile; fileRef = 43209B351ECC2ACD007E7E2E /* PEPInternalSession.m */; };
    1.20  		432EF60C1C58B77900B6782A /* 0xB623F674.asc in Resources */ = {isa = PBXBuildFile; fileRef = 432EF6091C58B77900B6782A /* 0xB623F674.asc */; };
    1.21  		432EF60E1C58B77900B6782A /* msg_to_B623F674.asc in Resources */ = {isa = PBXBuildFile; fileRef = 432EF60B1C58B77900B6782A /* msg_to_B623F674.asc */; };
    1.22  		432FA2D21C884C5F00DDF874 /* partner1_F2D281C2789DD7F6_pub.asc in Resources */ = {isa = PBXBuildFile; fileRef = 432FA2CF1C884C5F00DDF874 /* partner1_F2D281C2789DD7F6_pub.asc */; };
    1.23 @@ -28,30 +18,56 @@
    1.24  		432FA2D71C884FF500DDF874 /* meATdontcare_E3BFBCA9248FC681_pub.asc in Resources */ = {isa = PBXBuildFile; fileRef = 432FA2D51C884FF500DDF874 /* meATdontcare_E3BFBCA9248FC681_pub.asc */; };
    1.25  		432FA2D81C884FF500DDF874 /* meATdontcare_E3BFBCA9248FC681_sec.asc in Resources */ = {isa = PBXBuildFile; fileRef = 432FA2D61C884FF500DDF874 /* meATdontcare_E3BFBCA9248FC681_sec.asc */; };
    1.26  		4336853F203D5CE60069A451 /* PEPTestUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 15D3D77C2010DDC500A0DA20 /* PEPTestUtils.m */; };
    1.27 -		433E28911FA741DE00E359B3 /* PEPIdentity.m in Sources */ = {isa = PBXBuildFile; fileRef = 433E28901FA741DE00E359B3 /* PEPIdentity.m */; };
    1.28  		434226811D4F60000083ED79 /* PepTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 434226801D4F60000083ED79 /* PepTests.m */; };
    1.29 -		434ED6D6207E27B8000A7590 /* PEPAutoPointer.m in Sources */ = {isa = PBXBuildFile; fileRef = 434ED6D5207E27B8000A7590 /* PEPAutoPointer.m */; };
    1.30 -		435665CC2080A6CB00EC5B10 /* NSNumber+PEPRating.m in Sources */ = {isa = PBXBuildFile; fileRef = 435665CB2080A6CB00EC5B10 /* NSNumber+PEPRating.m */; };
    1.31 -		435796E31FB5E51A00395A9E /* PEPMessage.m in Sources */ = {isa = PBXBuildFile; fileRef = 435796E21FB5E51A00395A9E /* PEPMessage.m */; };
    1.32 +		435C0C8C22291FFB0025C6B5 /* PEPSession.h in Headers */ = {isa = PBXBuildFile; fileRef = 15206CC51F8E078B003FF880 /* PEPSession.h */; settings = {ATTRIBUTES = (Public, ); }; };
    1.33 +		435C0C9922292C080025C6B5 /* PEPMessage.h in Headers */ = {isa = PBXBuildFile; fileRef = 435796E11FB5E51A00395A9E /* PEPMessage.h */; settings = {ATTRIBUTES = (Public, ); }; };
    1.34 +		435C0CA222292E7C0025C6B5 /* PEPTypes.h in Headers */ = {isa = PBXBuildFile; fileRef = 435C0CA022292E7C0025C6B5 /* PEPTypes.h */; settings = {ATTRIBUTES = (Public, ); }; };
    1.35 +		435C0CAC222930340025C6B5 /* PEPConstants.h in Headers */ = {isa = PBXBuildFile; fileRef = 435C0CAA222930340025C6B5 /* PEPConstants.h */; settings = {ATTRIBUTES = (Public, ); }; };
    1.36 +		435C0CAD222930340025C6B5 /* PEPConstants.m in Sources */ = {isa = PBXBuildFile; fileRef = 435C0CAB222930340025C6B5 /* PEPConstants.m */; };
    1.37 +		435C0CBB2229380E0025C6B5 /* NSNumber+PEPRating.h in Headers */ = {isa = PBXBuildFile; fileRef = 435665CA2080A6CB00EC5B10 /* NSNumber+PEPRating.h */; settings = {ATTRIBUTES = (Public, ); }; };
    1.38 +		435C0CD922296B660025C6B5 /* PEPAttachment.h in Headers */ = {isa = PBXBuildFile; fileRef = 439D91A3208479EE003F6AC2 /* PEPAttachment.h */; settings = {ATTRIBUTES = (Public, ); }; };
    1.39 +		435F5164222045FB006EB11F /* PEPIdentity.h in Headers */ = {isa = PBXBuildFile; fileRef = 435F5163222045FB006EB11F /* PEPIdentity.h */; settings = {ATTRIBUTES = (Public, ); }; };
    1.40 +		435F5168222046C2006EB11F /* NSArray+Extension.m in Sources */ = {isa = PBXBuildFile; fileRef = 43209B271ECC2ACD007E7E2E /* NSArray+Extension.m */; };
    1.41 +		435F5169222046C2006EB11F /* PEPCSVScanner.m in Sources */ = {isa = PBXBuildFile; fileRef = 43209B291ECC2ACD007E7E2E /* PEPCSVScanner.m */; };
    1.42 +		435F516A222046C2006EB11F /* PEPLanguage.m in Sources */ = {isa = PBXBuildFile; fileRef = 43209B2B1ECC2ACD007E7E2E /* PEPLanguage.m */; };
    1.43 +		435F516B222046C2006EB11F /* PEPMessageUtil.m in Sources */ = {isa = PBXBuildFile; fileRef = 43209B2D1ECC2ACD007E7E2E /* PEPMessageUtil.m */; };
    1.44 +		435F516C222046C2006EB11F /* PEPObjCAdapter.m in Sources */ = {isa = PBXBuildFile; fileRef = 43209B301ECC2ACD007E7E2E /* PEPObjCAdapter.m */; };
    1.45 +		435F516D222046C2006EB11F /* PEPQueue.m in Sources */ = {isa = PBXBuildFile; fileRef = 43209B321ECC2ACD007E7E2E /* PEPQueue.m */; };
    1.46 +		435F516E222046C2006EB11F /* PEPInternalSession.m in Sources */ = {isa = PBXBuildFile; fileRef = 43209B351ECC2ACD007E7E2E /* PEPInternalSession.m */; };
    1.47 +		435F516F222046C2006EB11F /* NSDictionary+CommType.m in Sources */ = {isa = PBXBuildFile; fileRef = 43D27DE51F5DA7B700795687 /* NSDictionary+CommType.m */; };
    1.48 +		435F5170222046C2006EB11F /* NSDictionary+Debug.m in Sources */ = {isa = PBXBuildFile; fileRef = 43953B3420C91E2B001C7DDB /* NSDictionary+Debug.m */; };
    1.49 +		435F5171222046C2006EB11F /* PEPCopyableThread.m in Sources */ = {isa = PBXBuildFile; fileRef = 1508AEAE1F8792AC001D5230 /* PEPCopyableThread.m */; };
    1.50 +		435F5172222046C2006EB11F /* PEPSessionProvider.m in Sources */ = {isa = PBXBuildFile; fileRef = 15206CA91F8BA183003FF880 /* PEPSessionProvider.m */; };
    1.51 +		435F5173222046C2006EB11F /* PEPSession.m in Sources */ = {isa = PBXBuildFile; fileRef = 15206CC61F8E078B003FF880 /* PEPSession.m */; };
    1.52 +		435F5174222046C2006EB11F /* PEPIdentity.m in Sources */ = {isa = PBXBuildFile; fileRef = 433E28901FA741DE00E359B3 /* PEPIdentity.m */; };
    1.53 +		435F5175222046C2006EB11F /* PEPMessage.m in Sources */ = {isa = PBXBuildFile; fileRef = 435796E21FB5E51A00395A9E /* PEPMessage.m */; };
    1.54 +		435F5176222046C2006EB11F /* PEPAttachment.m in Sources */ = {isa = PBXBuildFile; fileRef = 439D91A4208479EE003F6AC2 /* PEPAttachment.m */; };
    1.55 +		435F5177222046C2006EB11F /* NSError+PEP.m in Sources */ = {isa = PBXBuildFile; fileRef = 43DED785203C25E200D45CD6 /* NSError+PEP.m */; };
    1.56 +		435F5178222046C2006EB11F /* PEPAutoPointer.m in Sources */ = {isa = PBXBuildFile; fileRef = 434ED6D5207E27B8000A7590 /* PEPAutoPointer.m */; };
    1.57 +		435F5179222046C2006EB11F /* NSNumber+PEPRating.m in Sources */ = {isa = PBXBuildFile; fileRef = 435665CB2080A6CB00EC5B10 /* NSNumber+PEPRating.m */; };
    1.58 +		435F517A222046C2006EB11F /* NSObject+Extension.m in Sources */ = {isa = PBXBuildFile; fileRef = 439393E5208F375800EB1DBD /* NSObject+Extension.m */; };
    1.59 +		435F517B222046C2006EB11F /* NSMutableDictionary+PEP.m in Sources */ = {isa = PBXBuildFile; fileRef = 439393F7208F5B5E00EB1DBD /* NSMutableDictionary+PEP.m */; };
    1.60 +		435F517C222046C2006EB11F /* PEPLock.m in Sources */ = {isa = PBXBuildFile; fileRef = 43F73BD32165F6EC00AB4524 /* PEPLock.m */; };
    1.61 +		435F517D222046C2006EB11F /* PEPSync.m in Sources */ = {isa = PBXBuildFile; fileRef = 43F73BE92166248E00AB4524 /* PEPSync.m */; };
    1.62 +		435F519022204A67006EB11F /* PEPSessionProtocol.h in Headers */ = {isa = PBXBuildFile; fileRef = 435F518F22204A67006EB11F /* PEPSessionProtocol.h */; settings = {ATTRIBUTES = (Public, ); }; };
    1.63 +		4360AA0E2227F22900E62E5A /* PEPObjCAdapter.h in Headers */ = {isa = PBXBuildFile; fileRef = 43209B2F1ECC2ACD007E7E2E /* PEPObjCAdapter.h */; settings = {ATTRIBUTES = (Public, ); }; };
    1.64  		43676B661C57EA1A00233933 /* B623F674_sec.asc in Resources */ = {isa = PBXBuildFile; fileRef = 43676B641C57EA1A00233933 /* B623F674_sec.asc */; };
    1.65 -		439393E6208F375800EB1DBD /* NSObject+Extension.m in Sources */ = {isa = PBXBuildFile; fileRef = 439393E5208F375800EB1DBD /* NSObject+Extension.m */; };
    1.66 -		439393F8208F5B5E00EB1DBD /* NSMutableDictionary+PEP.m in Sources */ = {isa = PBXBuildFile; fileRef = 439393F7208F5B5E00EB1DBD /* NSMutableDictionary+PEP.m */; };
    1.67 -		43953B3520C91E2B001C7DDB /* NSDictionary+Debug.m in Sources */ = {isa = PBXBuildFile; fileRef = 43953B3420C91E2B001C7DDB /* NSDictionary+Debug.m */; };
    1.68 +		43753CFB222D4911002EE98B /* PEPLanguage.h in Headers */ = {isa = PBXBuildFile; fileRef = 43209B2A1ECC2ACD007E7E2E /* PEPLanguage.h */; settings = {ATTRIBUTES = (Public, ); }; };
    1.69 +		437BEA9122328E570051E3A1 /* pEpTrustWords.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 64AE6B211BE15E3A000867E4 /* pEpTrustWords.bundle */; };
    1.70  		4396CEB82187196600FDD398 /* PEPSessionTestNotifyHandshakeDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 4396CEB62187190F00FDD398 /* PEPSessionTestNotifyHandshakeDelegate.m */; };
    1.71  		4396CECB2187220200FDD398 /* PEPSessionTestSendMessageDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 4396CEC8218721F900FDD398 /* PEPSessionTestSendMessageDelegate.m */; };
    1.72 -		439D91A5208479EE003F6AC2 /* PEPAttachment.m in Sources */ = {isa = PBXBuildFile; fileRef = 439D91A4208479EE003F6AC2 /* PEPAttachment.m */; };
    1.73 -		43D27DE61F5DA7B700795687 /* NSDictionary+Extension.m in Sources */ = {isa = PBXBuildFile; fileRef = 43D27DE51F5DA7B700795687 /* NSDictionary+Extension.m */; };
    1.74 -		43DED786203C25E200D45CD6 /* NSError+PEP.m in Sources */ = {isa = PBXBuildFile; fileRef = 43DED785203C25E200D45CD6 /* NSError+PEP.m */; };
    1.75 +		43BCEFF7222FBA2400148303 /* NSDictionary+CommType.h in Headers */ = {isa = PBXBuildFile; fileRef = 43D27DE41F5DA78700795687 /* NSDictionary+CommType.h */; settings = {ATTRIBUTES = (Public, ); }; };
    1.76  		43E02A201C71F65B008F05E9 /* A3FC7F0A_sec.asc in Resources */ = {isa = PBXBuildFile; fileRef = 43E02A1C1C71F65B008F05E9 /* A3FC7F0A_sec.asc */; };
    1.77  		43E02A211C71F65B008F05E9 /* A3FC7F0A.asc in Resources */ = {isa = PBXBuildFile; fileRef = 43E02A1D1C71F65B008F05E9 /* A3FC7F0A.asc */; };
    1.78  		43E02A221C71F65B008F05E9 /* account_A3FC7F0A.ser in Resources */ = {isa = PBXBuildFile; fileRef = 43E02A1E1C71F65B008F05E9 /* account_A3FC7F0A.ser */; };
    1.79  		43E02A231C71F65B008F05E9 /* msg_to_A3FC7F0A_from_mutt.ser in Resources */ = {isa = PBXBuildFile; fileRef = 43E02A1F1C71F65B008F05E9 /* msg_to_A3FC7F0A_from_mutt.ser */; };
    1.80 -		43F73BD42165F6EC00AB4524 /* PEPLock.m in Sources */ = {isa = PBXBuildFile; fileRef = 43F73BD32165F6EC00AB4524 /* PEPLock.m */; };
    1.81 -		43F73BEA2166248E00AB4524 /* PEPSync.m in Sources */ = {isa = PBXBuildFile; fileRef = 43F73BE92166248E00AB4524 /* PEPSync.m */; };
    1.82 -		6400FB911B8CA543005221E3 /* libpEpEngine.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 64289E561B8B70E800FC617B /* libpEpEngine.a */; };
    1.83 +		43E3985F221D7E56008E7983 /* PEPObjCAdapterFramework.h in Headers */ = {isa = PBXBuildFile; fileRef = 43E3985D221D7E56008E7983 /* PEPObjCAdapterFramework.h */; settings = {ATTRIBUTES = (Public, ); }; };
    1.84 +		43E39867221D7EB1008E7983 /* libpEpEngine.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 64289E561B8B70E800FC617B /* libpEpEngine.a */; };
    1.85 +		43E39869221D7EC2008E7983 /* libbz2.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 43E39868221D7EC2008E7983 /* libbz2.tbd */; };
    1.86 +		43E3986B221D7EDD008E7983 /* libiconv.2.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 43E3986A221D7EDD008E7983 /* libiconv.2.tbd */; };
    1.87 +		43FF2ED12226AFE9000D9567 /* PEPEngineTypes.h in Headers */ = {isa = PBXBuildFile; fileRef = 43FF2ECC2226AE7E000D9567 /* PEPEngineTypes.h */; settings = {ATTRIBUTES = (Public, ); }; };
    1.88  		640F79231C9B517C00DBEC4E /* 5CB2C182_sec.asc in Resources */ = {isa = PBXBuildFile; fileRef = 640F79211C9B517C00DBEC4E /* 5CB2C182_sec.asc */; };
    1.89  		640F79241C9B517C00DBEC4E /* 5CB2C182.asc in Resources */ = {isa = PBXBuildFile; fileRef = 640F79221C9B517C00DBEC4E /* 5CB2C182.asc */; };
    1.90 -		64415E1C1BE94FCB00F6CBB2 /* libpEpObjCAdapter.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 352988AA1AEF964100FA7E2E /* libpEpObjCAdapter.a */; };
    1.91  		64415E2E1BE9511300F6CBB2 /* libbz2.1.0.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 64415E2D1BE9511300F6CBB2 /* libbz2.1.0.dylib */; };
    1.92  		64415E2F1BE9511C00F6CBB2 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 35FB0ABD1B57F99D00377032 /* Security.framework */; };
    1.93  		64415E301BE9513300F6CBB2 /* CFNetwork.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 35FB0ABB1B57F97E00377032 /* CFNetwork.framework */; };
    1.94 @@ -65,7 +81,14 @@
    1.95  /* End PBXBuildFile section */
    1.96  
    1.97  /* Begin PBXContainerItemProxy section */
    1.98 -		640F89471BE37C4F00B34B30 /* PBXContainerItemProxy */ = {
    1.99 +		43E39863221D7E9A008E7983 /* PBXContainerItemProxy */ = {
   1.100 +			isa = PBXContainerItemProxy;
   1.101 +			containerPortal = 64DA243B1B833248000BEE80 /* pEpEngine.xcodeproj */;
   1.102 +			proxyType = 1;
   1.103 +			remoteGlobalIDString = 64796A3E1B455AA5004B1C24;
   1.104 +			remoteInfo = pEpEngine;
   1.105 +		};
   1.106 +		43E39865221D7E9A008E7983 /* PBXContainerItemProxy */ = {
   1.107  			isa = PBXContainerItemProxy;
   1.108  			containerPortal = 64DA243B1B833248000BEE80 /* pEpEngine.xcodeproj */;
   1.109  			proxyType = 1;
   1.110 @@ -79,20 +102,6 @@
   1.111  			remoteGlobalIDString = 64796A3F1B455AA5004B1C24;
   1.112  			remoteInfo = pEpEngine;
   1.113  		};
   1.114 -		64289E571B8B70FF00FC617B /* PBXContainerItemProxy */ = {
   1.115 -			isa = PBXContainerItemProxy;
   1.116 -			containerPortal = 64DA243B1B833248000BEE80 /* pEpEngine.xcodeproj */;
   1.117 -			proxyType = 1;
   1.118 -			remoteGlobalIDString = 64796A3E1B455AA5004B1C24;
   1.119 -			remoteInfo = pEpEngine;
   1.120 -		};
   1.121 -		64415E1D1BE94FCB00F6CBB2 /* PBXContainerItemProxy */ = {
   1.122 -			isa = PBXContainerItemProxy;
   1.123 -			containerPortal = 352988A21AEF964100FA7E2E /* Project object */;
   1.124 -			proxyType = 1;
   1.125 -			remoteGlobalIDString = 352988A91AEF964100FA7E2E;
   1.126 -			remoteInfo = pEpiOSAdapter;
   1.127 -		};
   1.128  		64415E3F1BE95B2000F6CBB2 /* PBXContainerItemProxy */ = {
   1.129  			isa = PBXContainerItemProxy;
   1.130  			containerPortal = 64DA243B1B833248000BEE80 /* pEpEngine.xcodeproj */;
   1.131 @@ -109,18 +118,6 @@
   1.132  		};
   1.133  /* End PBXContainerItemProxy section */
   1.134  
   1.135 -/* Begin PBXCopyFilesBuildPhase section */
   1.136 -		352988A81AEF964100FA7E2E /* CopyFiles */ = {
   1.137 -			isa = PBXCopyFilesBuildPhase;
   1.138 -			buildActionMask = 2147483647;
   1.139 -			dstPath = "include/$(PRODUCT_NAME)";
   1.140 -			dstSubfolderSpec = 16;
   1.141 -			files = (
   1.142 -			);
   1.143 -			runOnlyForDeploymentPostprocessing = 0;
   1.144 -		};
   1.145 -/* End PBXCopyFilesBuildPhase section */
   1.146 -
   1.147  /* Begin PBXFileReference section */
   1.148  		1508AEAD1F8792AC001D5230 /* PEPCopyableThread.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PEPCopyableThread.h; sourceTree = "<group>"; };
   1.149  		1508AEAE1F8792AC001D5230 /* PEPCopyableThread.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PEPCopyableThread.m; sourceTree = "<group>"; };
   1.150 @@ -133,7 +130,6 @@
   1.151  		15D3D760200F61BB00A0DA20 /* PEPSessionProviderTest.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PEPSessionProviderTest.m; sourceTree = "<group>"; };
   1.152  		15D3D77B2010DDC500A0DA20 /* PEPTestUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PEPTestUtils.h; sourceTree = "<group>"; };
   1.153  		15D3D77C2010DDC500A0DA20 /* PEPTestUtils.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PEPTestUtils.m; sourceTree = "<group>"; };
   1.154 -		352988AA1AEF964100FA7E2E /* libpEpObjCAdapter.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libpEpObjCAdapter.a; sourceTree = BUILT_PRODUCTS_DIR; };
   1.155  		35FB0ABB1B57F97E00377032 /* CFNetwork.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CFNetwork.framework; path = System/Library/Frameworks/CFNetwork.framework; sourceTree = SDKROOT; };
   1.156  		35FB0ABD1B57F99D00377032 /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = System/Library/Frameworks/Security.framework; sourceTree = SDKROOT; };
   1.157  		43209B261ECC2ACD007E7E2E /* NSArray+Extension.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSArray+Extension.h"; sourceTree = "<group>"; };
   1.158 @@ -159,8 +155,6 @@
   1.159  		432FA2D11C884C5F00DDF874 /* partner2_F9D9CCD0A401311F_pub.asc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = partner2_F9D9CCD0A401311F_pub.asc; sourceTree = "<group>"; };
   1.160  		432FA2D51C884FF500DDF874 /* meATdontcare_E3BFBCA9248FC681_pub.asc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = meATdontcare_E3BFBCA9248FC681_pub.asc; sourceTree = "<group>"; };
   1.161  		432FA2D61C884FF500DDF874 /* meATdontcare_E3BFBCA9248FC681_sec.asc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = meATdontcare_E3BFBCA9248FC681_sec.asc; sourceTree = "<group>"; };
   1.162 -		433E288E1FA7342000E359B3 /* PEPSessionProtocol.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PEPSessionProtocol.h; sourceTree = "<group>"; };
   1.163 -		433E288F1FA741DE00E359B3 /* PEPIdentity.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PEPIdentity.h; sourceTree = "<group>"; };
   1.164  		433E28901FA741DE00E359B3 /* PEPIdentity.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PEPIdentity.m; sourceTree = "<group>"; };
   1.165  		434226801D4F60000083ED79 /* PepTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PepTests.m; sourceTree = "<group>"; };
   1.166  		434ED6D4207E27B8000A7590 /* PEPAutoPointer.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PEPAutoPointer.h; sourceTree = "<group>"; };
   1.167 @@ -169,6 +163,13 @@
   1.168  		435665CB2080A6CB00EC5B10 /* NSNumber+PEPRating.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "NSNumber+PEPRating.m"; sourceTree = "<group>"; };
   1.169  		435796E11FB5E51A00395A9E /* PEPMessage.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PEPMessage.h; sourceTree = "<group>"; };
   1.170  		435796E21FB5E51A00395A9E /* PEPMessage.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PEPMessage.m; sourceTree = "<group>"; };
   1.171 +		435C0CA022292E7C0025C6B5 /* PEPTypes.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = PEPTypes.h; path = pEpObjCAdapterFramework/PEPTypes.h; sourceTree = SOURCE_ROOT; };
   1.172 +		435C0CAA222930340025C6B5 /* PEPConstants.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PEPConstants.h; sourceTree = "<group>"; };
   1.173 +		435C0CAB222930340025C6B5 /* PEPConstants.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PEPConstants.m; sourceTree = "<group>"; };
   1.174 +		435F5163222045FB006EB11F /* PEPIdentity.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PEPIdentity.h; path = pEpObjCAdapterFramework/PEPIdentity.h; sourceTree = SOURCE_ROOT; };
   1.175 +		435F518F22204A67006EB11F /* PEPSessionProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PEPSessionProtocol.h; path = pEpObjCAdapterFramework/PEPSessionProtocol.h; sourceTree = SOURCE_ROOT; };
   1.176 +		4360A9FD2227CFA300E62E5A /* NSError+PEP+Internal.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "NSError+PEP+Internal.h"; sourceTree = "<group>"; };
   1.177 +		4360A9FE2227EBB200E62E5A /* NSNumber+PEPRating+Internal.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "NSNumber+PEPRating+Internal.h"; sourceTree = "<group>"; };
   1.178  		43676B631C57EA1A00233933 /* 0xB623F674.asc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = 0xB623F674.asc; sourceTree = "<group>"; };
   1.179  		43676B641C57EA1A00233933 /* B623F674_sec.asc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = B623F674_sec.asc; sourceTree = "<group>"; };
   1.180  		438C4393216744DA00C7425B /* PEPSendMessageDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PEPSendMessageDelegate.h; sourceTree = "<group>"; };
   1.181 @@ -185,18 +186,24 @@
   1.182  		4396CEC9218721F900FDD398 /* PEPSessionTestSendMessageDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PEPSessionTestSendMessageDelegate.h; sourceTree = "<group>"; };
   1.183  		439D91A3208479EE003F6AC2 /* PEPAttachment.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PEPAttachment.h; sourceTree = "<group>"; };
   1.184  		439D91A4208479EE003F6AC2 /* PEPAttachment.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PEPAttachment.m; sourceTree = "<group>"; };
   1.185 -		43D27DE41F5DA78700795687 /* NSDictionary+Extension.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSDictionary+Extension.h"; sourceTree = "<group>"; };
   1.186 -		43D27DE51F5DA7B700795687 /* NSDictionary+Extension.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSDictionary+Extension.m"; sourceTree = "<group>"; };
   1.187 +		43D27DE41F5DA78700795687 /* NSDictionary+CommType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSDictionary+CommType.h"; sourceTree = "<group>"; };
   1.188 +		43D27DE51F5DA7B700795687 /* NSDictionary+CommType.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSDictionary+CommType.m"; sourceTree = "<group>"; };
   1.189  		43DED784203C25E200D45CD6 /* NSError+PEP.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "NSError+PEP.h"; sourceTree = "<group>"; };
   1.190  		43DED785203C25E200D45CD6 /* NSError+PEP.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "NSError+PEP.m"; sourceTree = "<group>"; };
   1.191  		43E02A1C1C71F65B008F05E9 /* A3FC7F0A_sec.asc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = A3FC7F0A_sec.asc; sourceTree = "<group>"; };
   1.192  		43E02A1D1C71F65B008F05E9 /* A3FC7F0A.asc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = A3FC7F0A.asc; sourceTree = "<group>"; };
   1.193  		43E02A1E1C71F65B008F05E9 /* account_A3FC7F0A.ser */ = {isa = PBXFileReference; lastKnownFileType = file.bplist; path = account_A3FC7F0A.ser; sourceTree = "<group>"; };
   1.194  		43E02A1F1C71F65B008F05E9 /* msg_to_A3FC7F0A_from_mutt.ser */ = {isa = PBXFileReference; lastKnownFileType = file.bplist; path = msg_to_A3FC7F0A_from_mutt.ser; sourceTree = "<group>"; };
   1.195 +		43E3985B221D7E56008E7983 /* PEPObjCAdapterFramework.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = PEPObjCAdapterFramework.framework; sourceTree = BUILT_PRODUCTS_DIR; };
   1.196 +		43E3985D221D7E56008E7983 /* PEPObjCAdapterFramework.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PEPObjCAdapterFramework.h; sourceTree = "<group>"; };
   1.197 +		43E3985E221D7E56008E7983 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
   1.198 +		43E39868221D7EC2008E7983 /* libbz2.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libbz2.tbd; path = usr/lib/libbz2.tbd; sourceTree = SDKROOT; };
   1.199 +		43E3986A221D7EDD008E7983 /* libiconv.2.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libiconv.2.tbd; path = usr/lib/libiconv.2.tbd; sourceTree = SDKROOT; };
   1.200  		43F73BD22165F6EC00AB4524 /* PEPLock.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PEPLock.h; sourceTree = "<group>"; };
   1.201  		43F73BD32165F6EC00AB4524 /* PEPLock.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PEPLock.m; sourceTree = "<group>"; };
   1.202  		43F73BE82166248E00AB4524 /* PEPSync.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PEPSync.h; sourceTree = "<group>"; };
   1.203  		43F73BE92166248E00AB4524 /* PEPSync.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PEPSync.m; sourceTree = "<group>"; };
   1.204 +		43FF2ECC2226AE7E000D9567 /* PEPEngineTypes.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = PEPEngineTypes.h; path = pEpObjCAdapterFramework/PEPEngineTypes.h; sourceTree = SOURCE_ROOT; };
   1.205  		640F79211C9B517C00DBEC4E /* 5CB2C182_sec.asc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = 5CB2C182_sec.asc; sourceTree = "<group>"; };
   1.206  		640F79221C9B517C00DBEC4E /* 5CB2C182.asc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = 5CB2C182.asc; sourceTree = "<group>"; };
   1.207  		64415E171BE94FCB00F6CBB2 /* pEpObjCAdapterTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = pEpObjCAdapterTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
   1.208 @@ -212,11 +219,13 @@
   1.209  /* End PBXFileReference section */
   1.210  
   1.211  /* Begin PBXFrameworksBuildPhase section */
   1.212 -		352988A71AEF964100FA7E2E /* Frameworks */ = {
   1.213 +		43E39858221D7E56008E7983 /* Frameworks */ = {
   1.214  			isa = PBXFrameworksBuildPhase;
   1.215  			buildActionMask = 2147483647;
   1.216  			files = (
   1.217 -				6400FB911B8CA543005221E3 /* libpEpEngine.a in Frameworks */,
   1.218 +				43E3986B221D7EDD008E7983 /* libiconv.2.tbd in Frameworks */,
   1.219 +				43E39869221D7EC2008E7983 /* libbz2.tbd in Frameworks */,
   1.220 +				43E39867221D7EB1008E7983 /* libpEpEngine.a in Frameworks */,
   1.221  			);
   1.222  			runOnlyForDeploymentPostprocessing = 0;
   1.223  		};
   1.224 @@ -227,7 +236,6 @@
   1.225  				64415E2E1BE9511300F6CBB2 /* libbz2.1.0.dylib in Frameworks */,
   1.226  				64415E2F1BE9511C00F6CBB2 /* Security.framework in Frameworks */,
   1.227  				64415E301BE9513300F6CBB2 /* CFNetwork.framework in Frameworks */,
   1.228 -				64415E1C1BE94FCB00F6CBB2 /* libpEpObjCAdapter.a in Frameworks */,
   1.229  			);
   1.230  			runOnlyForDeploymentPostprocessing = 0;
   1.231  		};
   1.232 @@ -285,15 +293,17 @@
   1.233  				35FB0ABB1B57F97E00377032 /* CFNetwork.framework */,
   1.234  				43209B251ECC2ACD007E7E2E /* pEpObjCAdapter */,
   1.235  				64415E181BE94FCB00F6CBB2 /* pEpObjCTests */,
   1.236 +				43E3985C221D7E56008E7983 /* PEPObjCAdapterFramework */,
   1.237  				352988AB1AEF964100FA7E2E /* Products */,
   1.238 +				43447C51221D448500B6323E /* Frameworks */,
   1.239  			);
   1.240  			sourceTree = "<group>";
   1.241  		};
   1.242  		352988AB1AEF964100FA7E2E /* Products */ = {
   1.243  			isa = PBXGroup;
   1.244  			children = (
   1.245 -				352988AA1AEF964100FA7E2E /* libpEpObjCAdapter.a */,
   1.246  				64415E171BE94FCB00F6CBB2 /* pEpObjCAdapterTests.xctest */,
   1.247 +				43E3985B221D7E56008E7983 /* PEPObjCAdapterFramework.framework */,
   1.248  			);
   1.249  			name = Products;
   1.250  			sourceTree = "<group>";
   1.251 @@ -305,39 +315,32 @@
   1.252  				43209B271ECC2ACD007E7E2E /* NSArray+Extension.m */,
   1.253  				43209B281ECC2ACD007E7E2E /* PEPCSVScanner.h */,
   1.254  				43209B291ECC2ACD007E7E2E /* PEPCSVScanner.m */,
   1.255 -				43209B2A1ECC2ACD007E7E2E /* PEPLanguage.h */,
   1.256  				43209B2B1ECC2ACD007E7E2E /* PEPLanguage.m */,
   1.257  				43209B2C1ECC2ACD007E7E2E /* PEPMessageUtil.h */,
   1.258  				43209B2D1ECC2ACD007E7E2E /* PEPMessageUtil.m */,
   1.259  				43209B2E1ECC2ACD007E7E2E /* PEPObjCAdapter+Internal.h */,
   1.260 -				43209B2F1ECC2ACD007E7E2E /* PEPObjCAdapter.h */,
   1.261  				43209B301ECC2ACD007E7E2E /* PEPObjCAdapter.m */,
   1.262  				43209B311ECC2ACD007E7E2E /* PEPQueue.h */,
   1.263  				43209B321ECC2ACD007E7E2E /* PEPQueue.m */,
   1.264  				43209B341ECC2ACD007E7E2E /* PEPInternalSession.h */,
   1.265  				43209B351ECC2ACD007E7E2E /* PEPInternalSession.m */,
   1.266 -				43D27DE41F5DA78700795687 /* NSDictionary+Extension.h */,
   1.267 -				43D27DE51F5DA7B700795687 /* NSDictionary+Extension.m */,
   1.268 +				43D27DE51F5DA7B700795687 /* NSDictionary+CommType.m */,
   1.269  				43953B3320C91E2B001C7DDB /* NSDictionary+Debug.h */,
   1.270  				43953B3420C91E2B001C7DDB /* NSDictionary+Debug.m */,
   1.271  				1508AEAD1F8792AC001D5230 /* PEPCopyableThread.h */,
   1.272  				1508AEAE1F8792AC001D5230 /* PEPCopyableThread.m */,
   1.273  				15206CA81F8BA183003FF880 /* PEPSessionProvider.h */,
   1.274  				15206CA91F8BA183003FF880 /* PEPSessionProvider.m */,
   1.275 -				15206CC51F8E078B003FF880 /* PEPSession.h */,
   1.276  				15206CC61F8E078B003FF880 /* PEPSession.m */,
   1.277 -				433E288E1FA7342000E359B3 /* PEPSessionProtocol.h */,
   1.278 -				433E288F1FA741DE00E359B3 /* PEPIdentity.h */,
   1.279  				433E28901FA741DE00E359B3 /* PEPIdentity.m */,
   1.280 -				435796E11FB5E51A00395A9E /* PEPMessage.h */,
   1.281  				435796E21FB5E51A00395A9E /* PEPMessage.m */,
   1.282 -				439D91A3208479EE003F6AC2 /* PEPAttachment.h */,
   1.283  				439D91A4208479EE003F6AC2 /* PEPAttachment.m */,
   1.284  				43DED784203C25E200D45CD6 /* NSError+PEP.h */,
   1.285 +				4360A9FD2227CFA300E62E5A /* NSError+PEP+Internal.h */,
   1.286  				43DED785203C25E200D45CD6 /* NSError+PEP.m */,
   1.287  				434ED6D4207E27B8000A7590 /* PEPAutoPointer.h */,
   1.288  				434ED6D5207E27B8000A7590 /* PEPAutoPointer.m */,
   1.289 -				435665CA2080A6CB00EC5B10 /* NSNumber+PEPRating.h */,
   1.290 +				4360A9FE2227EBB200E62E5A /* NSNumber+PEPRating+Internal.h */,
   1.291  				435665CB2080A6CB00EC5B10 /* NSNumber+PEPRating.m */,
   1.292  				439393E4208F375800EB1DBD /* NSObject+Extension.h */,
   1.293  				439393E5208F375800EB1DBD /* NSObject+Extension.m */,
   1.294 @@ -353,6 +356,37 @@
   1.295  			path = pEpObjCAdapter;
   1.296  			sourceTree = "<group>";
   1.297  		};
   1.298 +		43447C51221D448500B6323E /* Frameworks */ = {
   1.299 +			isa = PBXGroup;
   1.300 +			children = (
   1.301 +				43E3986A221D7EDD008E7983 /* libiconv.2.tbd */,
   1.302 +				43E39868221D7EC2008E7983 /* libbz2.tbd */,
   1.303 +			);
   1.304 +			name = Frameworks;
   1.305 +			sourceTree = "<group>";
   1.306 +		};
   1.307 +		43E3985C221D7E56008E7983 /* PEPObjCAdapterFramework */ = {
   1.308 +			isa = PBXGroup;
   1.309 +			children = (
   1.310 +				43D27DE41F5DA78700795687 /* NSDictionary+CommType.h */,
   1.311 +				43209B2A1ECC2ACD007E7E2E /* PEPLanguage.h */,
   1.312 +				439D91A3208479EE003F6AC2 /* PEPAttachment.h */,
   1.313 +				435665CA2080A6CB00EC5B10 /* NSNumber+PEPRating.h */,
   1.314 +				435C0CAA222930340025C6B5 /* PEPConstants.h */,
   1.315 +				435C0CAB222930340025C6B5 /* PEPConstants.m */,
   1.316 +				435796E11FB5E51A00395A9E /* PEPMessage.h */,
   1.317 +				15206CC51F8E078B003FF880 /* PEPSession.h */,
   1.318 +				43209B2F1ECC2ACD007E7E2E /* PEPObjCAdapter.h */,
   1.319 +				435C0CA022292E7C0025C6B5 /* PEPTypes.h */,
   1.320 +				43FF2ECC2226AE7E000D9567 /* PEPEngineTypes.h */,
   1.321 +				435F518F22204A67006EB11F /* PEPSessionProtocol.h */,
   1.322 +				435F5163222045FB006EB11F /* PEPIdentity.h */,
   1.323 +				43E3985D221D7E56008E7983 /* PEPObjCAdapterFramework.h */,
   1.324 +				43E3985E221D7E56008E7983 /* Info.plist */,
   1.325 +			);
   1.326 +			path = PEPObjCAdapterFramework;
   1.327 +			sourceTree = "<group>";
   1.328 +		};
   1.329  		64289E521B8B70E800FC617B /* Products */ = {
   1.330  			isa = PBXGroup;
   1.331  			children = (
   1.332 @@ -378,25 +412,49 @@
   1.333  		};
   1.334  /* End PBXGroup section */
   1.335  
   1.336 +/* Begin PBXHeadersBuildPhase section */
   1.337 +		43E39856221D7E56008E7983 /* Headers */ = {
   1.338 +			isa = PBXHeadersBuildPhase;
   1.339 +			buildActionMask = 2147483647;
   1.340 +			files = (
   1.341 +				43753CFB222D4911002EE98B /* PEPLanguage.h in Headers */,
   1.342 +				4360AA0E2227F22900E62E5A /* PEPObjCAdapter.h in Headers */,
   1.343 +				435C0C9922292C080025C6B5 /* PEPMessage.h in Headers */,
   1.344 +				435C0CA222292E7C0025C6B5 /* PEPTypes.h in Headers */,
   1.345 +				435F5164222045FB006EB11F /* PEPIdentity.h in Headers */,
   1.346 +				43E3985F221D7E56008E7983 /* PEPObjCAdapterFramework.h in Headers */,
   1.347 +				435C0C8C22291FFB0025C6B5 /* PEPSession.h in Headers */,
   1.348 +				435C0CAC222930340025C6B5 /* PEPConstants.h in Headers */,
   1.349 +				43FF2ED12226AFE9000D9567 /* PEPEngineTypes.h in Headers */,
   1.350 +				435F519022204A67006EB11F /* PEPSessionProtocol.h in Headers */,
   1.351 +				435C0CD922296B660025C6B5 /* PEPAttachment.h in Headers */,
   1.352 +				435C0CBB2229380E0025C6B5 /* NSNumber+PEPRating.h in Headers */,
   1.353 +				43BCEFF7222FBA2400148303 /* NSDictionary+CommType.h in Headers */,
   1.354 +			);
   1.355 +			runOnlyForDeploymentPostprocessing = 0;
   1.356 +		};
   1.357 +/* End PBXHeadersBuildPhase section */
   1.358 +
   1.359  /* Begin PBXNativeTarget section */
   1.360 -		352988A91AEF964100FA7E2E /* pEpObjCAdapter */ = {
   1.361 +		43E3985A221D7E56008E7983 /* PEPObjCAdapterFramework */ = {
   1.362  			isa = PBXNativeTarget;
   1.363 -			buildConfigurationList = 352988BE1AEF964100FA7E2E /* Build configuration list for PBXNativeTarget "pEpObjCAdapter" */;
   1.364 +			buildConfigurationList = 43E39860221D7E56008E7983 /* Build configuration list for PBXNativeTarget "PEPObjCAdapterFramework" */;
   1.365  			buildPhases = (
   1.366 -				352988A61AEF964100FA7E2E /* Sources */,
   1.367 -				352988A71AEF964100FA7E2E /* Frameworks */,
   1.368 -				352988A81AEF964100FA7E2E /* CopyFiles */,
   1.369 +				43E39856221D7E56008E7983 /* Headers */,
   1.370 +				43E39857221D7E56008E7983 /* Sources */,
   1.371 +				43E39858221D7E56008E7983 /* Frameworks */,
   1.372 +				43E39859221D7E56008E7983 /* Resources */,
   1.373  			);
   1.374  			buildRules = (
   1.375  			);
   1.376  			dependencies = (
   1.377 -				640F89481BE37C4F00B34B30 /* PBXTargetDependency */,
   1.378 -				64289E581B8B70FF00FC617B /* PBXTargetDependency */,
   1.379 +				43E39864221D7E9A008E7983 /* PBXTargetDependency */,
   1.380 +				43E39866221D7E9A008E7983 /* PBXTargetDependency */,
   1.381  			);
   1.382 -			name = pEpObjCAdapter;
   1.383 -			productName = pEpiOSAdapter;
   1.384 -			productReference = 352988AA1AEF964100FA7E2E /* libpEpObjCAdapter.a */;
   1.385 -			productType = "com.apple.product-type.library.static";
   1.386 +			name = PEPObjCAdapterFramework;
   1.387 +			productName = PEPObjCAdapterFramework;
   1.388 +			productReference = 43E3985B221D7E56008E7983 /* PEPObjCAdapterFramework.framework */;
   1.389 +			productType = "com.apple.product-type.framework";
   1.390  		};
   1.391  		64415E161BE94FCB00F6CBB2 /* pEpObjCAdapterTests */ = {
   1.392  			isa = PBXNativeTarget;
   1.393 @@ -410,7 +468,6 @@
   1.394  			);
   1.395  			dependencies = (
   1.396  				64415E401BE95B2000F6CBB2 /* PBXTargetDependency */,
   1.397 -				64415E1E1BE94FCB00F6CBB2 /* PBXTargetDependency */,
   1.398  			);
   1.399  			name = pEpObjCAdapterTests;
   1.400  			productName = iOSTests;
   1.401 @@ -427,8 +484,10 @@
   1.402  				LastUpgradeCheck = 0930;
   1.403  				ORGANIZATIONNAME = "p≡p";
   1.404  				TargetAttributes = {
   1.405 -					352988A91AEF964100FA7E2E = {
   1.406 -						CreatedOnToolsVersion = 6.3.1;
   1.407 +					43E3985A221D7E56008E7983 = {
   1.408 +						CreatedOnToolsVersion = 10.1;
   1.409 +						DevelopmentTeam = NQLYU6MGPN;
   1.410 +						ProvisioningStyle = Automatic;
   1.411  					};
   1.412  					64415E161BE94FCB00F6CBB2 = {
   1.413  						CreatedOnToolsVersion = 7.1;
   1.414 @@ -454,8 +513,8 @@
   1.415  			);
   1.416  			projectRoot = "";
   1.417  			targets = (
   1.418 -				352988A91AEF964100FA7E2E /* pEpObjCAdapter */,
   1.419  				64415E161BE94FCB00F6CBB2 /* pEpObjCAdapterTests */,
   1.420 +				43E3985A221D7E56008E7983 /* PEPObjCAdapterFramework */,
   1.421  			);
   1.422  		};
   1.423  /* End PBXProject section */
   1.424 @@ -478,6 +537,14 @@
   1.425  /* End PBXReferenceProxy section */
   1.426  
   1.427  /* Begin PBXResourcesBuildPhase section */
   1.428 +		43E39859221D7E56008E7983 /* Resources */ = {
   1.429 +			isa = PBXResourcesBuildPhase;
   1.430 +			buildActionMask = 2147483647;
   1.431 +			files = (
   1.432 +				437BEA9122328E570051E3A1 /* pEpTrustWords.bundle in Resources */,
   1.433 +			);
   1.434 +			runOnlyForDeploymentPostprocessing = 0;
   1.435 +		};
   1.436  		64415E151BE94FCB00F6CBB2 /* Resources */ = {
   1.437  			isa = PBXResourcesBuildPhase;
   1.438  			buildActionMask = 2147483647;
   1.439 @@ -509,32 +576,33 @@
   1.440  /* End PBXResourcesBuildPhase section */
   1.441  
   1.442  /* Begin PBXSourcesBuildPhase section */
   1.443 -		352988A61AEF964100FA7E2E /* Sources */ = {
   1.444 +		43E39857221D7E56008E7983 /* Sources */ = {
   1.445  			isa = PBXSourcesBuildPhase;
   1.446  			buildActionMask = 2147483647;
   1.447  			files = (
   1.448 -				1508AEAF1F8792AC001D5230 /* PEPCopyableThread.m in Sources */,
   1.449 -				15206CAA1F8BA183003FF880 /* PEPSessionProvider.m in Sources */,
   1.450 -				43209B411ECC2DB8007E7E2E /* PEPObjCAdapter.m in Sources */,
   1.451 -				43DED786203C25E200D45CD6 /* NSError+PEP.m in Sources */,
   1.452 -				433E28911FA741DE00E359B3 /* PEPIdentity.m in Sources */,
   1.453 -				43D27DE61F5DA7B700795687 /* NSDictionary+Extension.m in Sources */,
   1.454 -				435796E31FB5E51A00395A9E /* PEPMessage.m in Sources */,
   1.455 -				43209B431ECC2DC0007E7E2E /* PEPInternalSession.m in Sources */,
   1.456 -				43953B3520C91E2B001C7DDB /* NSDictionary+Debug.m in Sources */,
   1.457 -				43209B3F1ECC2DB0007E7E2E /* PEPLanguage.m in Sources */,
   1.458 -				434ED6D6207E27B8000A7590 /* PEPAutoPointer.m in Sources */,
   1.459 -				439D91A5208479EE003F6AC2 /* PEPAttachment.m in Sources */,
   1.460 -				439393E6208F375800EB1DBD /* NSObject+Extension.m in Sources */,
   1.461 -				43209B401ECC2DB4007E7E2E /* PEPMessageUtil.m in Sources */,
   1.462 -				43209B3D1ECC2DA7007E7E2E /* NSArray+Extension.m in Sources */,
   1.463 -				43209B3E1ECC2DAB007E7E2E /* PEPCSVScanner.m in Sources */,
   1.464 -				43F73BD42165F6EC00AB4524 /* PEPLock.m in Sources */,
   1.465 -				43209B421ECC2DBC007E7E2E /* PEPQueue.m in Sources */,
   1.466 -				435665CC2080A6CB00EC5B10 /* NSNumber+PEPRating.m in Sources */,
   1.467 -				439393F8208F5B5E00EB1DBD /* NSMutableDictionary+PEP.m in Sources */,
   1.468 -				43F73BEA2166248E00AB4524 /* PEPSync.m in Sources */,
   1.469 -				15206CC71F8E078B003FF880 /* PEPSession.m in Sources */,
   1.470 +				435F5170222046C2006EB11F /* NSDictionary+Debug.m in Sources */,
   1.471 +				435F5176222046C2006EB11F /* PEPAttachment.m in Sources */,
   1.472 +				435F5178222046C2006EB11F /* PEPAutoPointer.m in Sources */,
   1.473 +				435F516C222046C2006EB11F /* PEPObjCAdapter.m in Sources */,
   1.474 +				435F5177222046C2006EB11F /* NSError+PEP.m in Sources */,
   1.475 +				435F517B222046C2006EB11F /* NSMutableDictionary+PEP.m in Sources */,
   1.476 +				435F516A222046C2006EB11F /* PEPLanguage.m in Sources */,
   1.477 +				435F516F222046C2006EB11F /* NSDictionary+CommType.m in Sources */,
   1.478 +				435F5173222046C2006EB11F /* PEPSession.m in Sources */,
   1.479 +				435F5168222046C2006EB11F /* NSArray+Extension.m in Sources */,
   1.480 +				435F516E222046C2006EB11F /* PEPInternalSession.m in Sources */,
   1.481 +				435F5172222046C2006EB11F /* PEPSessionProvider.m in Sources */,
   1.482 +				435C0CAD222930340025C6B5 /* PEPConstants.m in Sources */,
   1.483 +				435F5169222046C2006EB11F /* PEPCSVScanner.m in Sources */,
   1.484 +				435F5179222046C2006EB11F /* NSNumber+PEPRating.m in Sources */,
   1.485 +				435F516B222046C2006EB11F /* PEPMessageUtil.m in Sources */,
   1.486 +				435F5171222046C2006EB11F /* PEPCopyableThread.m in Sources */,
   1.487 +				435F517C222046C2006EB11F /* PEPLock.m in Sources */,
   1.488 +				435F5175222046C2006EB11F /* PEPMessage.m in Sources */,
   1.489 +				435F5174222046C2006EB11F /* PEPIdentity.m in Sources */,
   1.490 +				435F517A222046C2006EB11F /* NSObject+Extension.m in Sources */,
   1.491 +				435F517D222046C2006EB11F /* PEPSync.m in Sources */,
   1.492 +				435F516D222046C2006EB11F /* PEPQueue.m in Sources */,
   1.493  			);
   1.494  			runOnlyForDeploymentPostprocessing = 0;
   1.495  		};
   1.496 @@ -555,20 +623,15 @@
   1.497  /* End PBXSourcesBuildPhase section */
   1.498  
   1.499  /* Begin PBXTargetDependency section */
   1.500 -		640F89481BE37C4F00B34B30 /* PBXTargetDependency */ = {
   1.501 +		43E39864221D7E9A008E7983 /* PBXTargetDependency */ = {
   1.502 +			isa = PBXTargetDependency;
   1.503 +			name = pEpEngine;
   1.504 +			targetProxy = 43E39863221D7E9A008E7983 /* PBXContainerItemProxy */;
   1.505 +		};
   1.506 +		43E39866221D7E9A008E7983 /* PBXTargetDependency */ = {
   1.507  			isa = PBXTargetDependency;
   1.508  			name = pEpTrustWords;
   1.509 -			targetProxy = 640F89471BE37C4F00B34B30 /* PBXContainerItemProxy */;
   1.510 -		};
   1.511 -		64289E581B8B70FF00FC617B /* PBXTargetDependency */ = {
   1.512 -			isa = PBXTargetDependency;
   1.513 -			name = pEpEngine;
   1.514 -			targetProxy = 64289E571B8B70FF00FC617B /* PBXContainerItemProxy */;
   1.515 -		};
   1.516 -		64415E1E1BE94FCB00F6CBB2 /* PBXTargetDependency */ = {
   1.517 -			isa = PBXTargetDependency;
   1.518 -			target = 352988A91AEF964100FA7E2E /* pEpObjCAdapter */;
   1.519 -			targetProxy = 64415E1D1BE94FCB00F6CBB2 /* PBXContainerItemProxy */;
   1.520 +			targetProxy = 43E39865221D7E9A008E7983 /* PBXContainerItemProxy */;
   1.521  		};
   1.522  		64415E401BE95B2000F6CBB2 /* PBXTargetDependency */ = {
   1.523  			isa = PBXTargetDependency;
   1.524 @@ -620,11 +683,12 @@
   1.525  				GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
   1.526  				GCC_WARN_UNUSED_FUNCTION = YES;
   1.527  				GCC_WARN_UNUSED_VARIABLE = YES;
   1.528 +				IPHONEOS_DEPLOYMENT_TARGET = 10.0;
   1.529  				MTL_ENABLE_DEBUG_INFO = YES;
   1.530  				ONLY_ACTIVE_ARCH = YES;
   1.531  				SDKROOT = iphoneos;
   1.532  				SKIP_INSTALL = YES;
   1.533 -				VALID_ARCHS = "arm64 armv7 armv7s";
   1.534 +				VALID_ARCHS = "$(inherited)";
   1.535  			};
   1.536  			name = Debug;
   1.537  		};
   1.538 @@ -665,63 +729,86 @@
   1.539  				GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
   1.540  				GCC_WARN_UNUSED_FUNCTION = YES;
   1.541  				GCC_WARN_UNUSED_VARIABLE = YES;
   1.542 +				IPHONEOS_DEPLOYMENT_TARGET = 10.0;
   1.543  				MTL_ENABLE_DEBUG_INFO = NO;
   1.544  				ONLY_ACTIVE_ARCH = NO;
   1.545  				SDKROOT = iphoneos;
   1.546  				SKIP_INSTALL = YES;
   1.547  				VALIDATE_PRODUCT = YES;
   1.548 -				VALID_ARCHS = "arm64 armv7 armv7s";
   1.549 +				VALID_ARCHS = "$(inherited)";
   1.550  			};
   1.551  			name = Release;
   1.552  		};
   1.553 -		352988BF1AEF964100FA7E2E /* Debug */ = {
   1.554 +		43E39861221D7E56008E7983 /* Debug */ = {
   1.555  			isa = XCBuildConfiguration;
   1.556  			buildSettings = {
   1.557 -				HEADER_SEARCH_PATHS = "";
   1.558 -				IPHONEOS_DEPLOYMENT_TARGET = 8.0;
   1.559 -				ONLY_ACTIVE_ARCH = NO;
   1.560 -				OTHER_LDFLAGS = (
   1.561 -					"-letpan-ios",
   1.562 -					"-lxml2",
   1.563 -					"-lsasl2",
   1.564 -					"-liconv",
   1.565 -					"-ltidy",
   1.566 -					"-lz",
   1.567 -					"-lstdc++",
   1.568 -					"-lresolv",
   1.569 -					"-stdlib=libc++",
   1.570 -					"-ObjC",
   1.571 -				);
   1.572 -				PRODUCT_NAME = "$(TARGET_NAME)";
   1.573 +				CLANG_ANALYZER_NONNULL = YES;
   1.574 +				CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
   1.575 +				CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
   1.576 +				CLANG_CXX_LIBRARY = "libc++";
   1.577 +				CLANG_ENABLE_OBJC_WEAK = YES;
   1.578 +				CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
   1.579 +				CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
   1.580 +				CODE_SIGN_IDENTITY = "iPhone Developer";
   1.581 +				CODE_SIGN_STYLE = Automatic;
   1.582 +				CURRENT_PROJECT_VERSION = 1;
   1.583 +				DEBUG_INFORMATION_FORMAT = dwarf;
   1.584 +				DEFINES_MODULE = YES;
   1.585 +				DEVELOPMENT_TEAM = NQLYU6MGPN;
   1.586 +				DYLIB_COMPATIBILITY_VERSION = 1;
   1.587 +				DYLIB_CURRENT_VERSION = 1;
   1.588 +				DYLIB_INSTALL_NAME_BASE = "@rpath";
   1.589 +				GCC_C_LANGUAGE_STANDARD = gnu11;
   1.590 +				GCC_DYNAMIC_NO_PIC = NO;
   1.591 +				INFOPLIST_FILE = PEPObjCAdapterFramework/Info.plist;
   1.592 +				INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
   1.593 +				IPHONEOS_DEPLOYMENT_TARGET = 10.0;
   1.594 +				LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
   1.595 +				MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
   1.596 +				MTL_FAST_MATH = YES;
   1.597 +				PRODUCT_BUNDLE_IDENTIFIER = security.pEp.app.framework.PEPObjCAdapterFramework;
   1.598 +				PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
   1.599  				SKIP_INSTALL = YES;
   1.600 -				STRIP_INSTALLED_PRODUCT = NO;
   1.601 -				USER_HEADER_SEARCH_PATHS = "$(PROJECT_DIR)/../pEpEngine/src/";
   1.602 -				USE_HEADERMAP = NO;
   1.603 +				TARGETED_DEVICE_FAMILY = "1,2";
   1.604 +				USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/../pEpEngine/src";
   1.605 +				VALID_ARCHS = "$(inherited)";
   1.606 +				VERSIONING_SYSTEM = "apple-generic";
   1.607 +				VERSION_INFO_PREFIX = "";
   1.608  			};
   1.609  			name = Debug;
   1.610  		};
   1.611 -		352988C01AEF964100FA7E2E /* Release */ = {
   1.612 +		43E39862221D7E56008E7983 /* Release */ = {
   1.613  			isa = XCBuildConfiguration;
   1.614  			buildSettings = {
   1.615 -				HEADER_SEARCH_PATHS = "";
   1.616 -				IPHONEOS_DEPLOYMENT_TARGET = 8.0;
   1.617 -				OTHER_LDFLAGS = (
   1.618 -					"-letpan-ios",
   1.619 -					"-lxml2",
   1.620 -					"-lsasl2",
   1.621 -					"-liconv",
   1.622 -					"-ltidy",
   1.623 -					"-lz",
   1.624 -					"-lstdc++",
   1.625 -					"-lresolv",
   1.626 -					"-stdlib=libc++",
   1.627 -					"-ObjC",
   1.628 -				);
   1.629 -				PRODUCT_NAME = "$(TARGET_NAME)";
   1.630 +				CLANG_ANALYZER_NONNULL = YES;
   1.631 +				CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
   1.632 +				CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
   1.633 +				CLANG_CXX_LIBRARY = "libc++";
   1.634 +				CLANG_ENABLE_OBJC_WEAK = YES;
   1.635 +				CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
   1.636 +				CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
   1.637 +				CODE_SIGN_IDENTITY = "iPhone Developer";
   1.638 +				CODE_SIGN_STYLE = Automatic;
   1.639 +				CURRENT_PROJECT_VERSION = 1;
   1.640 +				DEFINES_MODULE = YES;
   1.641 +				DEVELOPMENT_TEAM = NQLYU6MGPN;
   1.642 +				DYLIB_COMPATIBILITY_VERSION = 1;
   1.643 +				DYLIB_CURRENT_VERSION = 1;
   1.644 +				DYLIB_INSTALL_NAME_BASE = "@rpath";
   1.645 +				GCC_C_LANGUAGE_STANDARD = gnu11;
   1.646 +				INFOPLIST_FILE = PEPObjCAdapterFramework/Info.plist;
   1.647 +				INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
   1.648 +				IPHONEOS_DEPLOYMENT_TARGET = 10.0;
   1.649 +				LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
   1.650 +				MTL_FAST_MATH = YES;
   1.651 +				PRODUCT_BUNDLE_IDENTIFIER = security.pEp.app.framework.PEPObjCAdapterFramework;
   1.652 +				PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
   1.653  				SKIP_INSTALL = YES;
   1.654 -				STRIP_INSTALLED_PRODUCT = NO;
   1.655 -				USER_HEADER_SEARCH_PATHS = "$(PROJECT_DIR)/../pEpEngine/src/";
   1.656 -				USE_HEADERMAP = NO;
   1.657 +				TARGETED_DEVICE_FAMILY = "1,2";
   1.658 +				USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/../pEpEngine/src";
   1.659 +				VALID_ARCHS = "$(inherited)";
   1.660 +				VERSIONING_SYSTEM = "apple-generic";
   1.661 +				VERSION_INFO_PREFIX = "";
   1.662  			};
   1.663  			name = Release;
   1.664  		};
   1.665 @@ -799,11 +886,11 @@
   1.666  			defaultConfigurationIsVisible = 0;
   1.667  			defaultConfigurationName = Release;
   1.668  		};
   1.669 -		352988BE1AEF964100FA7E2E /* Build configuration list for PBXNativeTarget "pEpObjCAdapter" */ = {
   1.670 +		43E39860221D7E56008E7983 /* Build configuration list for PBXNativeTarget "PEPObjCAdapterFramework" */ = {
   1.671  			isa = XCConfigurationList;
   1.672  			buildConfigurations = (
   1.673 -				352988BF1AEF964100FA7E2E /* Debug */,
   1.674 -				352988C01AEF964100FA7E2E /* Release */,
   1.675 +				43E39861221D7E56008E7983 /* Debug */,
   1.676 +				43E39862221D7E56008E7983 /* Release */,
   1.677  			);
   1.678  			defaultConfigurationIsVisible = 0;
   1.679  			defaultConfigurationName = Release;
     2.1 --- a/pEpObjCAdapter.xcodeproj/xcshareddata/xcschemes/pEpObjCAdapter.xcscheme	Wed Feb 20 09:18:34 2019 +0100
     2.2 +++ b/pEpObjCAdapter.xcodeproj/xcshareddata/xcschemes/pEpObjCAdapter.xcscheme	Thu Mar 21 12:37:32 2019 +0100
     2.3 @@ -1,6 +1,6 @@
     2.4  <?xml version="1.0" encoding="UTF-8"?>
     2.5  <Scheme
     2.6 -   LastUpgradeVersion = "0940"
     2.7 +   LastUpgradeVersion = "1010"
     2.8     version = "1.3">
     2.9     <BuildAction
    2.10        parallelizeBuildables = "YES"
     3.1 --- a/pEpObjCAdapter.xcodeproj/xcshareddata/xcschemes/pEpObjCAdapterTests.xcscheme	Wed Feb 20 09:18:34 2019 +0100
     3.2 +++ b/pEpObjCAdapter.xcodeproj/xcshareddata/xcschemes/pEpObjCAdapterTests.xcscheme	Thu Mar 21 12:37:32 2019 +0100
     3.3 @@ -1,6 +1,6 @@
     3.4  <?xml version="1.0" encoding="UTF-8"?>
     3.5  <Scheme
     3.6 -   LastUpgradeVersion = "0940"
     3.7 +   LastUpgradeVersion = "1010"
     3.8     version = "1.3">
     3.9     <BuildAction
    3.10        parallelizeBuildables = "YES"
     4.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.2 +++ b/pEpObjCAdapter/NSDictionary+CommType.m	Thu Mar 21 12:37:32 2019 +0100
     4.3 @@ -0,0 +1,28 @@
     4.4 +//
     4.5 +//  NSDictionary+CommType.m
     4.6 +//  pEpObjCAdapter
     4.7 +//
     4.8 +//  Created by Dirk Zimmermann on 04.09.17.
     4.9 +//  Copyright © 2017 p≡p. All rights reserved.
    4.10 +//
    4.11 +
    4.12 +#import <Foundation/Foundation.h>
    4.13 +
    4.14 +#import "NSDictionary+CommType.h"
    4.15 +
    4.16 +#import "PEPConstants.h"
    4.17 +
    4.18 +#import "PEPMessageUtil.h"
    4.19 +
    4.20 +@implementation NSDictionary (CommType)
    4.21 +
    4.22 +- (PEP_comm_type)commType
    4.23 +{
    4.24 +    NSNumber *ctNum = self[kPepCommType];
    4.25 +    if (!ctNum) {
    4.26 +        return PEP_ct_unknown;
    4.27 +    }
    4.28 +    return ctNum.intValue;
    4.29 +}
    4.30 +
    4.31 +@end
     5.1 --- a/pEpObjCAdapter/NSDictionary+Debug.m	Wed Feb 20 09:18:34 2019 +0100
     5.2 +++ b/pEpObjCAdapter/NSDictionary+Debug.m	Thu Mar 21 12:37:32 2019 +0100
     5.3 @@ -8,6 +8,8 @@
     5.4  
     5.5  #import "NSDictionary+Debug.h"
     5.6  
     5.7 +#import "PEPConstants.h"
     5.8 +
     5.9  #import "PEPMessageUtil.h"
    5.10  
    5.11  @implementation NSDictionary (Debug)
     6.1 --- a/pEpObjCAdapter/NSDictionary+Extension.h	Wed Feb 20 09:18:34 2019 +0100
     6.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     6.3 @@ -1,21 +0,0 @@
     6.4 -//
     6.5 -//  NSDictionary_NSDictionary_Extension.h
     6.6 -//  pEpObjCAdapter
     6.7 -//
     6.8 -//  Created by Dirk Zimmermann on 04.09.17.
     6.9 -//  Copyright © 2017 p≡p. All rights reserved.
    6.10 -//
    6.11 -
    6.12 -#import <Foundation/Foundation.h>
    6.13 -
    6.14 -#import "pEpEngine.h"
    6.15 -
    6.16 -@interface NSDictionary (Extension)
    6.17 -
    6.18 -/**
    6.19 - If we interpret the self as a dictionary denoting a p≡p Identity,
    6.20 - does the comm type denote a PGP user?
    6.21 - */
    6.22 -@property (nonatomic, readonly) PEP_comm_type commType;
    6.23 -
    6.24 -@end
     7.1 --- a/pEpObjCAdapter/NSDictionary+Extension.m	Wed Feb 20 09:18:34 2019 +0100
     7.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     7.3 @@ -1,26 +0,0 @@
     7.4 -//
     7.5 -//  NSDictionary+Extension.m
     7.6 -//  pEpObjCAdapter
     7.7 -//
     7.8 -//  Created by Dirk Zimmermann on 04.09.17.
     7.9 -//  Copyright © 2017 p≡p. All rights reserved.
    7.10 -//
    7.11 -
    7.12 -#import <Foundation/Foundation.h>
    7.13 -
    7.14 -#import "NSDictionary+Extension.h"
    7.15 -
    7.16 -#import "PEPMessageUtil.h"
    7.17 -
    7.18 -@implementation NSDictionary (Extension)
    7.19 -
    7.20 -- (PEP_comm_type)commType
    7.21 -{
    7.22 -    NSNumber *ctNum = self[kPepCommType];
    7.23 -    if (!ctNum) {
    7.24 -        return PEP_ct_unknown;
    7.25 -    }
    7.26 -    return ctNum.intValue;
    7.27 -}
    7.28 -
    7.29 -@end
     8.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     8.2 +++ b/pEpObjCAdapter/NSError+PEP+Internal.h	Thu Mar 21 12:37:32 2019 +0100
     8.3 @@ -0,0 +1,43 @@
     8.4 +//
     8.5 +//  NSError+PEP+Internal.h
     8.6 +//  pEpObjCAdapter
     8.7 +//
     8.8 +//  Created by Dirk Zimmermann on 28.02.19.
     8.9 +//  Copyright © 2019 p≡p. All rights reserved.
    8.10 +//
    8.11 +
    8.12 +#ifndef NSError_PEP_Internal_h
    8.13 +#define NSError_PEP_Internal_h
    8.14 +
    8.15 +#import "PEPEngineTypes.h"
    8.16 +
    8.17 +/**
    8.18 + Extension for creating `NSError`s from `PEP_STATUS`
    8.19 + */
    8.20 +@interface NSError (Internal)
    8.21 +
    8.22 ++ (NSError * _Nonnull)errorWithPEPStatus:(PEPStatus)status
    8.23 +                                userInfo:(NSDictionary<NSErrorUserInfoKey, id> * _Nonnull)dict;
    8.24 +
    8.25 ++ (NSError * _Nonnull)errorWithPEPStatus:(PEPStatus)status;
    8.26 +
    8.27 ++ (NSError * _Nonnull)errorWithPEPStatusInternal:(PEP_STATUS)status
    8.28 +                                        userInfo:(NSDictionary<NSErrorUserInfoKey, id> * _Nonnull)dict;
    8.29 +
    8.30 ++ (NSError * _Nonnull)errorWithPEPStatusInternal:(PEP_STATUS)status;
    8.31 +
    8.32 +/**
    8.33 + If the given status indicates an error, tries to set the given error accordingly.
    8.34 + @return YES if the given status indicates an error condition, NO otherwise.
    8.35 + */
    8.36 ++ (BOOL)setError:(NSError * _Nullable * _Nullable)error fromPEPStatusInternal:(PEP_STATUS)status;
    8.37 +
    8.38 +/**
    8.39 + If the given status indicates an error, tries to set the given error accordingly.
    8.40 + @return YES if the given status indicates an error condition, NO otherwise.
    8.41 + */
    8.42 ++ (BOOL)setError:(NSError * _Nullable * _Nullable)error fromPEPStatus:(PEPStatus)status;
    8.43 +
    8.44 +@end
    8.45 +
    8.46 +#endif /* NSError_PEP_Internal_h */
     9.1 --- a/pEpObjCAdapter/NSError+PEP.h	Wed Feb 20 09:18:34 2019 +0100
     9.2 +++ b/pEpObjCAdapter/NSError+PEP.h	Thu Mar 21 12:37:32 2019 +0100
     9.3 @@ -15,17 +15,6 @@
     9.4   */
     9.5  @interface NSError (Extension)
     9.6  
     9.7 -+ (NSError * _Nonnull)errorWithPEPStatus:(PEP_STATUS)status
     9.8 -                       userInfo:(NSDictionary<NSErrorUserInfoKey, id> * _Nonnull)dict;
     9.9 -
    9.10 -+ (NSError * _Nonnull)errorWithPEPStatus:(PEP_STATUS)status;
    9.11 -
    9.12 -/**
    9.13 - If the given status indicates an error, tries to set the given error accordingly.
    9.14 - @return YES if the given status indicates an error condition, NO otherwise.
    9.15 - */
    9.16 -+ (BOOL)setError:(NSError * _Nullable * _Nullable)error fromPEPStatus:(PEP_STATUS)status;
    9.17 -
    9.18  /**
    9.19   A possible string representation of the error code if this is a pEp error.
    9.20   @return A string representation of the pEp error code, if it's in the pEp domain.
    10.1 --- a/pEpObjCAdapter/NSError+PEP.m	Wed Feb 20 09:18:34 2019 +0100
    10.2 +++ b/pEpObjCAdapter/NSError+PEP.m	Thu Mar 21 12:37:32 2019 +0100
    10.3 @@ -6,14 +6,17 @@
    10.4  //  Copyright © 2018 p≡p. All rights reserved.
    10.5  //
    10.6  
    10.7 +#import "PEPTypes.h"
    10.8 +
    10.9  #import "NSError+PEP.h"
   10.10 +#import "NSError+PEP+Internal.h"
   10.11  
   10.12  static NSString *s_pEpAdapterDomain = @"security.pEp.ObjCAdapter";
   10.13  
   10.14  @implementation NSError (Extension)
   10.15  
   10.16 -+ (NSError * _Nonnull)errorWithPEPStatus:(PEP_STATUS)status
   10.17 -                                userInfo:(NSDictionary<NSErrorUserInfoKey, id> * _Nonnull)dict
   10.18 ++ (NSError * _Nonnull)errorWithPEPStatusInternal:(PEP_STATUS)status
   10.19 +                                        userInfo:(NSDictionary<NSErrorUserInfoKey, id> * _Nonnull)dict
   10.20  {
   10.21      switch (status) {
   10.22          case PEP_STATUS_OK:
   10.23 @@ -36,15 +39,15 @@
   10.24      }
   10.25  }
   10.26  
   10.27 -+ (NSError * _Nonnull)errorWithPEPStatus:(PEP_STATUS)status
   10.28 ++ (NSError * _Nonnull)errorWithPEPStatusInternal:(PEP_STATUS)status
   10.29  {
   10.30      NSDictionary *userInfo = [NSDictionary new];
   10.31 -    return [self errorWithPEPStatus:status userInfo:userInfo];
   10.32 +    return [self errorWithPEPStatusInternal:status userInfo:userInfo];
   10.33  }
   10.34  
   10.35  + (BOOL)setError:(NSError * _Nullable * _Nullable)error fromPEPStatus:(PEP_STATUS)status
   10.36  {
   10.37 -    NSError *theError = [self errorWithPEPStatus:status];
   10.38 +    NSError *theError = [self errorWithPEPStatusInternal:status];
   10.39      if (theError) {
   10.40          if (error) {
   10.41              *error = theError;
   10.42 @@ -156,4 +159,15 @@
   10.43      }
   10.44  }
   10.45  
   10.46 ++ (NSError * _Nonnull)errorWithPEPStatus:(PEPStatus)status
   10.47 +                                userInfo:(NSDictionary<NSErrorUserInfoKey, id> * _Nonnull)dict
   10.48 +{
   10.49 +    return [self errorWithPEPStatusInternal:(PEP_STATUS) status userInfo:dict];
   10.50 +}
   10.51 +
   10.52 ++ (NSError * _Nonnull)errorWithPEPStatus:(PEPStatus)status
   10.53 +{
   10.54 +    return [self errorWithPEPStatusInternal:(PEP_STATUS) status userInfo:[NSDictionary new]];
   10.55 +}
   10.56 +
   10.57  @end
    11.1 --- a/pEpObjCAdapter/NSMutableDictionary+PEP.m	Wed Feb 20 09:18:34 2019 +0100
    11.2 +++ b/pEpObjCAdapter/NSMutableDictionary+PEP.m	Thu Mar 21 12:37:32 2019 +0100
    11.3 @@ -8,6 +8,8 @@
    11.4  
    11.5  #import "NSMutableDictionary+PEP.h"
    11.6  
    11.7 +#import "PEPConstants.h"
    11.8 +
    11.9  #import "PEPMessageUtil.h"
   11.10  
   11.11  void replaceDictionaryContentsWithMessage(NSMutableDictionary *dict, message *message)
    12.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    12.2 +++ b/pEpObjCAdapter/NSNumber+PEPRating+Internal.h	Thu Mar 21 12:37:32 2019 +0100
    12.3 @@ -0,0 +1,29 @@
    12.4 +//
    12.5 +//  NSNumber+PEPRating+Internal.h
    12.6 +//  pEpObjCAdapter
    12.7 +//
    12.8 +//  Created by Dirk Zimmermann on 28.02.19.
    12.9 +//  Copyright © 2019 p≡p. All rights reserved.
   12.10 +//
   12.11 +
   12.12 +#ifndef NSNumber_PEPRating_Internal_h
   12.13 +#define NSNumber_PEPRating_Internal_h
   12.14 +
   12.15 +#import <Foundation/Foundation.h>
   12.16 +
   12.17 +#import "message_api.h"
   12.18 +
   12.19 +/**
   12.20 + Extension for wrapping the engine's PEP_rating inside a NSNumber.
   12.21 + */
   12.22 +@interface NSNumber (Internal)
   12.23 +
   12.24 +@property (nonatomic, readonly) PEP_rating pEpRatingInternal;
   12.25 +
   12.26 +- initWithPEPRatingInternal:(PEP_rating)pEpRating;
   12.27 +
   12.28 ++ (NSNumber *)numberWithPEPRatingInternal:(PEP_rating)pEpRating;
   12.29 +
   12.30 +@end
   12.31 +
   12.32 +#endif /* NSNumber_PEPRating_Internal_h */
    13.1 --- a/pEpObjCAdapter/NSNumber+PEPRating.h	Wed Feb 20 09:18:34 2019 +0100
    13.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    13.3 @@ -1,24 +0,0 @@
    13.4 -//
    13.5 -//  NSNumber+PEPRating.h
    13.6 -//  pEpObjCAdapter
    13.7 -//
    13.8 -//  Created by Dirk Zimmermann on 13.04.18.
    13.9 -//  Copyright © 2018 p≡p. All rights reserved.
   13.10 -//
   13.11 -
   13.12 -#import <Foundation/Foundation.h>
   13.13 -
   13.14 -#import "message_api.h"
   13.15 -
   13.16 -/**
   13.17 - Extension for wrapping the engine's PEP_rating inside a NSNumber.
   13.18 - */
   13.19 -@interface NSNumber (Extension)
   13.20 -
   13.21 -@property (nonatomic) PEP_rating pEpRating;
   13.22 -
   13.23 -- initWithPEPRating:(PEP_rating)pEpRating;
   13.24 -
   13.25 -+ (NSNumber *)numberWithPEPRating:(PEP_rating)pEpRating;
   13.26 -
   13.27 -@end
    14.1 --- a/pEpObjCAdapter/NSNumber+PEPRating.m	Wed Feb 20 09:18:34 2019 +0100
    14.2 +++ b/pEpObjCAdapter/NSNumber+PEPRating.m	Thu Mar 21 12:37:32 2019 +0100
    14.3 @@ -8,21 +8,38 @@
    14.4  
    14.5  #import "NSNumber+PEPRating.h"
    14.6  
    14.7 +#import "message_api.h"
    14.8 +
    14.9  @implementation NSNumber (Extension)
   14.10  
   14.11 -- initWithPEPRating:(PEP_rating)pEpRating
   14.12 +- initWithPEPRating:(PEPRating)pEpRating
   14.13  {
   14.14      return [self initWithInt:pEpRating];
   14.15  }
   14.16  
   14.17 -- (PEP_rating)pEpRating
   14.18 +- initWithPEPRatingInternal:(PEP_rating)pEpRating
   14.19 +{
   14.20 +    return [self initWithInt:pEpRating];
   14.21 +}
   14.22 +
   14.23 +- (PEPRating)pEpRating
   14.24  {
   14.25      return self.intValue;
   14.26  }
   14.27  
   14.28 -+ (NSNumber *)numberWithPEPRating:(PEP_rating)pEpRating
   14.29 +- (PEP_rating)pEpRatingInternal
   14.30 +{
   14.31 +    return self.intValue;
   14.32 +}
   14.33 +
   14.34 ++ (NSNumber *)numberWithPEPRating:(PEPRating)pEpRating
   14.35  {
   14.36      return [[NSNumber alloc] initWithPEPRating:pEpRating];
   14.37  }
   14.38  
   14.39 ++ (NSNumber *)numberWithPEPRatingInternal:(PEP_rating)pEpRating
   14.40 +{
   14.41 +    return [[NSNumber alloc] initWithPEPRatingInternal:pEpRating];
   14.42 +}
   14.43 +
   14.44  @end
    15.1 --- a/pEpObjCAdapter/PEPAttachment.h	Wed Feb 20 09:18:34 2019 +0100
    15.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    15.3 @@ -1,23 +0,0 @@
    15.4 -//
    15.5 -//  PEPAttachment.h
    15.6 -//  pEpObjCAdapter
    15.7 -//
    15.8 -//  Created by Dirk Zimmermann on 16.04.18.
    15.9 -//  Copyright © 2018 p≡p. All rights reserved.
   15.10 -//
   15.11 -
   15.12 -#import <Foundation/Foundation.h>
   15.13 -
   15.14 -#import "bloblist.h"
   15.15 -
   15.16 -@interface PEPAttachment : NSObject
   15.17 -
   15.18 -@property (nonatomic) NSData *data;
   15.19 -@property (nonatomic) NSInteger size;
   15.20 -@property (nonatomic, nullable) NSString *mimeType;
   15.21 -@property (nonatomic, nullable) NSString *filename;
   15.22 -@property (nonatomic) content_disposition_type contentDisposition;
   15.23 -
   15.24 -- (_Nonnull instancetype)initWithData:(NSData *)data;
   15.25 -
   15.26 -@end
    16.1 --- a/pEpObjCAdapter/PEPAttachment.m	Wed Feb 20 09:18:34 2019 +0100
    16.2 +++ b/pEpObjCAdapter/PEPAttachment.m	Thu Mar 21 12:37:32 2019 +0100
    16.3 @@ -8,6 +8,8 @@
    16.4  
    16.5  #import "PEPAttachment.h"
    16.6  
    16.7 +#import "bloblist.h"
    16.8 +
    16.9  @implementation PEPAttachment
   16.10  
   16.11  - (instancetype)initWithData:(NSData *)data
    17.1 --- a/pEpObjCAdapter/PEPIdentity.h	Wed Feb 20 09:18:34 2019 +0100
    17.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    17.3 @@ -1,108 +0,0 @@
    17.4 -//
    17.5 -//  PEPIdentity.h
    17.6 -//  pEpObjCAdapter
    17.7 -//
    17.8 -//  Created by Dirk Zimmermann on 30.10.17.
    17.9 -//  Copyright © 2017 p≡p. All rights reserved.
   17.10 -//
   17.11 -
   17.12 -#import <Foundation/Foundation.h>
   17.13 -
   17.14 -#import "PEPSessionProtocol.h"
   17.15 -
   17.16 -@class PEPSession;
   17.17 -
   17.18 -@interface PEPIdentity : NSObject <NSMutableCopying>
   17.19 -
   17.20 -/**
   17.21 - The network address of this identity
   17.22 - */
   17.23 -@property (nonatomic, nonnull) NSString *address;
   17.24 -
   17.25 -/**
   17.26 - The (optional) user ID.
   17.27 - */
   17.28 -@property (nonatomic, nullable) NSString *userID;
   17.29 -
   17.30 -/**
   17.31 - The (optional) user name.
   17.32 - */
   17.33 -@property (nonatomic, nullable) NSString *userName;
   17.34 -
   17.35 -/**
   17.36 - The (optional) fingerprint.
   17.37 - */
   17.38 -@property (nonatomic, nullable) NSString *fingerPrint;
   17.39 -
   17.40 -/**
   17.41 - The (optional) language that this identity uses.
   17.42 - */
   17.43 -@property (nonatomic, nullable) NSString *language;
   17.44 -
   17.45 -/**
   17.46 - The comm type of this identity.
   17.47 - */
   17.48 -@property PEP_comm_type commType;
   17.49 -
   17.50 -/**
   17.51 - Is this one of our own identities?
   17.52 - */
   17.53 -@property BOOL isOwn;
   17.54 -
   17.55 -/**
   17.56 - Comm type contains the PEP_ct_confirmed flag?
   17.57 - */
   17.58 -@property (readonly) BOOL isConfirmed;
   17.59 -
   17.60 -- (nonnull instancetype)initWithAddress:(NSString * _Nonnull)address
   17.61 -                                 userID:(NSString * _Nullable)userID
   17.62 -                               userName:(NSString * _Nullable)userName
   17.63 -                                  isOwn:(BOOL)isOwn
   17.64 -                            fingerPrint:(NSString * _Nullable)fingerPrint
   17.65 -                               commType:(PEP_comm_type)commType
   17.66 -                               language:(NSString * _Nullable)language;
   17.67 -
   17.68 -- (nonnull instancetype)initWithAddress:(NSString * _Nonnull)address
   17.69 -                                 userID:(NSString * _Nullable)userID
   17.70 -                               userName:(NSString * _Nullable)userName
   17.71 -                                  isOwn:(BOOL)isOwn
   17.72 -                            fingerPrint:(NSString * _Nullable)fingerPrint;
   17.73 -
   17.74 -- (nonnull instancetype)initWithAddress:(NSString * _Nonnull)address
   17.75 -                                 userID:(NSString * _Nullable)userID
   17.76 -                               userName:(NSString * _Nullable)userName
   17.77 -                                  isOwn:(BOOL)isOwn;
   17.78 -
   17.79 -- (nonnull instancetype)initWithAddress:(NSString * _Nonnull)address;
   17.80 -
   17.81 -- (nonnull instancetype)initWithDictionary:(NSDictionary * _Nonnull)dictionary;
   17.82 -
   17.83 -/**
   17.84 - Copy constructor.
   17.85 - */
   17.86 -- (nonnull instancetype)initWithIdentity:(PEPIdentity * _Nonnull)identity;
   17.87 -
   17.88 -/**
   17.89 - This method should be removed once the adapter fully supports objects for identity
   17.90 - and message types insead of dictionaries.
   17.91 - */
   17.92 -- (PEPDict * _Nonnull)dictionary;
   17.93 -
   17.94 -/**
   17.95 - This method should be removed once the adapter fully supports objects for identity
   17.96 - and message types insead of dictionaries.
   17.97 - */
   17.98 -- (PEPMutableDict * _Nonnull)mutableDictionary;
   17.99 -
  17.100 -/**
  17.101 - Is the given identity a pEp user, from the engine's point of view?
  17.102 - */
  17.103 -- (NSNumber * _Nullable)isPEPUser:(PEPSession * _Nullable)session
  17.104 -                            error:(NSError * _Nullable * _Nullable)error;
  17.105 -
  17.106 -/**
  17.107 - Puts all properties into a default/nil state.
  17.108 - */
  17.109 -- (void)reset;
  17.110 -
  17.111 -@end
    18.1 --- a/pEpObjCAdapter/PEPIdentity.m	Wed Feb 20 09:18:34 2019 +0100
    18.2 +++ b/pEpObjCAdapter/PEPIdentity.m	Thu Mar 21 12:37:32 2019 +0100
    18.3 @@ -7,6 +7,7 @@
    18.4  //
    18.5  
    18.6  #import "PEPIdentity.h"
    18.7 +#import "PEPConstants.h"
    18.8  
    18.9  #import "pEpEngine.h"
   18.10  #import "PEPMessageUtil.h"
   18.11 @@ -21,7 +22,7 @@
   18.12                                 userName:(NSString * _Nullable)userName
   18.13                                    isOwn:(BOOL)isOwn
   18.14                              fingerPrint:(NSString * _Nullable)fingerPrint
   18.15 -                               commType:(PEP_comm_type)commType
   18.16 +                               commType:(PEPCommType)commType
   18.17                                 language:(NSString * _Nullable)language {
   18.18      if (self = [super init]) {
   18.19          self.address = address;
    19.1 --- a/pEpObjCAdapter/PEPInternalSession.h	Wed Feb 20 09:18:34 2019 +0100
    19.2 +++ b/pEpObjCAdapter/PEPInternalSession.h	Thu Mar 21 12:37:32 2019 +0100
    19.3 @@ -8,6 +8,10 @@
    19.4  
    19.5  #import <Foundation/Foundation.h>
    19.6  
    19.7 +#import "PEPSessionProtocol.h"
    19.8 +
    19.9 +#import "sync_api.h"
   19.10 +
   19.11  #import "PEPObjCAdapter.h"
   19.12  
   19.13  /**
    20.1 --- a/pEpObjCAdapter/PEPInternalSession.m	Wed Feb 20 09:18:34 2019 +0100
    20.2 +++ b/pEpObjCAdapter/PEPInternalSession.m	Thu Mar 21 12:37:32 2019 +0100
    20.3 @@ -7,17 +7,20 @@
    20.4  //
    20.5  
    20.6  #import "PEPInternalSession.h"
    20.7 +
    20.8 +#import "PEPConstants.h"
    20.9 +
   20.10  #import "PEPObjCAdapter.h"
   20.11  #import "PEPObjCAdapter+Internal.h"
   20.12  #import "PEPMessageUtil.h"
   20.13  #import "PEPLanguage.h"
   20.14  #import "PEPCSVScanner.h"
   20.15  #import "NSArray+Extension.h"
   20.16 -#import "NSDictionary+Extension.h"
   20.17 +#import "NSDictionary+CommType.h"
   20.18  #import "NSDictionary+Debug.h"
   20.19  #import "PEPIdentity.h"
   20.20  #import "PEPMessage.h"
   20.21 -#import "NSError+PEP.h"
   20.22 +#import "NSError+PEP+Internal.h"
   20.23  #import "PEPAutoPointer.h"
   20.24  #import "NSNumber+PEPRating.h"
   20.25  #import "NSMutableDictionary+PEP.h"
   20.26 @@ -103,20 +106,20 @@
   20.27  }
   20.28  
   20.29  - (PEPDict * _Nullable)decryptMessageDict:(PEPMutableDict * _Nonnull)messageDict
   20.30 -                                    flags:(PEP_decrypt_flags * _Nullable)flags
   20.31 -                                   rating:(PEP_rating * _Nullable)rating
   20.32 +                                    flags:(PEPDecryptFlags * _Nullable)flags
   20.33 +                                   rating:(PEPRating * _Nullable)rating
   20.34                                  extraKeys:(PEPStringList * _Nullable * _Nullable)extraKeys
   20.35 -                                   status:(PEP_STATUS * _Nullable)status
   20.36 +                                   status:(PEPStatus * _Nullable)status
   20.37                                      error:(NSError * _Nullable * _Nullable)error
   20.38  {
   20.39      if (rating) {
   20.40 -        *rating = PEP_rating_undefined;
   20.41 +        *rating = PEPRatingUndefined;
   20.42      }
   20.43  
   20.44      message *_src = PEP_messageDictToStruct(messageDict);
   20.45      message *_dst = NULL;
   20.46      stringlist_t *theKeys = NULL;
   20.47 -    PEP_decrypt_flags theFlags = 0;
   20.48 +    PEPDecryptFlags theFlags = 0;
   20.49  
   20.50      if (flags) {
   20.51          theFlags = *flags;
   20.52 @@ -126,15 +129,15 @@
   20.53          theKeys = PEP_arrayToStringlist(*extraKeys);
   20.54      }
   20.55  
   20.56 -    PEP_rating internalRating = PEP_rating_undefined;
   20.57 +    PEPRating internalRating = PEPRatingUndefined;
   20.58  
   20.59      [self lockWrite];
   20.60 -    PEP_STATUS theStatus = decrypt_message(_session,
   20.61 -                                           _src,
   20.62 -                                           &_dst,
   20.63 -                                           &theKeys,
   20.64 -                                           &internalRating,
   20.65 -                                           &theFlags);
   20.66 +    PEPStatus theStatus = (PEPStatus) decrypt_message(_session,
   20.67 +                                                      _src,
   20.68 +                                                      &_dst,
   20.69 +                                                      &theKeys,
   20.70 +                                                      (PEP_rating *) &internalRating,
   20.71 +                                                      &theFlags);
   20.72      [self unlockWrite];
   20.73  
   20.74      if (status) {
   20.75 @@ -176,10 +179,10 @@
   20.76  }
   20.77  
   20.78  - (PEPMessage * _Nullable)decryptMessage:(PEPMessage * _Nonnull)message
   20.79 -                                   flags:(PEP_decrypt_flags * _Nullable)flags
   20.80 -                                  rating:(PEP_rating * _Nullable)rating
   20.81 +                                   flags:(PEPDecryptFlags * _Nullable)flags
   20.82 +                                  rating:(PEPRating * _Nullable)rating
   20.83                                 extraKeys:(PEPStringList * _Nullable * _Nullable)extraKeys
   20.84 -                                  status:(PEP_STATUS * _Nullable)status
   20.85 +                                  status:(PEPStatus * _Nullable)status
   20.86                                     error:(NSError * _Nullable * _Nullable)error
   20.87  {
   20.88      PEPDict *destDict = [self
   20.89 @@ -201,8 +204,8 @@
   20.90  
   20.91  - (BOOL)reEvaluateMessageDict:(PEPDict * _Nonnull)messageDict
   20.92                       xKeyList:(PEPStringList * _Nullable)xKeyList
   20.93 -                       rating:(PEP_rating * _Nonnull)rating
   20.94 -                       status:(PEP_STATUS * _Nullable)status
   20.95 +                       rating:(PEPRating * _Nonnull)rating
   20.96 +                       status:(PEPStatus * _Nullable)status
   20.97                          error:(NSError * _Nullable * _Nullable)error
   20.98  {
   20.99      message *_src = PEP_messageDictToStruct(messageDict);
  20.100 @@ -213,11 +216,11 @@
  20.101      }
  20.102  
  20.103      [self lockWrite];
  20.104 -    PEP_STATUS theStatus = re_evaluate_message_rating(_session,
  20.105 -                                                      _src,
  20.106 -                                                      theKeys,
  20.107 -                                                      *rating,
  20.108 -                                                      rating);
  20.109 +    PEPStatus theStatus = (PEPStatus) re_evaluate_message_rating(_session,
  20.110 +                                                                 _src,
  20.111 +                                                                 theKeys,
  20.112 +                                                                 (PEP_rating) *rating,
  20.113 +                                                                 (PEP_rating *) rating);
  20.114      [self unlockWrite];
  20.115  
  20.116      free_message(_src);
  20.117 @@ -236,8 +239,8 @@
  20.118  
  20.119  - (BOOL)reEvaluateMessage:(PEPMessage * _Nonnull)message
  20.120                   xKeyList:(PEPStringList * _Nullable)xKeyList
  20.121 -                   rating:(PEP_rating * _Nonnull)rating
  20.122 -                   status:(PEP_STATUS * _Nullable)status
  20.123 +                   rating:(PEPRating * _Nonnull)rating
  20.124 +                   status:(PEPStatus * _Nullable)status
  20.125                      error:(NSError * _Nullable * _Nullable)error
  20.126  {
  20.127      return [self reEvaluateMessageDict:(PEPDict *) message
  20.128 @@ -267,8 +270,8 @@
  20.129  
  20.130  - (PEPDict * _Nullable)encryptMessageDict:(PEPDict * _Nonnull)messageDict
  20.131                                  extraKeys:(PEPStringList * _Nullable)extraKeys
  20.132 -                                encFormat:(PEP_enc_format)encFormat
  20.133 -                                   status:(PEP_STATUS * _Nullable)status
  20.134 +                                encFormat:(PEPEncFormat)encFormat
  20.135 +                                   status:(PEPStatus * _Nullable)status
  20.136                                      error:(NSError * _Nullable * _Nullable)error
  20.137  {
  20.138      PEP_encrypt_flags_t flags = 0;
  20.139 @@ -278,7 +281,13 @@
  20.140      stringlist_t *_keys = PEP_arrayToStringlist(extraKeys);
  20.141  
  20.142      [self lockWrite];
  20.143 -    PEP_STATUS theStatus = encrypt_message(_session, _src, _keys, &_dst, encFormat, flags);
  20.144 +    PEPStatus theStatus = (PEPStatus) encrypt_message(
  20.145 +                                                      _session,
  20.146 +                                                      _src,
  20.147 +                                                      _keys,
  20.148 +                                                      &_dst,
  20.149 +                                                      (PEP_enc_format) encFormat,
  20.150 +                                                      flags);
  20.151      [self unlockWrite];
  20.152  
  20.153      if (status) {
  20.154 @@ -307,8 +316,8 @@
  20.155  
  20.156  - (PEPMessage * _Nullable)encryptMessage:(PEPMessage * _Nonnull)message
  20.157                                     extraKeys:(PEPStringList * _Nullable)extraKeys
  20.158 -                               encFormat:(PEP_enc_format)encFormat
  20.159 -                                  status:(PEP_STATUS * _Nullable)status
  20.160 +                               encFormat:(PEPEncFormat)encFormat
  20.161 +                                  status:(PEPStatus * _Nullable)status
  20.162                                     error:(NSError * _Nullable * _Nullable)error
  20.163  {
  20.164      PEPDict *encryptedDict = [self encryptMessageDict:(NSDictionary *) message
  20.165 @@ -327,13 +336,13 @@
  20.166  
  20.167  - (PEPMessage * _Nullable)encryptMessage:(PEPMessage * _Nonnull)message
  20.168                                     extraKeys:(PEPStringList * _Nullable)extraKeys
  20.169 -                                  status:(PEP_STATUS * _Nullable)status
  20.170 +                                  status:(PEPStatus * _Nullable)status
  20.171                                     error:(NSError * _Nullable * _Nullable)error
  20.172  {
  20.173      return [self
  20.174              encryptMessage:message
  20.175              extraKeys:extraKeys
  20.176 -            encFormat:PEP_enc_PEP
  20.177 +            encFormat:PEPEncFormatPEP
  20.178              status:status
  20.179              error:error];
  20.180  }
  20.181 @@ -341,7 +350,7 @@
  20.182  - (PEPDict * _Nullable)encryptMessageDict:(PEPDict * _Nonnull)messageDict
  20.183                                    forSelf:(PEPIdentity * _Nonnull)ownIdentity
  20.184                                  extraKeys:(PEPStringList * _Nullable)extraKeys
  20.185 -                                   status:(PEP_STATUS * _Nullable)status
  20.186 +                                   status:(PEPStatus * _Nullable)status
  20.187                                      error:(NSError * _Nullable * _Nullable)error
  20.188  {
  20.189      PEP_encrypt_flags_t flags = 0;
  20.190 @@ -353,13 +362,13 @@
  20.191      stringlist_t *keysStringList = PEP_arrayToStringlist(extraKeys);
  20.192  
  20.193      [self lockWrite];
  20.194 -    PEP_STATUS theStatus = encrypt_message_for_self(_session,
  20.195 -                                                    ident,
  20.196 -                                                    _src,
  20.197 -                                                    keysStringList,
  20.198 -                                                    &_dst,
  20.199 -                                                    PEP_enc_PGP_MIME,
  20.200 -                                                    flags);
  20.201 +    PEPStatus theStatus = (PEPStatus) encrypt_message_for_self(_session,
  20.202 +                                                               ident,
  20.203 +                                                               _src,
  20.204 +                                                               keysStringList,
  20.205 +                                                               &_dst,
  20.206 +                                                               PEP_enc_PGP_MIME,
  20.207 +                                                               flags);
  20.208      [self unlockWrite];
  20.209  
  20.210      free_stringlist(keysStringList);
  20.211 @@ -391,7 +400,7 @@
  20.212  - (PEPMessage * _Nullable)encryptMessage:(PEPMessage * _Nonnull)message
  20.213                                   forSelf:(PEPIdentity * _Nonnull)ownIdentity
  20.214                                 extraKeys:(PEPStringList * _Nullable)extraKeys
  20.215 -                                  status:(PEP_STATUS * _Nullable)status
  20.216 +                                  status:(PEPStatus * _Nullable)status
  20.217                                     error:(NSError * _Nullable * _Nullable)error
  20.218  {
  20.219      PEPDict *target = [self
  20.220 @@ -413,19 +422,19 @@
  20.221  
  20.222  - (PEPDict * _Nullable)encryptMessageDict:(PEPDict * _Nonnull)messageDict
  20.223                                      toFpr:(NSString * _Nonnull)toFpr
  20.224 -                                encFormat:(PEP_enc_format)encFormat
  20.225 -                                    flags:(PEP_decrypt_flags)flags
  20.226 -                                   status:(PEP_STATUS * _Nullable)status
  20.227 +                                encFormat:(PEPEncFormat)encFormat
  20.228 +                                    flags:(PEPDecryptFlags)flags
  20.229 +                                   status:(PEPStatus * _Nullable)status
  20.230                                      error:(NSError * _Nullable * _Nullable)error __deprecated
  20.231  {
  20.232      message *src = PEP_messageDictToStruct([self removeEmptyRecipients:messageDict]);
  20.233      message *dst = NULL;
  20.234  
  20.235      [self lockWrite];
  20.236 -    PEP_STATUS theStatus =
  20.237 +    PEPStatus theStatus = (PEPStatus)
  20.238      encrypt_message_and_add_priv_key(_session, src, &dst,
  20.239                                       [[toFpr precomposedStringWithCanonicalMapping] UTF8String],
  20.240 -                                     encFormat, flags);
  20.241 +                                     (PEP_enc_format) encFormat, flags);
  20.242      [self unlockWrite];
  20.243  
  20.244      if (status) {
  20.245 @@ -445,9 +454,9 @@
  20.246  
  20.247  - (PEPMessage * _Nullable)encryptMessage:(PEPMessage * _Nonnull)message
  20.248                                     toFpr:(NSString * _Nonnull)toFpr
  20.249 -                               encFormat:(PEP_enc_format)encFormat
  20.250 -                                   flags:(PEP_decrypt_flags)flags
  20.251 -                                  status:(PEP_STATUS * _Nullable)status
  20.252 +                               encFormat:(PEPEncFormat)encFormat
  20.253 +                                   flags:(PEPDecryptFlags)flags
  20.254 +                                  status:(PEPStatus * _Nullable)status
  20.255                                     error:(NSError * _Nullable * _Nullable)error
  20.256  {
  20.257      PEPDict *target = [self
  20.258 @@ -474,10 +483,12 @@
  20.259                                                   error:(NSError * _Nullable * _Nullable)error
  20.260  {
  20.261      message *_msg = PEP_messageToStruct(theMessage);
  20.262 -    PEP_rating rating = PEP_rating_undefined;
  20.263 +    PEPRating rating = PEPRatingUndefined;
  20.264  
  20.265      [self lockWrite];
  20.266 -    PEP_STATUS status = outgoing_message_rating(_session, _msg, &rating);
  20.267 +    PEPStatus status = (PEPStatus) outgoing_message_rating(_session,
  20.268 +                                                           _msg,
  20.269 +                                                           (PEP_rating *) &rating);
  20.270      [self unlockWrite];
  20.271  
  20.272      free_message(_msg);
  20.273 @@ -511,10 +522,10 @@
  20.274                                      error:(NSError * _Nullable * _Nullable)error
  20.275  {
  20.276      pEp_identity *ident = PEP_identityToStruct(identity);
  20.277 -    PEP_rating rating = PEP_rating_undefined;
  20.278 +    PEPRating rating = PEPRatingUndefined;
  20.279  
  20.280      [self lockWrite];
  20.281 -    PEP_STATUS status = identity_rating(_session, ident, &rating);
  20.282 +    PEPStatus status = (PEPStatus) identity_rating(_session, ident, (PEP_rating *) &rating);
  20.283      [self unlockWrite];
  20.284  
  20.285      free_identity(ident);
  20.286 @@ -545,12 +556,12 @@
  20.287          PEPAutoPointer *word = [PEPAutoPointer new];
  20.288          size_t size;
  20.289  
  20.290 -        PEP_STATUS status = trustword(_session,
  20.291 -                                      value,
  20.292 -                                      [[languageID precomposedStringWithCanonicalMapping]
  20.293 -                                       UTF8String],
  20.294 -                                      word.charPointerPointer,
  20.295 -                                      &size);
  20.296 +        PEPStatus status = (PEPStatus) trustword(_session,
  20.297 +                                                 value,
  20.298 +                                                 [[languageID precomposedStringWithCanonicalMapping]
  20.299 +                                                  UTF8String],
  20.300 +                                                 word.charPointerPointer,
  20.301 +                                                 &size);
  20.302  
  20.303          if ([NSError setError:error fromPEPStatus:status]) {
  20.304              return nil;
  20.305 @@ -567,7 +578,7 @@
  20.306      pEp_identity *ident = PEP_identityToStruct(identity);
  20.307  
  20.308      [self lockWrite];
  20.309 -    PEP_STATUS status = myself(_session, ident);
  20.310 +    PEPStatus status = (PEPStatus) myself(_session, ident);
  20.311      [self unlockWrite];
  20.312  
  20.313      if ([NSError setError:error fromPEPStatus:status]) {
  20.314 @@ -590,7 +601,7 @@
  20.315          pEp_identity *ident = PEP_identityToStruct(identity);
  20.316  
  20.317          [self lockWrite];
  20.318 -        PEP_STATUS status = update_identity(_session, ident);
  20.319 +        PEPStatus status = (PEPStatus) update_identity(_session, ident);
  20.320          [self unlockWrite];
  20.321  
  20.322          if ([NSError setError:error fromPEPStatus:status]) {
  20.323 @@ -612,7 +623,7 @@
  20.324      pEp_identity *ident = PEP_identityToStruct(identity);
  20.325  
  20.326      [self lockWrite];
  20.327 -    PEP_STATUS status = trust_personal_key(_session, ident);
  20.328 +    PEPStatus status = (PEPStatus) trust_personal_key(_session, ident);
  20.329      [self unlockWrite];
  20.330  
  20.331      if ([NSError setError:error fromPEPStatus:status]) {
  20.332 @@ -631,7 +642,7 @@
  20.333      pEp_identity *ident = PEP_identityToStruct(identity);
  20.334  
  20.335      [self lockWrite];
  20.336 -    PEP_STATUS status = key_mistrusted(_session, ident);
  20.337 +    PEPStatus status = (PEPStatus) key_mistrusted(_session, ident);
  20.338      [self unlockWrite];
  20.339  
  20.340      if ([NSError setError:error fromPEPStatus:status]) {
  20.341 @@ -652,7 +663,7 @@
  20.342      pEp_identity *ident = PEP_identityToStruct(identity);
  20.343  
  20.344      [self lockWrite];
  20.345 -    PEP_STATUS status = key_reset_trust(_session, ident);
  20.346 +    PEPStatus status = (PEPStatus) key_reset_trust(_session, ident);
  20.347      [self unlockWrite];
  20.348  
  20.349      if ([NSError setError:error fromPEPStatus:status]) {
  20.350 @@ -673,7 +684,7 @@
  20.351      identity_list *identList = NULL;
  20.352  
  20.353      [self lockWrite];
  20.354 -    PEP_STATUS status = import_key(_session,
  20.355 +    PEPStatus status = (PEPStatus) import_key(_session,
  20.356                                     [[keydata precomposedStringWithCanonicalMapping] UTF8String],
  20.357                                     [keydata length], &identList);
  20.358      [self unlockWrite];
  20.359 @@ -696,11 +707,15 @@
  20.360             error:(NSError * _Nullable * _Nullable)error
  20.361  {
  20.362      [self lockWrite];
  20.363 -    PEP_STATUS status = log_event(_session,
  20.364 -                                  [[title precomposedStringWithCanonicalMapping] UTF8String],
  20.365 -                                  [[entity precomposedStringWithCanonicalMapping] UTF8String],
  20.366 -                                  [[description precomposedStringWithCanonicalMapping] UTF8String],
  20.367 -                                  [[comment precomposedStringWithCanonicalMapping] UTF8String]);
  20.368 +    PEPStatus status = (PEPStatus) log_event(_session,
  20.369 +                                             [[title precomposedStringWithCanonicalMapping]
  20.370 +                                              UTF8String],
  20.371 +                                             [[entity precomposedStringWithCanonicalMapping]
  20.372 +                                              UTF8String],
  20.373 +                                             [[description precomposedStringWithCanonicalMapping]
  20.374 +                                              UTF8String],
  20.375 +                                             [[comment precomposedStringWithCanonicalMapping]
  20.376 +                                              UTF8String]);
  20.377      [self unlockWrite];
  20.378  
  20.379      if ([NSError setError:error fromPEPStatus:status]) {
  20.380 @@ -713,7 +728,7 @@
  20.381  - (NSString * _Nullable)getLogWithError:(NSError * _Nullable * _Nullable)error
  20.382  {
  20.383      char *theChars = NULL;
  20.384 -    PEP_STATUS status = get_crashdump_log(_session, 0, &theChars);
  20.385 +    PEPStatus status = (PEPStatus) get_crashdump_log(_session, 0, &theChars);
  20.386  
  20.387      if ([NSError setError:error fromPEPStatus:status]) {
  20.388          return nil;
  20.389 @@ -722,7 +737,7 @@
  20.390      if (theChars) {
  20.391          return [NSString stringWithUTF8String:theChars];
  20.392      } else {
  20.393 -        [NSError setError:error fromPEPStatus:PEP_UNKNOWN_ERROR];
  20.394 +        [NSError setError:error fromPEPStatusInternal:PEP_UNKNOWN_ERROR];
  20.395          return nil;
  20.396      }
  20.397  }
  20.398 @@ -735,16 +750,16 @@
  20.399  {
  20.400      pEp_identity *ident1 = PEP_identityToStruct(identity1);
  20.401      pEp_identity *ident2 = PEP_identityToStruct(identity2);
  20.402 -    PEP_STATUS status;
  20.403 +    PEPStatus status;
  20.404  
  20.405      PEPAutoPointer *trustwords = [PEPAutoPointer new];
  20.406      size_t sizeWritten = 0;
  20.407  
  20.408      [self lockWrite];
  20.409 -    status = get_trustwords(_session, ident1, ident2,
  20.410 -                            [[language precomposedStringWithCanonicalMapping]
  20.411 -                             UTF8String],
  20.412 -                            trustwords.charPointerPointer, &sizeWritten, full);
  20.413 +    status = (PEPStatus) get_trustwords(_session, ident1, ident2,
  20.414 +                                        [[language precomposedStringWithCanonicalMapping]
  20.415 +                                         UTF8String],
  20.416 +                                        trustwords.charPointerPointer, &sizeWritten, full);
  20.417      [self unlockWrite];
  20.418  
  20.419      free_identity(ident1);
  20.420 @@ -762,7 +777,7 @@
  20.421  - (NSArray<PEPLanguage *> * _Nullable)languageListWithError:(NSError * _Nullable * _Nullable)error
  20.422  {
  20.423      PEPAutoPointer *chLangs = [PEPAutoPointer new];
  20.424 -    PEP_STATUS status = get_languagelist(_session, chLangs.charPointerPointer);
  20.425 +    PEPStatus status = (PEPStatus) get_languagelist(_session, chLangs.charPointerPointer);
  20.426  
  20.427      if ([NSError setError:error fromPEPStatus:status]) {
  20.428          return nil;
  20.429 @@ -806,19 +821,19 @@
  20.430  {
  20.431      NSDictionary *ratingToStringIntern =
  20.432      @{
  20.433 -      [NSNumber numberWithInteger:PEP_rating_cannot_decrypt]: @"cannot_decrypt",
  20.434 -      [NSNumber numberWithInteger:PEP_rating_have_no_key]: @"have_no_key",
  20.435 -      [NSNumber numberWithInteger:PEP_rating_unencrypted]: @"unencrypted",
  20.436 -      [NSNumber numberWithInteger:PEP_rating_unencrypted_for_some]: @"unencrypted_for_some",
  20.437 -      [NSNumber numberWithInteger:PEP_rating_unreliable]: @"unreliable",
  20.438 -      [NSNumber numberWithInteger:PEP_rating_reliable]: @"reliable",
  20.439 -      [NSNumber numberWithInteger:PEP_rating_trusted]: @"trusted",
  20.440 -      [NSNumber numberWithInteger:PEP_rating_trusted_and_anonymized]: @"trusted_and_anonymized",
  20.441 -      [NSNumber numberWithInteger:PEP_rating_fully_anonymous]: @"fully_anonymous",
  20.442 -      [NSNumber numberWithInteger:PEP_rating_mistrust]: @"mistrust",
  20.443 -      [NSNumber numberWithInteger:PEP_rating_b0rken]: @"b0rken",
  20.444 -      [NSNumber numberWithInteger:PEP_rating_under_attack]: @"under_attack",
  20.445 -      [NSNumber numberWithInteger:PEP_rating_undefined]: @"undefined",
  20.446 +      [NSNumber numberWithInteger:PEPRatingCannotDecrypt]: @"cannot_decrypt",
  20.447 +      [NSNumber numberWithInteger:PEPRatingHaveNoKey]: @"have_no_key",
  20.448 +      [NSNumber numberWithInteger:PEPRatingUnencrypted]: @"unencrypted",
  20.449 +      [NSNumber numberWithInteger:PEPRatingUnencryptedForSome]: @"unencrypted_for_some",
  20.450 +      [NSNumber numberWithInteger:PEPRatingUnreliable]: @"unreliable",
  20.451 +      [NSNumber numberWithInteger:PEPRatingReliable]: @"reliable",
  20.452 +      [NSNumber numberWithInteger:PEPRatingTrusted]: @"trusted",
  20.453 +      [NSNumber numberWithInteger:PEPRatingTrustedAndAnonymized]: @"trusted_and_anonymized",
  20.454 +      [NSNumber numberWithInteger:PEPRatingFullyAnonymous]: @"fully_anonymous",
  20.455 +      [NSNumber numberWithInteger:PEPRatingMistrust]: @"mistrust",
  20.456 +      [NSNumber numberWithInteger:PEPRatingB0rken]: @"b0rken",
  20.457 +      [NSNumber numberWithInteger:PEPRatingUnderAttack]: @"under_attack",
  20.458 +      [NSNumber numberWithInteger:PEPRatingUndefined]: @"undefined",
  20.459        };
  20.460      NSMutableDictionary *stringToRatingMutable = [NSMutableDictionary
  20.461                                                    dictionaryWithCapacity:
  20.462 @@ -831,17 +846,17 @@
  20.463      stringToRating = [NSDictionary dictionaryWithDictionary:stringToRatingMutable];
  20.464  }
  20.465  
  20.466 -- (PEP_rating)ratingFromString:(NSString * _Nonnull)string
  20.467 +- (PEPRating)ratingFromString:(NSString * _Nonnull)string
  20.468  {
  20.469      NSNumber *num = [stringToRating objectForKey:string];
  20.470      if (num) {
  20.471 -        return (PEP_rating) [num integerValue];
  20.472 +        return (PEPRating) [num integerValue];
  20.473      } else {
  20.474 -        return PEP_rating_undefined;
  20.475 +        return PEPRatingUndefined;
  20.476      }
  20.477  }
  20.478  
  20.479 -- (NSString * _Nonnull)stringFromRating:(PEP_rating)rating
  20.480 +- (NSString * _Nonnull)stringFromRating:(PEPRating)rating
  20.481  {
  20.482      NSString *stringRating = [ratingToString objectForKey:[NSNumber numberWithInteger:rating]];
  20.483      if (stringRating) {
  20.484 @@ -856,7 +871,7 @@
  20.485  {
  20.486      pEp_identity *ident = PEP_identityToStruct(identity);
  20.487      bool isPEP;
  20.488 -    PEP_STATUS status = is_pEp_user(self.session, ident, &isPEP);
  20.489 +    PEPStatus status = (PEPStatus) is_pEp_user(self.session, ident, &isPEP);
  20.490  
  20.491      free_identity(ident);
  20.492  
  20.493 @@ -871,12 +886,12 @@
  20.494              error:(NSError * _Nullable * _Nullable)error
  20.495  {
  20.496      pEp_identity *ident = PEP_identityToStruct(identity);
  20.497 -    PEP_STATUS status = set_own_key(self.session, ident,
  20.498 -                                    [[fingerprint precomposedStringWithCanonicalMapping]
  20.499 -                                     UTF8String]);
  20.500 +    PEPStatus status = (PEPStatus) set_own_key(self.session, ident,
  20.501 +                                               [[fingerprint precomposedStringWithCanonicalMapping]
  20.502 +                                                UTF8String]);
  20.503      free_identity(ident);
  20.504  
  20.505 -    if (status == PEP_STATUS_OK) {
  20.506 +    if (status == PEPStatusOK) {
  20.507          return YES;
  20.508      } else {
  20.509          if (error) {
  20.510 @@ -891,15 +906,15 @@
  20.511      config_passive_mode(_session, enabled);
  20.512  }
  20.513  
  20.514 -- (BOOL)setFlags:(identity_flags_t)flags
  20.515 +- (BOOL)setFlags:(PEPIdentityFlags)flags
  20.516       forIdentity:(PEPIdentity *)identity
  20.517             error:(NSError * _Nullable * _Nullable)error
  20.518  {
  20.519      pEp_identity *ident = PEP_identityToStruct(identity);
  20.520 -    PEP_STATUS status = set_identity_flags(self.session, ident, flags);
  20.521 +    PEPStatus status = (PEPStatus) set_identity_flags(self.session, ident, flags);
  20.522      free_identity(ident);
  20.523  
  20.524 -    if (status == PEP_STATUS_OK) {
  20.525 +    if (status == PEPStatusOK) {
  20.526          return YES;
  20.527      } else {
  20.528          if (error) {
  20.529 @@ -909,15 +924,17 @@
  20.530      }
  20.531  }
  20.532  
  20.533 -- (BOOL)deliverHandshakeResult:(sync_handshake_result)result
  20.534 +- (BOOL)deliverHandshakeResult:(PEPSyncHandshakeResult)result
  20.535                      forPartner:(PEPIdentity * _Nonnull)partner
  20.536                           error:(NSError * _Nullable * _Nullable)error
  20.537  {
  20.538      pEp_identity *partnerIdent = PEP_identityToStruct(partner);
  20.539 -    PEP_STATUS status = deliverHandshakeResult(self.session, partnerIdent, result);
  20.540 +    PEPStatus status = (PEPStatus) deliverHandshakeResult(self.session,
  20.541 +                                                          partnerIdent,
  20.542 +                                                          (sync_handshake_result) result);
  20.543      free_identity(partnerIdent);
  20.544  
  20.545 -    if (status == PEP_STATUS_OK) {
  20.546 +    if (status == PEPStatusOK) {
  20.547          return YES;
  20.548      } else {
  20.549          if (error) {
  20.550 @@ -931,10 +948,10 @@
  20.551                        error:(NSError * _Nullable * _Nullable)error
  20.552  {
  20.553      pEp_identity *ident = PEP_identityToStruct(identity);
  20.554 -    PEP_STATUS status = trust_own_key(self.session, ident);
  20.555 +    PEPStatus status = (PEPStatus) trust_own_key(self.session, ident);
  20.556      free_identity(ident);
  20.557  
  20.558 -    if (status == PEP_STATUS_OK) {
  20.559 +    if (status == PEPStatusOK) {
  20.560          return YES;
  20.561      } else {
  20.562          if (error) {
  20.563 @@ -944,4 +961,9 @@
  20.564      }
  20.565  }
  20.566  
  20.567 +- (PEPColor)colorFromRating:(PEPRating)rating
  20.568 +{
  20.569 +    return (PEPColor) color_from_rating((PEP_rating) rating);
  20.570 +}
  20.571 +
  20.572  @end
    21.1 --- a/pEpObjCAdapter/PEPLanguage.h	Wed Feb 20 09:18:34 2019 +0100
    21.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    21.3 @@ -1,33 +0,0 @@
    21.4 -//
    21.5 -//  PEPLanguage.h
    21.6 -//  pEpiOSAdapter
    21.7 -//
    21.8 -//  Created by Dirk Zimmermann on 03.05.17.
    21.9 -//  Copyright © 2017 p≡p. All rights reserved.
   21.10 -//
   21.11 -
   21.12 -#import <Foundation/Foundation.h>
   21.13 -
   21.14 -@interface PEPLanguage : NSObject
   21.15 -
   21.16 -- (instancetype _Nonnull)initWithCode:(NSString * _Nonnull)code
   21.17 -                                 name:(NSString * _Nonnull)name
   21.18 -                                 sentence:(NSString * _Nonnull)sentence;
   21.19 -
   21.20 -/**
   21.21 - ISO 639-1 language code
   21.22 - */
   21.23 -@property (nonatomic, nonnull) NSString *code;
   21.24 -
   21.25 -/**
   21.26 - Name of the language. Should not be translated.
   21.27 - */
   21.28 -@property (nonatomic, nonnull) NSString *name;
   21.29 -
   21.30 -/**
   21.31 - Sentence of the form "I want to display the trustwords in <lang>".
   21.32 - Should not be translated.
   21.33 - */
   21.34 -@property (nonatomic, nonnull) NSString *sentence;
   21.35 -
   21.36 -@end
    22.1 --- a/pEpObjCAdapter/PEPMessage.h	Wed Feb 20 09:18:34 2019 +0100
    22.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    22.3 @@ -1,59 +0,0 @@
    22.4 -//
    22.5 -//  PEPMessage.h
    22.6 -//  pEpObjCAdapter
    22.7 -//
    22.8 -//  Created by Dirk Zimmermann on 10.11.17.
    22.9 -//  Copyright © 2017 p≡p. All rights reserved.
   22.10 -//
   22.11 -
   22.12 -#import <Foundation/Foundation.h>
   22.13 -
   22.14 -#import "message.h"
   22.15 -#import "PEPSessionProtocol.h"
   22.16 -
   22.17 -@class PEPIdentity;
   22.18 -@class PEPAttachment;
   22.19 -
   22.20 -@interface PEPMessage : NSObject
   22.21 -
   22.22 -@property (nonatomic, nullable) NSString *messageID;
   22.23 -
   22.24 -@property (nonatomic, nullable) PEPIdentity *from;
   22.25 -@property (nonatomic, nullable) NSArray<PEPIdentity *> *to;
   22.26 -@property (nonatomic, nullable) NSArray<PEPIdentity *> *cc;
   22.27 -@property (nonatomic, nullable) NSArray<PEPIdentity *> *bcc;
   22.28 -
   22.29 -@property (nonatomic, nullable) NSString *shortMessage;
   22.30 -@property (nonatomic, nullable) NSString *longMessage;
   22.31 -@property (nonatomic, nullable) NSString *longMessageFormatted;
   22.32 -
   22.33 -@property (nonatomic, nullable) NSArray<PEPIdentity *> *replyTo;
   22.34 -@property (nonatomic, nullable) NSArray<NSString *> *inReplyTo;
   22.35 -@property (nonatomic, nullable) NSArray<NSString *> *references;
   22.36 -
   22.37 -@property (nonatomic, nullable) NSDate *sentDate;
   22.38 -@property (nonatomic, nullable) NSDate *receivedDate;
   22.39 -
   22.40 -@property (nonatomic, nullable) NSArray<PEPAttachment *> *attachments;
   22.41 -
   22.42 -@property (nonatomic, nullable) NSArray<NSArray<NSString *> *> *optionalFields;
   22.43 -@property (nonatomic, nullable) NSArray<NSString *> *keywords;
   22.44 -@property (nonatomic, nullable) PEPIdentity *receivedBy;
   22.45 -@property (nonatomic) PEP_msg_direction direction;
   22.46 -
   22.47 -/**
   22.48 - For backwards compatiblity.
   22.49 - */
   22.50 -- (instancetype _Nonnull)initWithDictionary:(PEPDict *)dict;
   22.51 -
   22.52 -/**
   22.53 - For backwards compatiblity.
   22.54 - */
   22.55 -- (PEPDict * _Nonnull)dictionary;
   22.56 -
   22.57 -/**
   22.58 - For backwards compatiblity.
   22.59 - */
   22.60 -- (PEPMutableDict * _Nonnull)mutableDictionary;
   22.61 -
   22.62 -@end
    23.1 --- a/pEpObjCAdapter/PEPMessage.m	Wed Feb 20 09:18:34 2019 +0100
    23.2 +++ b/pEpObjCAdapter/PEPMessage.m	Thu Mar 21 12:37:32 2019 +0100
    23.3 @@ -7,10 +7,13 @@
    23.4  //
    23.5  
    23.6  #import "PEPMessage.h"
    23.7 +
    23.8  #import "PEPIdentity.h"
    23.9 +#import "PEPConstants.h"
   23.10  
   23.11  #import "NSObject+Extension.h"
   23.12  #import "NSMutableDictionary+PEP.h"
   23.13 +#import "PEPMessageUtil.h"
   23.14  
   23.15  @implementation PEPMessage
   23.16  
    24.1 --- a/pEpObjCAdapter/PEPMessageUtil.h	Wed Feb 20 09:18:34 2019 +0100
    24.2 +++ b/pEpObjCAdapter/PEPMessageUtil.h	Thu Mar 21 12:37:32 2019 +0100
    24.3 @@ -37,91 +37,3 @@
    24.4  NSArray *PEP_identityArrayFromList(identity_list *il);
    24.5  NSArray *PEP_arrayFromStringPairlist(stringpair_list_t *sl);
    24.6  NSArray *PEP_arrayFromBloblist(bloblist_t *bl);
    24.7 -
    24.8 -#pragma mark -- Constants
    24.9 -
   24.10 -/** The name of the user */
   24.11 -extern NSString *const _Nonnull kPepUsername;
   24.12 -
   24.13 -/** Email address of the contact */
   24.14 -extern NSString *const _Nonnull kPepAddress;
   24.15 -
   24.16 -/**
   24.17 - A user ID, used by pEp to map multiple identities to a single user.
   24.18 - This should be a stable ID.
   24.19 - pEp identities set up with mySelf() get a special user ID.
   24.20 - */
   24.21 -extern NSString *const _Nonnull kPepUserID;
   24.22 -
   24.23 -/**
   24.24 - Dict key for value isOwn/me.
   24.25 - isOwn indicates the identity is representing me. 
   24.26 - */
   24.27 -extern NSString *const _Nonnull kPepIsOwn;
   24.28 -
   24.29 -/** The fingerprint for the key for this contact. */
   24.30 -extern NSString *const _Nonnull kPepFingerprint;
   24.31 -
   24.32 -/** In an email, the identity this email is from */
   24.33 -extern NSString *const _Nonnull kPepFrom;
   24.34 -
   24.35 -/** In an email, the `NSArray` of to recipients */
   24.36 -extern NSString *const _Nonnull kPepTo;
   24.37 -
   24.38 -/** In an email, the `NSArray` of CC recipients */
   24.39 -extern NSString *const _Nonnull kPepCC;
   24.40 -
   24.41 -/** In an email, the `NSArray` of BCC recipients */
   24.42 -extern NSString *const _Nonnull kPepBCC;
   24.43 -
   24.44 -/** The subject of an email */
   24.45 -extern NSString *const _Nonnull kPepShortMessage;
   24.46 -
   24.47 -/** The text message of an email */
   24.48 -extern NSString *const _Nonnull kPepLongMessage;
   24.49 -
   24.50 -/** HTML message part, if any */
   24.51 -extern NSString *const _Nonnull kPepLongMessageFormatted;
   24.52 -
   24.53 -/** NSNumber denoting a boolean. True if that message is supposed to be sent. */
   24.54 -extern NSString *const _Nonnull kPepOutgoing;
   24.55 -
   24.56 -/** Sent date of the message (NSDate) */
   24.57 -extern NSString *const _Nonnull kPepSent;
   24.58 -
   24.59 -/** Received date of the message (NSDate) */
   24.60 -extern NSString *const _Nonnull kPepReceived;
   24.61 -
   24.62 -/** The message ID */
   24.63 -extern NSString *const _Nonnull kPepID;
   24.64 -
   24.65 -extern NSString *const _Nonnull kPepReceivedBy;
   24.66 -extern NSString *const _Nonnull kPepReplyTo;
   24.67 -extern NSString *const _Nonnull kPepInReplyTo;
   24.68 -extern NSString *const _Nonnull kPepReferences;
   24.69 -extern NSString *const _Nonnull kPepKeywords;
   24.70 -extern NSString *const _Nonnull kPepOptFields;
   24.71 -
   24.72 -/** NSArray of attachment dicts */
   24.73 -extern NSString *const _Nonnull kPepAttachments;
   24.74 -
   24.75 -/** The pEp internal communication type */
   24.76 -extern NSString *const _Nonnull kPepCommType;
   24.77 -
   24.78 -/** The raw message created by pEp (NSData) */
   24.79 -extern NSString *const _Nonnull kPepRawMessage;
   24.80 -
   24.81 -/** NSError parameters will use this domain */
   24.82 -extern NSString *const _Nonnull PEPSessionErrorDomain;
   24.83 -
   24.84 -/** Optional field "X-pEp-Version" */
   24.85 -extern NSString *const _Nonnull kXpEpVersion;
   24.86 -
   24.87 -/** Optional field "X-EncStatus" */
   24.88 -extern NSString *const _Nonnull kXEncStatus;
   24.89 -
   24.90 -/** Optional field "X-KeyList" */
   24.91 -extern NSString *const _Nonnull kXKeylist;
   24.92 -
   24.93 -/** Key for the boolean flag that denotes own identities */
   24.94 -extern NSString *const _Nonnull kPepIsOwnIdentity;
    25.1 --- a/pEpObjCAdapter/PEPMessageUtil.m	Wed Feb 20 09:18:34 2019 +0100
    25.2 +++ b/pEpObjCAdapter/PEPMessageUtil.m	Thu Mar 21 12:37:32 2019 +0100
    25.3 @@ -8,68 +8,15 @@
    25.4  
    25.5  #import "PEPMessageUtil.h"
    25.6  
    25.7 +#import "PEPConstants.h"
    25.8  #import "PEPIdentity.h"
    25.9 +
   25.10  #import "PEPMessage.h"
   25.11  #import "PEPAttachment.h"
   25.12  #import "NSMutableDictionary+PEP.h"
   25.13  
   25.14  #import "pEp_string.h"
   25.15  
   25.16 -#pragma mark -- Constants
   25.17 -
   25.18 -NSString *const kPepUsername = @"username";
   25.19 -
   25.20 -NSString *const kPepAddress = @"address";
   25.21 -
   25.22 -NSString *const kPepUserID = @"user_id";
   25.23 -
   25.24 -NSString *const kPepIsOwn = @"isOwn";
   25.25 -
   25.26 -NSString *const kPepFingerprint = @"fpr";
   25.27 -
   25.28 -NSString *const kPepFrom = @"from";
   25.29 -
   25.30 -NSString *const kPepTo = @"to";
   25.31 -
   25.32 -NSString *const kPepCC = @"cc";
   25.33 -
   25.34 -NSString *const kPepBCC = @"bcc";
   25.35 -
   25.36 -NSString *const kPepShortMessage = @"shortmsg";
   25.37 -
   25.38 -NSString *const kPepLongMessage = @"longmsg";
   25.39 -
   25.40 -NSString *const kPepLongMessageFormatted = @"longmsg_formatted";
   25.41 -
   25.42 -NSString *const kPepOutgoing = @"outgoing";
   25.43 -
   25.44 -NSString *const kPepSent = @"sent";
   25.45 -
   25.46 -NSString *const kPepReceived = @"recv";
   25.47 -
   25.48 -NSString *const kPepID = @"id";
   25.49 -
   25.50 -NSString *const kPepReceivedBy = @"recv_by";
   25.51 -NSString *const kPepReplyTo = @"reply_to";
   25.52 -NSString *const kPepInReplyTo = @"in_reply_to";
   25.53 -NSString *const kPepReferences = @"references";
   25.54 -NSString *const kPepKeywords = @"keywords";
   25.55 -NSString *const kPepOptFields = @"opt_fields";
   25.56 -
   25.57 -NSString *const kPepAttachments = @"attachments";
   25.58 -
   25.59 -NSString *const kPepCommType = @"comm_type";
   25.60 -
   25.61 -NSString *const kPepRawMessage = @"raw_message";
   25.62 -
   25.63 -NSString *const kXpEpVersion = @"X-pEp-Version";
   25.64 -
   25.65 -NSString *const kXEncStatus = @"X-EncStatus";
   25.66 -
   25.67 -NSString *const kXKeylist = @"X-KeyList";
   25.68 -
   25.69 -NSString *const _Nonnull kPepIsOwnIdentity = @"kPepIsOwnIdentity";
   25.70 -
   25.71  NSArray *PEP_arrayFromStringlist(stringlist_t *sl)
   25.72  {
   25.73      NSMutableArray *array = [NSMutableArray array];
    26.1 --- a/pEpObjCAdapter/PEPObjCAdapter.h	Wed Feb 20 09:18:34 2019 +0100
    26.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    26.3 @@ -1,44 +0,0 @@
    26.4 -//
    26.5 -//  pEpiOSAdapter.h
    26.6 -//  pEpiOSAdapter
    26.7 -//
    26.8 -//  Created by Volker Birk on 28.04.15.
    26.9 -//  Copyright (c) 2015 p≡p. All rights reserved.
   26.10 -//
   26.11 -
   26.12 -#import <Foundation/Foundation.h>
   26.13 -
   26.14 -#import "PEPSession.h"
   26.15 -
   26.16 -extern const PEP_decrypt_flags PEP_decrypt_flag_none;
   26.17 -
   26.18 -@class PEPLanguage;
   26.19 -
   26.20 -@interface PEPObjCAdapter : NSObject
   26.21 -
   26.22 -#pragma mark - Configuration
   26.23 -
   26.24 -/**
   26.25 - Sets Engine config for unecryptedSubjectEnabled to the given value on all Sessions created by
   26.26 - this adapter.
   26.27 -
   26.28 - @param enabled Whether or not mail subjects should be encrypted
   26.29 - */
   26.30 -+ (void)setUnEncryptedSubjectEnabled:(BOOL)enabled;
   26.31 -
   26.32 -/**
   26.33 - Enable or disable passive mode for all sessions.
   26.34 - */
   26.35 -+ (void)setPassiveModeEnabled:(BOOL)enabled;
   26.36 -
   26.37 -#pragma mark -
   26.38 -
   26.39 -/**
   26.40 - The HOME URL, where all pEp related files will be stored.
   26.41 - */
   26.42 -+ (NSURL * _Nonnull)homeURL;
   26.43 -
   26.44 -+ (void)setupTrustWordsDB;
   26.45 -+ (void)setupTrustWordsDB:(NSBundle * _Nonnull)rootBundle;
   26.46 -
   26.47 -@end
    27.1 --- a/pEpObjCAdapter/PEPSession.h	Wed Feb 20 09:18:34 2019 +0100
    27.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    27.3 @@ -1,36 +0,0 @@
    27.4 -//
    27.5 -//  PEPSession.h
    27.6 -//  pEpObjCAdapter
    27.7 -//
    27.8 -//  Created by Andreas Buff on 11.10.17.
    27.9 -//  Copyright © 2017 p≡p. All rights reserved.
   27.10 -//
   27.11 -
   27.12 -#import <Foundation/Foundation.h>
   27.13 -
   27.14 -#import "PEPSessionProtocol.h"
   27.15 -#import "PEPMessageUtil.h"
   27.16 -
   27.17 -#import "NSNumber+PEPRating.h"
   27.18 -
   27.19 -/**
   27.20 - Fake session to handle to the client.
   27.21 -
   27.22 - Assures all calls are handled on the correct internal session for the thread it is called on.
   27.23 - You can instantiate and use this session how often and wherever you want. Also over multiple threads.
   27.24 -
   27.25 - Note: You must call `cleanup()` once before your process gets terminated to be able to gracefully shutdown.
   27.26 - It is the clients responsibility not to make any calls to PEPSession in between the last call
   27.27 - to `cleanup()` and getting terminated.
   27.28 - */
   27.29 -@interface PEPSession : NSObject <PEPSessionProtocol>
   27.30 -
   27.31 -/**
   27.32 - You must call this method once before your process gets terminated to be able to gracefully shutdown.
   27.33 - You must not make any calls to PEPSession in between the last call to `cleanup()` and getting terminated.
   27.34 -
   27.35 - Only for performance reasons: call this method only if you have to.
   27.36 - */
   27.37 -+ (void)cleanup;
   27.38 -
   27.39 -@end
    28.1 --- a/pEpObjCAdapter/PEPSession.m	Wed Feb 20 09:18:34 2019 +0100
    28.2 +++ b/pEpObjCAdapter/PEPSession.m	Thu Mar 21 12:37:32 2019 +0100
    28.3 @@ -12,6 +12,9 @@
    28.4  #import "PEPSessionProvider.h"
    28.5  #import "PEPIdentity.h"
    28.6  
    28.7 +#import "PEPMessageUtil.h"
    28.8 +#import "NSNumber+PEPRating.h"
    28.9 +
   28.10  @implementation PEPSession
   28.11  
   28.12  #pragma mark - Public API
   28.13 @@ -22,10 +25,10 @@
   28.14  }
   28.15  
   28.16  - (PEPDict * _Nullable)decryptMessageDict:(PEPMutableDict * _Nonnull)messageDict
   28.17 -                                    flags:(PEP_decrypt_flags * _Nullable)flags
   28.18 -                                   rating:(PEP_rating * _Nullable)rating
   28.19 +                                    flags:(PEPDecryptFlags * _Nullable)flags
   28.20 +                                   rating:(PEPRating * _Nullable)rating
   28.21                                  extraKeys:(PEPStringList * _Nullable * _Nullable)extraKeys
   28.22 -                                   status:(PEP_STATUS * _Nullable)status
   28.23 +                                   status:(PEPStatus * _Nullable)status
   28.24                                      error:(NSError * _Nullable * _Nullable)error
   28.25  {
   28.26      PEPInternalSession *session = [PEPSessionProvider session];
   28.27 @@ -39,10 +42,10 @@
   28.28  }
   28.29  
   28.30  - (PEPMessage * _Nullable)decryptMessage:(PEPMessage * _Nonnull)message
   28.31 -                                   flags:(PEP_decrypt_flags * _Nullable)flags
   28.32 -                                  rating:(PEP_rating * _Nullable)rating
   28.33 +                                   flags:(PEPDecryptFlags * _Nullable)flags
   28.34 +                                  rating:(PEPRating * _Nullable)rating
   28.35                                 extraKeys:(PEPStringList * _Nullable * _Nullable)extraKeys
   28.36 -                                  status:(PEP_STATUS * _Nullable)status
   28.37 +                                  status:(PEPStatus * _Nullable)status
   28.38                                     error:(NSError * _Nullable * _Nullable)error
   28.39  {
   28.40      PEPInternalSession *session = [PEPSessionProvider session];
   28.41 @@ -57,8 +60,8 @@
   28.42  
   28.43  - (BOOL)reEvaluateMessageDict:(PEPDict * _Nonnull)messageDict
   28.44                       xKeyList:(PEPStringList * _Nullable)xKeyList
   28.45 -                       rating:(PEP_rating * _Nonnull)rating
   28.46 -                       status:(PEP_STATUS * _Nullable)status
   28.47 +                       rating:(PEPRating * _Nonnull)rating
   28.48 +                       status:(PEPStatus * _Nullable)status
   28.49                          error:(NSError * _Nullable * _Nullable)error
   28.50  {
   28.51      PEPInternalSession *session = [PEPSessionProvider session];
   28.52 @@ -71,8 +74,8 @@
   28.53  
   28.54  - (BOOL)reEvaluateMessage:(PEPMessage * _Nonnull)message
   28.55                   xKeyList:(PEPStringList * _Nullable)xKeyList
   28.56 -                   rating:(PEP_rating * _Nonnull)rating
   28.57 -                   status:(PEP_STATUS * _Nullable)status
   28.58 +                   rating:(PEPRating * _Nonnull)rating
   28.59 +                   status:(PEPStatus * _Nullable)status
   28.60                      error:(NSError * _Nullable * _Nullable)error
   28.61  {
   28.62      PEPInternalSession *session = [PEPSessionProvider session];
   28.63 @@ -85,8 +88,8 @@
   28.64  
   28.65  - (PEPDict * _Nullable)encryptMessageDict:(PEPDict * _Nonnull)messageDict
   28.66                                      extraKeys:(PEPStringList * _Nullable)extraKeys
   28.67 -                                encFormat:(PEP_enc_format)encFormat
   28.68 -                                   status:(PEP_STATUS * _Nullable)status
   28.69 +                                encFormat:(PEPEncFormat)encFormat
   28.70 +                                   status:(PEPStatus * _Nullable)status
   28.71                                      error:(NSError * _Nullable * _Nullable)error
   28.72  {
   28.73      PEPInternalSession *session = [PEPSessionProvider session];
   28.74 @@ -100,8 +103,8 @@
   28.75  
   28.76  - (PEPMessage * _Nullable)encryptMessage:(PEPMessage * _Nonnull)message
   28.77                                 extraKeys:(PEPStringList * _Nullable)extraKeys
   28.78 -                               encFormat:(PEP_enc_format)encFormat
   28.79 -                                  status:(PEP_STATUS * _Nullable)status
   28.80 +                               encFormat:(PEPEncFormat)encFormat
   28.81 +                                  status:(PEPStatus * _Nullable)status
   28.82                                     error:(NSError * _Nullable * _Nullable)error
   28.83  {
   28.84      PEPInternalSession *session = [PEPSessionProvider session];
   28.85 @@ -115,7 +118,7 @@
   28.86  
   28.87  - (PEPMessage * _Nullable)encryptMessage:(PEPMessage * _Nonnull)message
   28.88                                 extraKeys:(PEPStringList * _Nullable)extraKeys
   28.89 -                                  status:(PEP_STATUS * _Nullable)status
   28.90 +                                  status:(PEPStatus * _Nullable)status
   28.91                                     error:(NSError * _Nullable * _Nullable)error
   28.92  {
   28.93      PEPInternalSession *session = [PEPSessionProvider session];
   28.94 @@ -125,7 +128,7 @@
   28.95  - (PEPDict * _Nullable)encryptMessageDict:(PEPDict * _Nonnull)messageDict
   28.96                                    forSelf:(PEPIdentity * _Nonnull)ownIdentity
   28.97                                  extraKeys:(PEPStringList * _Nullable)extraKeys
   28.98 -                                   status:(PEP_STATUS * _Nullable)status
   28.99 +                                   status:(PEPStatus * _Nullable)status
  28.100                                      error:(NSError * _Nullable * _Nullable)error
  28.101  {
  28.102      PEPInternalSession *session = [PEPSessionProvider session];
  28.103 @@ -140,7 +143,7 @@
  28.104  - (PEPMessage * _Nullable)encryptMessage:(PEPMessage * _Nonnull)message
  28.105                                   forSelf:(PEPIdentity * _Nonnull)ownIdentity
  28.106                                 extraKeys:(PEPStringList * _Nullable)extraKeys
  28.107 -                                  status:(PEP_STATUS * _Nullable)status
  28.108 +                                  status:(PEPStatus * _Nullable)status
  28.109                                     error:(NSError * _Nullable * _Nullable)error
  28.110  {
  28.111      PEPInternalSession *session = [PEPSessionProvider session];
  28.112 @@ -154,9 +157,9 @@
  28.113  
  28.114  - (PEPDict * _Nullable)encryptMessageDict:(PEPDict * _Nonnull)messageDict
  28.115                                      toFpr:(NSString * _Nonnull)toFpr
  28.116 -                                encFormat:(PEP_enc_format)encFormat
  28.117 -                                    flags:(PEP_decrypt_flags)flags
  28.118 -                                   status:(PEP_STATUS * _Nullable)status
  28.119 +                                encFormat:(PEPEncFormat)encFormat
  28.120 +                                    flags:(PEPDecryptFlags)flags
  28.121 +                                   status:(PEPStatus * _Nullable)status
  28.122                                      error:(NSError * _Nullable * _Nullable)error __deprecated
  28.123  {
  28.124      PEPInternalSession *session = [PEPSessionProvider session];
  28.125 @@ -171,9 +174,9 @@
  28.126  
  28.127  - (PEPMessage * _Nullable)encryptMessage:(PEPMessage * _Nonnull)message
  28.128                                     toFpr:(NSString * _Nonnull)toFpr
  28.129 -                               encFormat:(PEP_enc_format)encFormat
  28.130 -                                   flags:(PEP_decrypt_flags)flags
  28.131 -                                  status:(PEP_STATUS * _Nullable)status
  28.132 +                               encFormat:(PEPEncFormat)encFormat
  28.133 +                                   flags:(PEPDecryptFlags)flags
  28.134 +                                  status:(PEPStatus * _Nullable)status
  28.135                                     error:(NSError * _Nullable * _Nullable)error
  28.136  {
  28.137      PEPInternalSession *session = [PEPSessionProvider session];
  28.138 @@ -304,13 +307,13 @@
  28.139      return [session languageListWithError:error];
  28.140  }
  28.141  
  28.142 -- (PEP_rating)ratingFromString:(NSString * _Nonnull)string
  28.143 +- (PEPRating)ratingFromString:(NSString * _Nonnull)string
  28.144  {
  28.145      PEPInternalSession *session = [PEPSessionProvider session];
  28.146      return [session ratingFromString:string];
  28.147  }
  28.148  
  28.149 -- (NSString * _Nonnull)stringFromRating:(PEP_rating)rating
  28.150 +- (NSString * _Nonnull)stringFromRating:(PEPRating)rating
  28.151  {
  28.152      PEPInternalSession *session = [PEPSessionProvider session];
  28.153      return [session stringFromRating:rating];
  28.154 @@ -336,7 +339,7 @@
  28.155      return [session configurePassiveModeEnabled:enabled];
  28.156  }
  28.157  
  28.158 -- (BOOL)setFlags:(identity_flags_t)flags
  28.159 +- (BOOL)setFlags:(PEPIdentityFlags)flags
  28.160       forIdentity:(PEPIdentity *)identity
  28.161             error:(NSError * _Nullable * _Nullable)error
  28.162  {
  28.163 @@ -351,7 +354,7 @@
  28.164      return [session trustOwnKeyIdentity:identity error:error];
  28.165  }
  28.166  
  28.167 -- (BOOL)deliverHandshakeResult:(sync_handshake_result)result
  28.168 +- (BOOL)deliverHandshakeResult:(PEPSyncHandshakeResult)result
  28.169                      forPartner:(PEPIdentity * _Nonnull)partner
  28.170                           error:(NSError * _Nullable * _Nullable)error
  28.171  {
  28.172 @@ -359,4 +362,10 @@
  28.173      return [session deliverHandshakeResult:result forPartner:partner error:error];
  28.174  }
  28.175  
  28.176 +- (PEPColor)colorFromRating:(PEPRating)rating
  28.177 +{
  28.178 +    PEPInternalSession *session = [PEPSessionProvider session];
  28.179 +    return [session colorFromRating:rating];
  28.180 +}
  28.181 +
  28.182  @end
    29.1 --- a/pEpObjCAdapter/PEPSessionProtocol.h	Wed Feb 20 09:18:34 2019 +0100
    29.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    29.3 @@ -1,263 +0,0 @@
    29.4 -//
    29.5 -//  PEPSessionProtocol.h
    29.6 -//  pEpObjCAdapter
    29.7 -//
    29.8 -//  Created by Dirk Zimmermann on 30.10.17.
    29.9 -//  Copyright © 2017 p≡p. All rights reserved.
   29.10 -//
   29.11 -
   29.12 -#import <Foundation/Foundation.h>
   29.13 -
   29.14 -#import "PEPMessageUtil.h"
   29.15 -
   29.16 -#import "sync_api.h"
   29.17 -
   29.18 -typedef NSDictionary<NSString *, id> PEPDict;
   29.19 -typedef NSMutableDictionary<NSString *, id> PEPMutableDict;
   29.20 -typedef NSArray<NSString *> PEPStringList;
   29.21 -
   29.22 -@class PEPLanguage;
   29.23 -@class PEPIdentity;
   29.24 -@class PEPMessage;
   29.25 -
   29.26 -@protocol PEPSessionProtocol <NSObject>
   29.27 -
   29.28 -/** Decrypt a message */
   29.29 -- (PEPDict * _Nullable)decryptMessageDict:(PEPMutableDict * _Nonnull)messageDict
   29.30 -                                    flags:(PEP_decrypt_flags * _Nullable)flags
   29.31 -                                   rating:(PEP_rating * _Nullable)rating
   29.32 -                                extraKeys:(PEPStringList * _Nullable * _Nullable)extraKeys
   29.33 -                                   status:(PEP_STATUS * _Nullable)status
   29.34 -                                    error:(NSError * _Nullable * _Nullable)error __deprecated;
   29.35 -
   29.36 -/** Decrypt a message */
   29.37 -- (PEPMessage * _Nullable)decryptMessage:(PEPMessage * _Nonnull)message
   29.38 -                                   flags:(PEP_decrypt_flags * _Nullable)flags
   29.39 -                                  rating:(PEP_rating * _Nullable)rating
   29.40 -                               extraKeys:(PEPStringList * _Nullable * _Nullable)extraKeys
   29.41 -                                  status:(PEP_STATUS * _Nullable)status
   29.42 -                                   error:(NSError * _Nullable * _Nullable)error;
   29.43 -
   29.44 -/** Re-evaluate rating of decrypted message */
   29.45 -- (BOOL)reEvaluateMessageDict:(PEPDict * _Nonnull)messageDict
   29.46 -                     xKeyList:(PEPStringList *_Nullable)xKeyList
   29.47 -                       rating:(PEP_rating * _Nonnull)rating
   29.48 -                       status:(PEP_STATUS * _Nullable)status
   29.49 -                        error:(NSError * _Nullable * _Nullable)error __deprecated;
   29.50 -
   29.51 -/** Re-evaluate rating of decrypted message */
   29.52 -- (BOOL)reEvaluateMessage:(PEPMessage * _Nonnull)message
   29.53 -                 xKeyList:(PEPStringList *_Nullable)xKeyList
   29.54 -                   rating:(PEP_rating * _Nonnull)rating
   29.55 -                   status:(PEP_STATUS * _Nullable)status
   29.56 -                    error:(NSError * _Nullable * _Nullable)error;
   29.57 -
   29.58 -/**
   29.59 - Encrypt a message dictionary, indicating the encoding format.
   29.60 - @note The resulting message dict could be the input one.
   29.61 - */
   29.62 -- (PEPDict * _Nullable)encryptMessageDict:(PEPDict * _Nonnull)messageDict
   29.63 -                                extraKeys:(PEPStringList * _Nullable)extraKeys
   29.64 -                                encFormat:(PEP_enc_format)encFormat
   29.65 -                                   status:(PEP_STATUS * _Nullable)status
   29.66 -                                    error:(NSError * _Nullable * _Nullable)error __deprecated;
   29.67 -
   29.68 -/**
   29.69 - Encrypt a message, indicating the encoding format
   29.70 - @note The resulting message dict could be the input one.
   29.71 - */
   29.72 -- (PEPMessage * _Nullable)encryptMessage:(PEPMessage * _Nonnull)message
   29.73 -                               extraKeys:(PEPStringList * _Nullable)extraKeys
   29.74 -                               encFormat:(PEP_enc_format)encFormat
   29.75 -                                  status:(PEP_STATUS * _Nullable)status
   29.76 -                                   error:(NSError * _Nullable * _Nullable)error;
   29.77 -
   29.78 -/** Encrypt a message with default encryption format (PEP_enc_PEP) */
   29.79 -- (PEPMessage * _Nullable)encryptMessage:(PEPMessage * _Nonnull)message
   29.80 -                               extraKeys:(PEPStringList * _Nullable)extraKeys
   29.81 -                                  status:(PEP_STATUS * _Nullable)status
   29.82 -                                   error:(NSError * _Nullable * _Nullable)error;
   29.83 -
   29.84 -/** Encrypt a message dict for the given own identity */
   29.85 -- (PEPDict * _Nullable)encryptMessageDict:(PEPDict * _Nonnull)messageDict
   29.86 -                                  forSelf:(PEPIdentity * _Nonnull)ownIdentity
   29.87 -                                extraKeys:(PEPStringList * _Nullable)extraKeys
   29.88 -                                   status:(PEP_STATUS * _Nullable)status
   29.89 -                                    error:(NSError * _Nullable * _Nullable)error __deprecated;
   29.90 -
   29.91 -/** Encrypt a message for the given own identity */
   29.92 -- (PEPMessage * _Nullable)encryptMessage:(PEPMessage * _Nonnull)message
   29.93 -                                 forSelf:(PEPIdentity * _Nonnull)ownIdentity
   29.94 -                               extraKeys:(PEPStringList * _Nullable)extraKeys
   29.95 -                                  status:(PEP_STATUS * _Nullable)status
   29.96 -                                   error:(NSError * _Nullable * _Nullable)error;
   29.97 -
   29.98 -/** Encrypt a message dict to the given recipient FPR, attaching the private key */
   29.99 -- (PEPDict * _Nullable)encryptMessageDict:(PEPDict * _Nonnull)messageDict
  29.100 -                                    toFpr:(NSString * _Nonnull)toFpr
  29.101 -                                encFormat:(PEP_enc_format)encFormat
  29.102 -                                    flags:(PEP_decrypt_flags)flags
  29.103 -                                   status:(PEP_STATUS * _Nullable)status
  29.104 -                                    error:(NSError * _Nullable * _Nullable)error __deprecated;
  29.105 -
  29.106 -/** Encrypt a message dict to the given recipient FPR, attaching the private key */
  29.107 -- (PEPMessage * _Nullable)encryptMessage:(PEPMessage * _Nonnull)message
  29.108 -                                   toFpr:(NSString * _Nonnull)toFpr
  29.109 -                               encFormat:(PEP_enc_format)encFormat
  29.110 -                                   flags:(PEP_decrypt_flags)flags
  29.111 -                                  status:(PEP_STATUS * _Nullable)status
  29.112 -                                   error:(NSError * _Nullable * _Nullable)error;
  29.113 -
  29.114 -/** Determine the status color of a message to be sent */
  29.115 -- (NSNumber * _Nullable)outgoingRatingForMessage:(PEPMessage * _Nonnull)theMessage
  29.116 -                                           error:(NSError * _Nullable * _Nullable)error;
  29.117 -
  29.118 -/** Determine the preview status color of a message to be sent */
  29.119 -- (NSNumber * _Nullable)outgoingRatingPreviewForMessage:(PEPMessage * _Nonnull)theMessage
  29.120 -                                                  error:(NSError * _Nullable * _Nullable)error;
  29.121 -
  29.122 -/**
  29.123 - Determine the rating of an identity.
  29.124 - The rating is the rating a _message_ would have, if it is sent to this (and only this) identity.
  29.125 - It is *not* a rating of the identity. In fact, there is no rating for identities.
  29.126 - */
  29.127 -- (NSNumber * _Nullable)ratingForIdentity:(PEPIdentity * _Nonnull)identity
  29.128 -                                    error:(NSError * _Nullable * _Nullable)error;
  29.129 -
  29.130 -/** Get trustwords for a fingerprint */
  29.131 -- (NSArray * _Nullable)trustwordsForFingerprint:(NSString * _Nonnull)fingerprint
  29.132 -                                     languageID:(NSString * _Nonnull)languageID
  29.133 -                                      shortened:(BOOL)shortened
  29.134 -                                          error:(NSError * _Nullable * _Nullable)error;
  29.135 -
  29.136 -/**
  29.137 - Supply an account used by our user himself. The identity is supplemented with the missing parts
  29.138 -
  29.139 - An identity is a `NSDictionary` mapping a field name as `NSString` to different values.
  29.140 - An identity can have the following fields (all other keys are ignored).
  29.141 - It is not necessary to supply all fields; missing fields are supplemented by p≡p engine.
  29.142 -
  29.143 - @"username": real name or nick name (if pseudonymous) of identity
  29.144 - @"address": URI or SMTP address
  29.145 - @"user_id": persistent unique ID for the *user* that belongs to the identity.
  29.146 -                A user can have multiple identities which all of them MUST use the same user_id.
  29.147 - @"lang": preferred languageID for communication with this ID (default: @"en")
  29.148 - @"fpr": fingerprint of key to use for communication with this ID
  29.149 - @"comm_type": communication type code (usually not needed)
  29.150 -
  29.151 - As an example:
  29.152 -
  29.153 - User has a mailbox. The mail address is "Dipul Khatri <dipul@inboxcube.com>". Then this would be:
  29.154 -
  29.155 - NSDictionary *ident = [NSDictionary dictionaryWithObjectsAndKeys:
  29.156 - @"Dipul Khatri", @"username", @"dipul@inboxcube.com", @"address",
  29.157 - @"23", @"user_id", nil];
  29.158 -
  29.159 - */
  29.160 -- (BOOL)mySelf:(PEPIdentity * _Nonnull)identity error:(NSError * _Nullable * _Nullable)error;
  29.161 -
  29.162 -/**
  29.163 - Supplement missing information for an arbitrary identity (used for communication partners).
  29.164 - Will call the engine's myself() or update_identity() internally, depending on the given
  29.165 - identity.
  29.166 - */
  29.167 -- (BOOL)updateIdentity:(PEPIdentity * _Nonnull)identity
  29.168 -                 error:(NSError * _Nullable * _Nullable)error;
  29.169 -
  29.170 -/**
  29.171 - Mark a key as trusted with a person.
  29.172 - See `mySelf:(NSMutableDictionary *)identity` for an explanation of identities.
  29.173 - */
  29.174 -- (BOOL)trustPersonalKey:(PEPIdentity * _Nonnull)identity
  29.175 -                   error:(NSError * _Nullable * _Nullable)error;
  29.176 -
  29.177 -/**
  29.178 - if a key is not trusted by the user tell this using this message
  29.179 - See `mySelf:(NSMutableDictionary *)identity` for an explanation of identities.
  29.180 - */
  29.181 -- (BOOL)keyMistrusted:(PEPIdentity * _Nonnull)identity
  29.182 -                error:(NSError * _Nullable * _Nullable)error;
  29.183 -
  29.184 -/**
  29.185 - Use this to undo keyCompromized or trustPersonalKey
  29.186 - See `mySelf:(NSMutableDictionary *)identity` for an explanation of identities.
  29.187 - */
  29.188 -- (BOOL)keyResetTrust:(PEPIdentity * _Nonnull)identity
  29.189 -                error:(NSError * _Nullable * _Nullable)error;
  29.190 -
  29.191 -#pragma mark -- Internal API (testing etc.)
  29.192 -
  29.193 -/** For testing purpose, manual key import */
  29.194 -- (NSArray<PEPIdentity *> * _Nullable)importKey:(NSString * _Nonnull)keydata
  29.195 -                                          error:(NSError * _Nullable * _Nullable)error;
  29.196 -
  29.197 -- (BOOL)logTitle:(NSString * _Nonnull)title
  29.198 -          entity:(NSString * _Nonnull)entity
  29.199 -     description:(NSString * _Nullable)description
  29.200 -         comment:(NSString * _Nullable)comment
  29.201 -           error:(NSError * _Nullable * _Nullable)error;
  29.202 -
  29.203 -/**
  29.204 - Retrieves the log from the engine, or nil, if there is nothing yet.
  29.205 - */
  29.206 -- (NSString * _Nullable)getLogWithError:(NSError * _Nullable * _Nullable)error;
  29.207 -
  29.208 -/** Determine trustwords for two identities */
  29.209 -- (NSString * _Nullable)getTrustwordsIdentity1:(PEPIdentity * _Nonnull)identity1
  29.210 -                                     identity2:(PEPIdentity * _Nonnull)identity2
  29.211 -                                      language:(NSString * _Nullable)language
  29.212 -                                          full:(BOOL)full
  29.213 -                                         error:(NSError * _Nullable * _Nullable)error;
  29.214 -
  29.215 -/**
  29.216 - @returns The list of supported languages for trustwords.
  29.217 - */
  29.218 -- (NSArray<PEPLanguage *> * _Nullable)languageListWithError:(NSError * _Nullable * _Nullable)error;
  29.219 -
  29.220 -/**
  29.221 - Can convert a string like "cannot_decrypt" into its equivalent PEP_rating_cannot_decrypt.
  29.222 - */
  29.223 -- (PEP_rating)ratingFromString:(NSString * _Nonnull)string;
  29.224 -
  29.225 -/**
  29.226 - Can convert a pEp rating like PEP_rating_cannot_decrypt
  29.227 - into its equivalent string "cannot_decrypt" .
  29.228 - */
  29.229 -- (NSString * _Nonnull)stringFromRating:(PEP_rating)rating;
  29.230 -
  29.231 -/**
  29.232 - Is the given identity really a pEp user?
  29.233 - If the engine indicates an error, or the identity is not a pEp user, returns false.
  29.234 - */
  29.235 -- (NSNumber * _Nullable)isPEPUser:(PEPIdentity * _Nonnull)identity
  29.236 -                            error:(NSError * _Nullable * _Nullable)error;
  29.237 -
  29.238 -/**
  29.239 - When (manually) importing (secret) keys, associate them with the given own identity.
  29.240 - */
  29.241 -- (BOOL)setOwnKey:(PEPIdentity * _Nonnull)identity fingerprint:(NSString * _Nonnull)fingerprint
  29.242 -            error:(NSError * _Nullable * _Nullable)error;
  29.243 -
  29.244 -/**
  29.245 - Wraps the engine's `config_passive_mode`.
  29.246 - */
  29.247 -- (void)configurePassiveModeEnabled:(BOOL)enabled;
  29.248 -
  29.249 -/**
  29.250 - Wraps set_identity_flags
  29.251 - */
  29.252 -- (BOOL)setFlags:(identity_flags_t)flags
  29.253 -     forIdentity:(PEPIdentity * _Nonnull)identity
  29.254 -           error:(NSError * _Nullable * _Nullable)error;
  29.255 -
  29.256 -- (BOOL)deliverHandshakeResult:(sync_handshake_result)result
  29.257 -                    forPartner:(PEPIdentity * _Nonnull)partner
  29.258 -                         error:(NSError * _Nullable * _Nullable)error;
  29.259 -
  29.260 -/**
  29.261 - Wraps trust_own_key
  29.262 - */
  29.263 -- (BOOL)trustOwnKeyIdentity:(PEPIdentity *)identity
  29.264 -                      error:(NSError * _Nullable * _Nullable)error;
  29.265 -
  29.266 -@end
    30.1 --- a/pEpObjCAdapter/PEPSync.m	Wed Feb 20 09:18:34 2019 +0100
    30.2 +++ b/pEpObjCAdapter/PEPSync.m	Thu Mar 21 12:37:32 2019 +0100
    30.3 @@ -15,7 +15,7 @@
    30.4  #import "PEPQueue.h"
    30.5  #import "PEPLock.h"
    30.6  #import "PEPObjCAdapter.h"
    30.7 -#import "NSError+PEP.h"
    30.8 +#import "NSError+PEP+Internal.h"
    30.9  #import "PEPSessionProvider.h"
   30.10  #import "PEPInternalSession.h"
   30.11  
   30.12 @@ -131,7 +131,7 @@
   30.13  
   30.14      if (status != PEP_STATUS_OK) {
   30.15          if (error) {
   30.16 -            *error = [NSError errorWithPEPStatus:status];
   30.17 +            *error = [NSError errorWithPEPStatusInternal:status];
   30.18          }
   30.19          return nil;
   30.20      }
    31.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    31.2 +++ b/pEpObjCAdapterFramework/Info.plist	Thu Mar 21 12:37:32 2019 +0100
    31.3 @@ -0,0 +1,22 @@
    31.4 +<?xml version="1.0" encoding="UTF-8"?>
    31.5 +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    31.6 +<plist version="1.0">
    31.7 +<dict>
    31.8 +	<key>CFBundleDevelopmentRegion</key>
    31.9 +	<string>$(DEVELOPMENT_LANGUAGE)</string>
   31.10 +	<key>CFBundleExecutable</key>
   31.11 +	<string>$(EXECUTABLE_NAME)</string>
   31.12 +	<key>CFBundleIdentifier</key>
   31.13 +	<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
   31.14 +	<key>CFBundleInfoDictionaryVersion</key>
   31.15 +	<string>6.0</string>
   31.16 +	<key>CFBundleName</key>
   31.17 +	<string>$(PRODUCT_NAME)</string>
   31.18 +	<key>CFBundlePackageType</key>
   31.19 +	<string>FMWK</string>
   31.20 +	<key>CFBundleShortVersionString</key>
   31.21 +	<string>1.0</string>
   31.22 +	<key>CFBundleVersion</key>
   31.23 +	<string>$(CURRENT_PROJECT_VERSION)</string>
   31.24 +</dict>
   31.25 +</plist>
    32.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    32.2 +++ b/pEpObjCAdapterFramework/NSDictionary+CommType.h	Thu Mar 21 12:37:32 2019 +0100
    32.3 @@ -0,0 +1,21 @@
    32.4 +//
    32.5 +//  NSDictionary+Extension.h
    32.6 +//  pEpObjCAdapter
    32.7 +//
    32.8 +//  Created by Dirk Zimmermann on 04.09.17.
    32.9 +//  Copyright © 2017 p≡p. All rights reserved.
   32.10 +//
   32.11 +
   32.12 +#import <Foundation/Foundation.h>
   32.13 +
   32.14 +#import "PEPEngineTypes.h"
   32.15 +
   32.16 +@interface NSDictionary (CommType)
   32.17 +
   32.18 +/**
   32.19 + If we interpret the self as a dictionary denoting a p≡p Identity,
   32.20 + does the comm type denote a PGP user?
   32.21 + */
   32.22 +@property (nonatomic, readonly) PEPCommType commType;
   32.23 +
   32.24 +@end
    33.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    33.2 +++ b/pEpObjCAdapterFramework/NSNumber+PEPRating.h	Thu Mar 21 12:37:32 2019 +0100
    33.3 @@ -0,0 +1,25 @@
    33.4 +//
    33.5 +//  NSNumber+PEPRating.h
    33.6 +//  pEpObjCAdapter
    33.7 +//
    33.8 +//  Created by Dirk Zimmermann on 13.04.18.
    33.9 +//  Copyright © 2018 p≡p. All rights reserved.
   33.10 +//
   33.11 +
   33.12 +#import <Foundation/Foundation.h>
   33.13 +
   33.14 +#import "PEPTypes.h"
   33.15 +#import "PEPEngineTypes.h"
   33.16 +
   33.17 +/**
   33.18 + Extension for wrapping the engine's PEP_rating inside a NSNumber.
   33.19 + */
   33.20 +@interface NSNumber (Extension)
   33.21 +
   33.22 +@property (nonatomic, readonly) PEPRating pEpRating;
   33.23 +
   33.24 +- initWithPEPRating:(PEPRating)pEpRating;
   33.25 +
   33.26 ++ (NSNumber *)numberWithPEPRating:(PEPRating)pEpRating;
   33.27 +
   33.28 +@end
    34.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    34.2 +++ b/pEpObjCAdapterFramework/PEPAttachment.h	Thu Mar 21 12:37:32 2019 +0100
    34.3 @@ -0,0 +1,23 @@
    34.4 +//
    34.5 +//  PEPAttachment.h
    34.6 +//  pEpObjCAdapter
    34.7 +//
    34.8 +//  Created by Dirk Zimmermann on 16.04.18.
    34.9 +//  Copyright © 2018 p≡p. All rights reserved.
   34.10 +//
   34.11 +
   34.12 +#import <Foundation/Foundation.h>
   34.13 +
   34.14 +#import "PEPEngineTypes.h"
   34.15 +
   34.16 +@interface PEPAttachment : NSObject
   34.17 +
   34.18 +@property (nonatomic) NSData *data;
   34.19 +@property (nonatomic) NSInteger size;
   34.20 +@property (nonatomic, nullable) NSString *mimeType;
   34.21 +@property (nonatomic, nullable) NSString *filename;
   34.22 +@property (nonatomic) PEPContentDisposition contentDisposition;
   34.23 +
   34.24 +- (_Nonnull instancetype)initWithData:(NSData *)data;
   34.25 +
   34.26 +@end
    35.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    35.2 +++ b/pEpObjCAdapterFramework/PEPConstants.h	Thu Mar 21 12:37:32 2019 +0100
    35.3 @@ -0,0 +1,97 @@
    35.4 +//
    35.5 +//  PEPConstants.h
    35.6 +//  PEPObjCAdapterFramework
    35.7 +//
    35.8 +//  Created by Dirk Zimmermann on 01.03.19.
    35.9 +//  Copyright © 2019 p≡p. All rights reserved.
   35.10 +//
   35.11 +
   35.12 +#import <Foundation/Foundation.h>
   35.13 +
   35.14 +#pragma mark - Constants
   35.15 +
   35.16 +/** The name of the user */
   35.17 +extern NSString *const _Nonnull kPepUsername;
   35.18 +
   35.19 +/** Email address of the contact */
   35.20 +extern NSString *const _Nonnull kPepAddress;
   35.21 +
   35.22 +/**
   35.23 + A user ID, used by pEp to map multiple identities to a single user.
   35.24 + This should be a stable ID.
   35.25 + pEp identities set up with mySelf() get a special user ID.
   35.26 + */
   35.27 +extern NSString *const _Nonnull kPepUserID;
   35.28 +
   35.29 +/**
   35.30 + Dict key for value isOwn/me.
   35.31 + isOwn indicates the identity is representing me.
   35.32 + */
   35.33 +extern NSString *const _Nonnull kPepIsOwn;
   35.34 +
   35.35 +/** The fingerprint for the key for this contact. */
   35.36 +extern NSString *const _Nonnull kPepFingerprint;
   35.37 +
   35.38 +/** In an email, the identity this email is from */
   35.39 +extern NSString *const _Nonnull kPepFrom;
   35.40 +
   35.41 +/** In an email, the `NSArray` of to recipients */
   35.42 +extern NSString *const _Nonnull kPepTo;
   35.43 +
   35.44 +/** In an email, the `NSArray` of CC recipients */
   35.45 +extern NSString *const _Nonnull kPepCC;
   35.46 +
   35.47 +/** In an email, the `NSArray` of BCC recipients */
   35.48 +extern NSString *const _Nonnull kPepBCC;
   35.49 +
   35.50 +/** The subject of an email */
   35.51 +extern NSString *const _Nonnull kPepShortMessage;
   35.52 +
   35.53 +/** The text message of an email */
   35.54 +extern NSString *const _Nonnull kPepLongMessage;
   35.55 +
   35.56 +/** HTML message part, if any */
   35.57 +extern NSString *const _Nonnull kPepLongMessageFormatted;
   35.58 +
   35.59 +/** NSNumber denoting a boolean. True if that message is supposed to be sent. */
   35.60 +extern NSString *const _Nonnull kPepOutgoing;
   35.61 +
   35.62 +/** Sent date of the message (NSDate) */
   35.63 +extern NSString *const _Nonnull kPepSent;
   35.64 +
   35.65 +/** Received date of the message (NSDate) */
   35.66 +extern NSString *const _Nonnull kPepReceived;
   35.67 +
   35.68 +/** The message ID */
   35.69 +extern NSString *const _Nonnull kPepID;
   35.70 +
   35.71 +extern NSString *const _Nonnull kPepReceivedBy;
   35.72 +extern NSString *const _Nonnull kPepReplyTo;
   35.73 +extern NSString *const _Nonnull kPepInReplyTo;
   35.74 +extern NSString *const _Nonnull kPepReferences;
   35.75 +extern NSString *const _Nonnull kPepKeywords;
   35.76 +extern NSString *const _Nonnull kPepOptFields;
   35.77 +
   35.78 +/** NSArray of attachment dicts */
   35.79 +extern NSString *const _Nonnull kPepAttachments;
   35.80 +
   35.81 +/** The pEp internal communication type */
   35.82 +extern NSString *const _Nonnull kPepCommType;
   35.83 +
   35.84 +/** The raw message created by pEp (NSData) */
   35.85 +extern NSString *const _Nonnull kPepRawMessage;
   35.86 +
   35.87 +/** NSError parameters will use this domain */
   35.88 +extern NSString *const _Nonnull PEPSessionErrorDomain;
   35.89 +
   35.90 +/** Optional field "X-pEp-Version" */
   35.91 +extern NSString *const _Nonnull kXpEpVersion;
   35.92 +
   35.93 +/** Optional field "X-EncStatus" */
   35.94 +extern NSString *const _Nonnull kXEncStatus;
   35.95 +
   35.96 +/** Optional field "X-KeyList" */
   35.97 +extern NSString *const _Nonnull kXKeylist;
   35.98 +
   35.99 +/** Key for the boolean flag that denotes own identities */
  35.100 +extern NSString *const _Nonnull kPepIsOwnIdentity;
    36.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    36.2 +++ b/pEpObjCAdapterFramework/PEPConstants.m	Thu Mar 21 12:37:32 2019 +0100
    36.3 @@ -0,0 +1,64 @@
    36.4 +//
    36.5 +//  PEPConstants.m
    36.6 +//  PEPObjCAdapterFramework
    36.7 +//
    36.8 +//  Created by Dirk Zimmermann on 01.03.19.
    36.9 +//  Copyright © 2019 p≡p. All rights reserved.
   36.10 +//
   36.11 +
   36.12 +#import "PEPConstants.h"
   36.13 +
   36.14 +#pragma mark - Constants
   36.15 +
   36.16 +NSString *const kPepUsername = @"username";
   36.17 +
   36.18 +NSString *const kPepAddress = @"address";
   36.19 +
   36.20 +NSString *const kPepUserID = @"user_id";
   36.21 +
   36.22 +NSString *const kPepIsOwn = @"isOwn";
   36.23 +
   36.24 +NSString *const kPepFingerprint = @"fpr";
   36.25 +
   36.26 +NSString *const kPepFrom = @"from";
   36.27 +
   36.28 +NSString *const kPepTo = @"to";
   36.29 +
   36.30 +NSString *const kPepCC = @"cc";
   36.31 +
   36.32 +NSString *const kPepBCC = @"bcc";
   36.33 +
   36.34 +NSString *const kPepShortMessage = @"shortmsg";
   36.35 +
   36.36 +NSString *const kPepLongMessage = @"longmsg";
   36.37 +
   36.38 +NSString *const kPepLongMessageFormatted = @"longmsg_formatted";
   36.39 +
   36.40 +NSString *const kPepOutgoing = @"outgoing";
   36.41 +
   36.42 +NSString *const kPepSent = @"sent";
   36.43 +
   36.44 +NSString *const kPepReceived = @"recv";
   36.45 +
   36.46 +NSString *const kPepID = @"id";
   36.47 +
   36.48 +NSString *const kPepReceivedBy = @"recv_by";
   36.49 +NSString *const kPepReplyTo = @"reply_to";
   36.50 +NSString *const kPepInReplyTo = @"in_reply_to";
   36.51 +NSString *const kPepReferences = @"references";
   36.52 +NSString *const kPepKeywords = @"keywords";
   36.53 +NSString *const kPepOptFields = @"opt_fields";
   36.54 +
   36.55 +NSString *const kPepAttachments = @"attachments";
   36.56 +
   36.57 +NSString *const kPepCommType = @"comm_type";
   36.58 +
   36.59 +NSString *const kPepRawMessage = @"raw_message";
   36.60 +
   36.61 +NSString *const kXpEpVersion = @"X-pEp-Version";
   36.62 +
   36.63 +NSString *const kXEncStatus = @"X-EncStatus";
   36.64 +
   36.65 +NSString *const kXKeylist = @"X-KeyList";
   36.66 +
   36.67 +NSString *const _Nonnull kPepIsOwnIdentity = @"kPepIsOwnIdentity";
    37.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    37.2 +++ b/pEpObjCAdapterFramework/PEPEngineTypes.h	Thu Mar 21 12:37:32 2019 +0100
    37.3 @@ -0,0 +1,240 @@
    37.4 +//
    37.5 +//  PEPTypes.h
    37.6 +//  pEpObjCAdapter
    37.7 +//
    37.8 +//  Created by Dirk Zimmermann on 27.02.19.
    37.9 +//  Copyright © 2019 p≡p. All rights reserved.
   37.10 +//
   37.11 +
   37.12 +#ifndef PEPTypes_h
   37.13 +#define PEPTypes_h
   37.14 +
   37.15 +#import <Foundation/Foundation.h>
   37.16 +
   37.17 +typedef NS_ENUM(NSUInteger, PEPDecryptFlags) {
   37.18 +    PEPDecryptFlagsNone = 0x1, // This defined only in the adpater, not the engine.
   37.19 +    PEPDecryptFlagsOwnPrivateKey = 0x1, // PEP_decrypt_flag_own_private_key = 0x1,
   37.20 +    PEPDecryptFlagsConsume = 0x2, // PEP_decrypt_flag_consume = 0x2,
   37.21 +    PEPDecryptFlagsIgnore = 0x4, // PEP_decrypt_flag_ignore = 0x4,
   37.22 +    PEPDecryptFlagsSrcModified = 0x8, // PEP_decrypt_flag_src_modified = 0x8,
   37.23 +    // input flags
   37.24 +    PEPDecryptFlagsUntrustedServer = 0x100 // PEP_decrypt_flag_untrusted_server = 0x100
   37.25 +}; // PEP_decrypt_flags;
   37.26 +
   37.27 +typedef NS_ENUM(NSUInteger, PEPEncFormat) {
   37.28 +    PEPEncFormatNone = 0, // PEP_enc_none = 0, // message is not encrypted
   37.29 +    PEPEncFormatPieces, // PEP_enc_pieces, // inline PGP + PGP extensions
   37.30 +    PEPEncFormatSMIME, // PEP_enc_S_MIME, // RFC5751
   37.31 +    PEPEncFormatPgpMIME, // PEP_enc_PGP_MIME, // RFC3156
   37.32 +    PEPEncFormatPEP, // PEP_enc_PEP, // pEp encryption format
   37.33 +    PEPEncFormatPgpMIMEOutlook1 // PEP_enc_PGP_MIME_Outlook1 // Message B0rken by Outlook type 1
   37.34 +};
   37.35 +
   37.36 +typedef NS_ENUM(NSInteger, PEPRating) {
   37.37 +    PEPRatingUndefined = 0,// PEP_rating_undefined = 0,
   37.38 +    PEPRatingCannotDecrypt, // PEP_rating_cannot_decrypt,
   37.39 +    PEPRatingHaveNoKey, // PEP_rating_have_no_key,
   37.40 +    PEPRatingUnencrypted, // PEP_rating_unencrypted,
   37.41 +    PEPRatingUnencryptedForSome, // PEP_rating_unencrypted_for_some, // don't use this any more
   37.42 +    PEPRatingUnreliable, // PEP_rating_unreliable,
   37.43 +    PEPRatingReliable, // PEP_rating_reliable,
   37.44 +    PEPRatingTrusted, // PEP_rating_trusted,
   37.45 +    PEPRatingTrustedAndAnonymized, // PEP_rating_trusted_and_anonymized,
   37.46 +    PEPRatingFullyAnonymous, // PEP_rating_fully_anonymous,
   37.47 +
   37.48 +    PEPRatingMistrust = -1, // PEP_rating_mistrust = -1,
   37.49 +    PEPRatingB0rken = -2, // PEP_rating_b0rken = -2,
   37.50 +    PEPRatingUnderAttack = -3 // PEP_rating_under_attack = -3
   37.51 +};
   37.52 +
   37.53 +typedef NS_ENUM(NSInteger, PEPStatus) {
   37.54 +    PEPStatusOK                                   = 0, // PEP_STATUS_OK
   37.55 +
   37.56 +    PEPStatusInitCannotLoadGPME                      = 0x0110, // PEP_INIT_CANNOT_LOAD_GPGME
   37.57 +    PEPStatusInitGPGMEInitFailed                      = 0x0111, // PEP_INIT_GPGME_INIT_FAILED
   37.58 +    PEPStatusInitNoGPGHome                            = 0x0112, // PEP_INIT_NO_GPG_HOME
   37.59 +    PEPStatusInitNETPGPInitFailed                     = 0x0113, // PEP_INIT_NETPGP_INIT_FAILED
   37.60 +    PEPStatusInitCannotDetermineGPGVersion           = 0x0114, // PEP_INIT_CANNOT_DETERMINE_GPG_VERSION
   37.61 +    PEPStatusInitUnsupportedGPGVersion                = 0x0115, // PEP_INIT_UNSUPPORTED_GPG_VERSION
   37.62 +    PEPStatusInitCannotConfigGPGAgent                = 0x0116, // PEP_INIT_CANNOT_CONFIG_GPG_AGENT
   37.63 +
   37.64 +    PEPStatusInitSqlite3WithoutMutex                  = 0x0120, // PEP_INIT_SQLITE3_WITHOUT_MUTEX
   37.65 +    PEPStatusInitCannotOpenDB                         = 0x0121, // PEP_INIT_CANNOT_OPEN_DB
   37.66 +    PEPStatusInitCannotOpenSystemDB                  = 0x0122, // PEP_INIT_CANNOT_OPEN_SYSTEM_DB
   37.67 +    PEPStatusUnknownDBError                            = 0x01ff, // PEP_UNKNOWN_DB_ERROR
   37.68 +
   37.69 +    PEPStatusKeyNotFound                               = 0x0201, // PEP_KEY_NOT_FOUND
   37.70 +    PEPStatusKeyHasAmbigName                          = 0x0202, // PEP_KEY_HAS_AMBIG_NAME
   37.71 +    PEPStatusGetKeyFailed                              = 0x0203, // PEP_GET_KEY_FAILED
   37.72 +    PEPStatusCannotExportKey                           = 0x0204, // PEP_CANNOT_EXPORT_KEY
   37.73 +    PEPStatusCannotEditKey                             = 0x0205, // PEP_CANNOT_EDIT_KEY
   37.74 +    PEPStatusKeyUnsuitable                              = 0x0206, // PEP_KEY_UNSUITABLE
   37.75 +    PEPStatusMalformedKeyResetMsg                     = 0x0210, // PEP_MALFORMED_KEY_RESET_MSG
   37.76 +    PEPStatusKeyNotReset                               = 0x0211, // PEP_KEY_NOT_RESET
   37.77 +
   37.78 +    PEPStatusKeyImported                                = 0x0220, // PEP_KEY_IMPORTED
   37.79 +    PEPStatusNoKeyImported                             = 0x0221, // PEP_NO_KEY_IMPORTED
   37.80 +    PEPStatusKeyImportStatusUnknown                   = 0x0222, // PEP_KEY_IMPORT_STATUS_UNKNOWN
   37.81 +
   37.82 +    PEPStatusCannotFindIdentity                        = 0x0301, // PEP_CANNOT_FIND_IDENTITY
   37.83 +    PEPStatusCannotSetPerson                           = 0x0381, // PEP_CANNOT_SET_PERSON
   37.84 +    PEPStatusCannotSetPGPKeyPair                      = 0x0382, // PEP_CANNOT_SET_PGP_KEYPAIR
   37.85 +    PEPStatusCannotSetIdentity                         = 0x0383, // PEP_CANNOT_SET_IDENTITY
   37.86 +    PEPStatusCannotSetTrust                            = 0x0384, // PEP_CANNOT_SET_TRUST
   37.87 +    PEPStatusKeyBlacklisted                             = 0x0385, // PEP_KEY_BLACKLISTED
   37.88 +    PEPStatusCannotFindPerson                          = 0x0386, // PEP_CANNOT_FIND_PERSON
   37.89 +
   37.90 +    PEPStatusCannotFindAlias                           = 0x0391, // PEP_CANNOT_FIND_ALIAS
   37.91 +    PEPStatusCannotSetAlias                            = 0x0392, // PEP_CANNOT_SET_ALIAS
   37.92 +
   37.93 +    PEPStatusUnencrypted                                 = 0x0400, // PEP_UNENCRYPTED
   37.94 +    PEPStatusVerified                                    = 0x0401, // PEP_VERIFIED
   37.95 +    PEPStatusDecrypted                                   = 0x0402, // PEP_DECRYPTED
   37.96 +    PEPStatusDecryptedAndVerified                      = 0x0403, // PEP_DECRYPTED_AND_VERIFIED
   37.97 +    PEPStatusDecryptWrongFormat                        = 0x0404, // PEP_DECRYPT_WRONG_FORMAT
   37.98 +    PEPStatusDecryptNoKey                              = 0x0405, // PEP_DECRYPT_NO_KEY
   37.99 +    PEPStatusDecryptSignatureDoesNotMatch            = 0x0406, // PEP_DECRYPT_SIGNATURE_DOES_NOT_MATCH
  37.100 +    PEPStatusVerifyNoKey                               = 0x0407, // PEP_VERIFY_NO_KEY
  37.101 +    PEPStatusVerifiedAndTrusted                        = 0x0408, // PEP_VERIFIED_AND_TRUSTED
  37.102 +    PEPStatusCannotReencrypt                            = 0x0409, // PEP_CANNOT_REENCRYPT
  37.103 +    PEPStatusCannotDecryptUnknown                      = 0x04ff, // PEP_CANNOT_DECRYPT_UNKNOWN
  37.104 +
  37.105 +    PEPStatusTrustwordNotFound                         = 0x0501, // PEP_TRUSTWORD_NOT_FOUND
  37.106 +    PEPStatusTrustwordsFPRWrongLength                 = 0x0502, // PEP_TRUSTWORDS_FPR_WRONG_LENGTH
  37.107 +    PEPStatusTrustwordsDuplicateFPR                    = 0x0503, // PEP_TRUSTWORDS_DUPLICATE_FPR
  37.108 +
  37.109 +    PEPStatusCannotCreateKey                           = 0x0601, // PEP_CANNOT_CREATE_KEY
  37.110 +    PEPStatusCannotSendKey                             = 0x0602, // PEP_CANNOT_SEND_KEY
  37.111 +
  37.112 +    PEPStatusPhraseNotFound                            = 0x0701, // PEP_PHRASE_NOT_FOUND
  37.113 +
  37.114 +    PEPStatusSendFunctionNotRegistered                = 0x0801, // PEP_SEND_FUNCTION_NOT_REGISTERED
  37.115 +    PEPStatusConstraintsViolated                         = 0x0802, // PEP_CONTRAINTS_VIOLATED
  37.116 +    PEPStatusCannotEncode                               = 0x0803, // PEP_CANNOT_ENCODE
  37.117 +
  37.118 +    PEPStatusSyncNoNotifyCallback                     = 0x0901, // PEP_SYNC_NO_NOTIFY_CALLBACK
  37.119 +    PEPStatusSyncIllegalMessage                        = 0x0902, // PEP_SYNC_ILLEGAL_MESSAGE
  37.120 +    PEPStatusSyncNoInjectCallback                     = 0x0903, // PEP_SYNC_NO_INJECT_CALLBACK
  37.121 +    PEPStatusSyncNoChannel                             = 0x0904, // PEP_SYNC_NO_CHANNEL
  37.122 +    PEPStatusSyncCannotEncrypt                         = 0x0905, // PEP_SYNC_CANNOT_ENCRYPT
  37.123 +    PEPStatusSyncNoMessageSendCallback               = 0x0906, // PEP_SYNC_NO_MESSAGE_SEND_CALLBACK
  37.124 +
  37.125 +    PEPStatusCannotIncreaseSequence                    = 0x0971, // PEP_CANNOT_INCREASE_SEQUENCE
  37.126 +
  37.127 +    PEPStatusStatemachineError                          = 0x0980, // PEP_STATEMACHINE_ERROR
  37.128 +    PEPStatusNoTrust                                    = 0x0981, // PEP_NO_TRUST
  37.129 +    PEPStatusStatemachineInvalidState                  = 0x0982, // PEP_STATEMACHINE_INVALID_STATE
  37.130 +    PEPStatusStatemachineInvalidEvent                  = 0x0983, // PEP_STATEMACHINE_INVALID_EVENT
  37.131 +    PEPStatusStatemachineInvalidCondition              = 0x0984, // PEP_STATEMACHINE_INVALID_CONDITION
  37.132 +    PEPStatusStatemachineInvalidAction                 = 0x0985, // PEP_STATEMACHINE_INVALID_ACTION
  37.133 +    PEPStatusStatemachineInhibitedEvent                = 0x0986, // PEP_STATEMACHINE_INHIBITED_EVENT
  37.134 +    PEPStatusStatemachineCannotSend                    = 0x0987, // PEP_STATEMACHINE_CANNOT_SEND
  37.135 +
  37.136 +    PEPStatusCommitFailed                               = 0xff01, // PEP_COMMIT_FAILED
  37.137 +    PEPStatusMessageConsume                             = 0xff02, // PEP_MESSAGE_CONSUME
  37.138 +    PEPStatusMessageIgnore                              = 0xff03, // PEP_MESSAGE_IGNORE
  37.139 +
  37.140 +    PEPStatusRecordNotFound                            = -6, // PEP_RECORD_NOT_FOUND
  37.141 +    PEPStatusCannotCreateTempFile                     = -5, // PEP_CANNOT_CREATE_TEMP_FILE
  37.142 +    PEPStatusIllegalValue                               = -4, // PEP_ILLEGAL_VALUE
  37.143 +    PEPStatusBufferTooSmall                            = -3, // PEP_BUFFER_TOO_SMALL
  37.144 +    PEPStatusOutOfMemory                               = -2, // PEP_OUT_OF_MEMORY
  37.145 +    PEPStatusUnknownError                               = -1, // PEP_UNKNOWN_ERROR
  37.146 +
  37.147 +    PEPStatusVersionMismatch                            = -7, // PEP_VERSION_MISMATCH
  37.148 +};
  37.149 +
  37.150 +typedef NS_ENUM(NSUInteger, PEPIdentityFlags) {
  37.151 +    // the first octet flags are app defined settings
  37.152 +    PEPIdentityFlagsNotForSync = 0x0001, // PEP_idf_not_for_sync = 0x0001,   // don't use this identity for sync
  37.153 +    PEPIdentityFlagsList = 0x0002, // PEP_idf_list = 0x0002,           // identity of list of persons
  37.154 +    // the second octet flags are calculated
  37.155 +    PEPIdentityFlagsDeviceGroup = 0x0100 // PEP_idf_devicegroup = 0x0100     // identity of a device group member
  37.156 +};
  37.157 +
  37.158 +typedef NS_ENUM(NSInteger, PEPSyncHandshakeResult) {
  37.159 +    PEPSyncHandshakeResultCancel = -1, // SYNC_HANDSHAKE_CANCEL = -1,
  37.160 +    PEPSyncHandshakeResultAccepted = 0, // SYNC_HANDSHAKE_ACCEPTED = 0,
  37.161 +    PEPSyncHandshakeResultRejected = 1 // SYNC_HANDSHAKE_REJECTED = 1
  37.162 +};
  37.163 +
  37.164 +typedef NS_ENUM(NSUInteger, PEPCommType) {
  37.165 +    PEPCommTypeUnknown = 0, // PEP_ct_unknown = 0,
  37.166 +
  37.167 +    // range 0x01 to 0x09: no encryption, 0x0a to 0x0e: nothing reasonable
  37.168 +
  37.169 +    PEPCommTypeNoEncryption = 0x01, // PEP_ct_no_encryption = 0x01,                // generic
  37.170 +    PEPCommTypeNoEncrypted_channel = 0x02, // PEP_ct_no_encrypted_channel = 0x02,
  37.171 +    PEPCommTypeKeyNotFound = 0x03, // PEP_ct_key_not_found = 0x03,
  37.172 +    PEPCommTypeKeyExpired = 0x04, // PEP_ct_key_expired = 0x04,
  37.173 +    PEPCommTypeKeyRevoked = 0x05, // PEP_ct_key_revoked = 0x05,
  37.174 +    PEPCommTypeKeyBr0ken = 0x06, // PEP_ct_key_b0rken = 0x06,
  37.175 +    PEPCommTypeKeyExpiredButConfirmed = 0x07, // PEP_ct_key_expired_but_confirmed = 0x07, // NOT with confirmed bit. Just retaining info here in case of renewal.
  37.176 +    PEPCommTypeMyKeyNotIncluded = 0x09, // PEP_ct_my_key_not_included = 0x09,
  37.177 +
  37.178 +    PEPCommTypeSecurityByObscurity = 0x0a, // PEP_ct_security_by_obscurity = 0x0a,
  37.179 +    PEPCommTypeBr0kenCrypto = 0x0b, // PEP_ct_b0rken_crypto = 0x0b,
  37.180 +    PEPCommTypeKeyTooShort = 0x0c, // PEP_ct_key_too_short = 0x0c,
  37.181 +
  37.182 +    PEPCommTypeCompromised = 0x0e, // PEP_ct_compromized = 0x0e,                  // deprecated misspelling
  37.183 +    PEPCommTypeMistrusted = 0x0f, // PEP_ct_mistrusted = 0x0f,                   // known mistrusted key
  37.184 +
  37.185 +    // range 0x10 to 0x3f: unconfirmed encryption
  37.186 +
  37.187 +    PEPCommTypeUnconfirmedEncryption = 0x10, // PEP_ct_unconfirmed_encryption = 0x10,       // generic
  37.188 +    PEPCommTypeOpenPGPWeakUnconfirmed = 0x11, // PEP_ct_OpenPGP_weak_unconfirmed = 0x11,     // RSA 1024 is weak
  37.189 +
  37.190 +    PEPCommTypeToBeChecked = 0x20, // PEP_ct_to_be_checked = 0x20,                // generic
  37.191 +    PEPCommTypeSMIMEUnconfirmed = 0x21, // PEP_ct_SMIME_unconfirmed = 0x21,
  37.192 +    PEPCommTypeCMSUnconfirmed = 0x22, // PEP_ct_CMS_unconfirmed = 0x22,
  37.193 +
  37.194 +    PEPCommTypeStongButUnconfirmed = 0x30, // PEP_ct_strong_but_unconfirmed = 0x30,       // generic
  37.195 +    PEPCommTypeOpenPGPUnconfirmed = 0x38, // PEP_ct_OpenPGP_unconfirmed = 0x38,          // key at least 2048 bit RSA or EC
  37.196 +    PEPCommTypeOTRUnconfirmed = 0x3a, // PEP_ct_OTR_unconfirmed = 0x3a,
  37.197 +
  37.198 +    // range 0x40 to 0x7f: unconfirmed encryption and anonymization
  37.199 +
  37.200 +    PEPCommTypeUnconfirmedEncAnon = 0x40, // PEP_ct_unconfirmed_enc_anon = 0x40,         // generic
  37.201 +    PEPCommTypePEPUnconfirmed = 0x7f, // PEP_ct_pEp_unconfirmed = 0x7f,
  37.202 +
  37.203 +    PEPCommTypeConfirmed = 0x80, // PEP_ct_confirmed = 0x80,                    // this bit decides if trust is confirmed
  37.204 +
  37.205 +    // range 0x81 to 0x8f: reserved
  37.206 +    // range 0x90 to 0xbf: confirmed encryption
  37.207 +
  37.208 +    PEPCommTypeConfirmedEncryption = 0x90, // PEP_ct_confirmed_encryption = 0x90,         // generic
  37.209 +    PEPCommTypeOpenPGPWeak = 0x91, // PEP_ct_OpenPGP_weak = 0x91,                 // RSA 1024 is weak (unused)
  37.210 +
  37.211 +    PEPCommTypeToBeCheckedConfirmed = 0xa0, // PEP_ct_to_be_checked_confirmed = 0xa0,      // generic
  37.212 +    PEPCommTypeSMIME = 0xa1, // PEP_ct_SMIME = 0xa1,
  37.213 +    PEPCommTypeCMS = 0xa2, // PEP_ct_CMS = 0xa2,
  37.214 +
  37.215 +    PEPCommTypeStongEncryption = 0xb0, // PEP_ct_strong_encryption = 0xb0,            // generic
  37.216 +    PEPCommTypeOpenPGP = 0xb8, // PEP_ct_OpenPGP = 0xb8,                      // key at least 2048 bit RSA or EC
  37.217 +    PEPCommTypeOTR = 0xba, // PEP_ct_OTR = 0xba,
  37.218 +
  37.219 +    // range 0xc0 to 0xff: confirmed encryption and anonymization
  37.220 +
  37.221 +    PEPCommTypeConfirmedEncAnon = 0xc0, // PEP_ct_confirmed_enc_anon = 0xc0,           // generic
  37.222 +    PEPCommTypePEP = 0xff // PEP_ct_pEp = 0xff
  37.223 +};
  37.224 +
  37.225 +typedef NS_ENUM(NSUInteger, PEPMsgDirection) {
  37.226 +    PEPMsgDirectionIncoming = 0,
  37.227 +    PEPMsgDirectionOutgoing
  37.228 +};
  37.229 +
  37.230 +typedef NS_ENUM(NSInteger, PEPColor) {
  37.231 +    PEPColorNoColor = 0,
  37.232 +    PEPColorYellow,
  37.233 +    PEPColorGreen,
  37.234 +    PEPColorRed = -1,
  37.235 +};
  37.236 +
  37.237 +typedef NS_ENUM(NSInteger, PEPContentDisposition) {
  37.238 +    PEPContentDispositionAttachment = 0,
  37.239 +    PEPContentDispositionInline = 1,
  37.240 +    PEPContentDispositionOther = -1      // must be affirmatively set
  37.241 +};
  37.242 +
  37.243 +#endif /* PEPTypes_h */
    38.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    38.2 +++ b/pEpObjCAdapterFramework/PEPIdentity.h	Thu Mar 21 12:37:32 2019 +0100
    38.3 @@ -0,0 +1,108 @@
    38.4 +//
    38.5 +//  PEPIdentity.h
    38.6 +//  pEpObjCAdapter
    38.7 +//
    38.8 +//  Created by Dirk Zimmermann on 30.10.17.
    38.9 +//  Copyright © 2017 p≡p. All rights reserved.
   38.10 +//
   38.11 +
   38.12 +#import <Foundation/Foundation.h>
   38.13 +
   38.14 +#import "PEPSessionProtocol.h"
   38.15 +
   38.16 +@class PEPSession;
   38.17 +
   38.18 +@interface PEPIdentity : NSObject <NSMutableCopying>
   38.19 +
   38.20 +/**
   38.21 + The network address of this identity
   38.22 + */
   38.23 +@property (nonatomic, nonnull) NSString *address;
   38.24 +
   38.25 +/**
   38.26 + The (optional) user ID.
   38.27 + */
   38.28 +@property (nonatomic, nullable) NSString *userID;
   38.29 +
   38.30 +/**
   38.31 + The (optional) user name.
   38.32 + */
   38.33 +@property (nonatomic, nullable) NSString *userName;
   38.34 +
   38.35 +/**
   38.36 + The (optional) fingerprint.
   38.37 + */
   38.38 +@property (nonatomic, nullable) NSString *fingerPrint;
   38.39 +
   38.40 +/**
   38.41 + The (optional) language that this identity uses.
   38.42 + */
   38.43 +@property (nonatomic, nullable) NSString *language;
   38.44 +
   38.45 +/**
   38.46 + The comm type of this identity.
   38.47 + */
   38.48 +@property PEPCommType commType;
   38.49 +
   38.50 +/**
   38.51 + Is this one of our own identities?
   38.52 + */
   38.53 +@property BOOL isOwn;
   38.54 +
   38.55 +/**
   38.56 + Comm type contains the PEP_ct_confirmed flag?
   38.57 + */
   38.58 +@property (readonly) BOOL isConfirmed;
   38.59 +
   38.60 +- (nonnull instancetype)initWithAddress:(NSString * _Nonnull)address
   38.61 +                                 userID:(NSString * _Nullable)userID
   38.62 +                               userName:(NSString * _Nullable)userName
   38.63 +                                  isOwn:(BOOL)isOwn
   38.64 +                            fingerPrint:(NSString * _Nullable)fingerPrint
   38.65 +                               commType:(PEPCommType)commType
   38.66 +                               language:(NSString * _Nullable)language;
   38.67 +
   38.68 +- (nonnull instancetype)initWithAddress:(NSString * _Nonnull)address
   38.69 +                                 userID:(NSString * _Nullable)userID
   38.70 +                               userName:(NSString * _Nullable)userName
   38.71 +                                  isOwn:(BOOL)isOwn
   38.72 +                            fingerPrint:(NSString * _Nullable)fingerPrint;
   38.73 +
   38.74 +- (nonnull instancetype)initWithAddress:(NSString * _Nonnull)address
   38.75 +                                 userID:(NSString * _Nullable)userID
   38.76 +                               userName:(NSString * _Nullable)userName
   38.77 +                                  isOwn:(BOOL)isOwn;
   38.78 +
   38.79 +- (nonnull instancetype)initWithAddress:(NSString * _Nonnull)address;
   38.80 +
   38.81 +- (nonnull instancetype)initWithDictionary:(NSDictionary * _Nonnull)dictionary;
   38.82 +
   38.83 +/**
   38.84 + Copy constructor.
   38.85 + */
   38.86 +- (nonnull instancetype)initWithIdentity:(PEPIdentity * _Nonnull)identity;
   38.87 +
   38.88 +/**
   38.89 + This method should be removed once the adapter fully supports objects for identity
   38.90 + and message types insead of dictionaries.
   38.91 + */
   38.92 +- (PEPDict * _Nonnull)dictionary;
   38.93 +
   38.94 +/**
   38.95 + This method should be removed once the adapter fully supports objects for identity
   38.96 + and message types insead of dictionaries.
   38.97 + */
   38.98 +- (PEPMutableDict * _Nonnull)mutableDictionary;
   38.99 +
  38.100 +/**
  38.101 + Is the given identity a pEp user, from the engine's point of view?
  38.102 + */
  38.103 +- (NSNumber * _Nullable)isPEPUser:(PEPSession * _Nullable)session
  38.104 +                            error:(NSError * _Nullable * _Nullable)error;
  38.105 +
  38.106 +/**
  38.107 + Puts all properties into a default/nil state.
  38.108 + */
  38.109 +- (void)reset;
  38.110 +
  38.111 +@end
    39.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    39.2 +++ b/pEpObjCAdapterFramework/PEPLanguage.h	Thu Mar 21 12:37:32 2019 +0100
    39.3 @@ -0,0 +1,33 @@
    39.4 +//
    39.5 +//  PEPLanguage.h
    39.6 +//  pEpiOSAdapter
    39.7 +//
    39.8 +//  Created by Dirk Zimmermann on 03.05.17.
    39.9 +//  Copyright © 2017 p≡p. All rights reserved.
   39.10 +//
   39.11 +
   39.12 +#import <Foundation/Foundation.h>
   39.13 +
   39.14 +@interface PEPLanguage : NSObject
   39.15 +
   39.16 +- (instancetype _Nonnull)initWithCode:(NSString * _Nonnull)code
   39.17 +                                 name:(NSString * _Nonnull)name
   39.18 +                                 sentence:(NSString * _Nonnull)sentence;
   39.19 +
   39.20 +/**
   39.21 + ISO 639-1 language code
   39.22 + */
   39.23 +@property (nonatomic, nonnull) NSString *code;
   39.24 +
   39.25 +/**
   39.26 + Name of the language. Should not be translated.
   39.27 + */
   39.28 +@property (nonatomic, nonnull) NSString *name;
   39.29 +
   39.30 +/**
   39.31 + Sentence of the form "I want to display the trustwords in <lang>".
   39.32 + Should not be translated.
   39.33 + */
   39.34 +@property (nonatomic, nonnull) NSString *sentence;
   39.35 +
   39.36 +@end
    40.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    40.2 +++ b/pEpObjCAdapterFramework/PEPMessage.h	Thu Mar 21 12:37:32 2019 +0100
    40.3 @@ -0,0 +1,59 @@
    40.4 +//
    40.5 +//  PEPMessage.h
    40.6 +//  pEpObjCAdapter
    40.7 +//
    40.8 +//  Created by Dirk Zimmermann on 10.11.17.
    40.9 +//  Copyright © 2017 p≡p. All rights reserved.
   40.10 +//
   40.11 +
   40.12 +#import <Foundation/Foundation.h>
   40.13 +
   40.14 +#import "PEPTypes.h"
   40.15 +#import "PEPEngineTypes.h"
   40.16 +
   40.17 +@class PEPIdentity;
   40.18 +@class PEPAttachment;
   40.19 +
   40.20 +@interface PEPMessage : NSObject
   40.21 +
   40.22 +@property (nonatomic, nullable) NSString *messageID;
   40.23 +
   40.24 +@property (nonatomic, nullable) PEPIdentity *from;
   40.25 +@property (nonatomic, nullable) NSArray<PEPIdentity *> *to;
   40.26 +@property (nonatomic, nullable) NSArray<PEPIdentity *> *cc;
   40.27 +@property (nonatomic, nullable) NSArray<PEPIdentity *> *bcc;
   40.28 +
   40.29 +@property (nonatomic, nullable) NSString *shortMessage;
   40.30 +@property (nonatomic, nullable) NSString *longMessage;
   40.31 +@property (nonatomic, nullable) NSString *longMessageFormatted;
   40.32 +
   40.33 +@property (nonatomic, nullable) NSArray<PEPIdentity *> *replyTo;
   40.34 +@property (nonatomic, nullable) NSArray<NSString *> *inReplyTo;
   40.35 +@property (nonatomic, nullable) NSArray<NSString *> *references;
   40.36 +
   40.37 +@property (nonatomic, nullable) NSDate *sentDate;
   40.38 +@property (nonatomic, nullable) NSDate *receivedDate;
   40.39 +
   40.40 +@property (nonatomic, nullable) NSArray<PEPAttachment *> *attachments;
   40.41 +
   40.42 +@property (nonatomic, nullable) NSArray<NSArray<NSString *> *> *optionalFields;
   40.43 +@property (nonatomic, nullable) NSArray<NSString *> *keywords;
   40.44 +@property (nonatomic, nullable) PEPIdentity *receivedBy;
   40.45 +@property (nonatomic) PEPMsgDirection direction;
   40.46 +
   40.47 +/**
   40.48 + For backwards compatiblity.
   40.49 + */
   40.50 +- (instancetype _Nonnull)initWithDictionary:(PEPDict *)dict;
   40.51 +
   40.52 +/**
   40.53 + For backwards compatiblity.
   40.54 + */
   40.55 +- (PEPDict * _Nonnull)dictionary;
   40.56 +
   40.57 +/**
   40.58 + For backwards compatiblity.
   40.59 + */
   40.60 +- (PEPMutableDict * _Nonnull)mutableDictionary;
   40.61 +
   40.62 +@end
    41.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    41.2 +++ b/pEpObjCAdapterFramework/PEPObjCAdapter.h	Thu Mar 21 12:37:32 2019 +0100
    41.3 @@ -0,0 +1,40 @@
    41.4 +//
    41.5 +//  pEpiOSAdapter.h
    41.6 +//  pEpiOSAdapter
    41.7 +//
    41.8 +//  Created by Volker Birk on 28.04.15.
    41.9 +//  Copyright (c) 2015 p≡p. All rights reserved.
   41.10 +//
   41.11 +
   41.12 +#import <Foundation/Foundation.h>
   41.13 +
   41.14 +@class PEPLanguage;
   41.15 +
   41.16 +@interface PEPObjCAdapter : NSObject
   41.17 +
   41.18 +#pragma mark - Configuration
   41.19 +
   41.20 +/**
   41.21 + Sets Engine config for unecryptedSubjectEnabled to the given value on all Sessions created by
   41.22 + this adapter.
   41.23 +
   41.24 + @param enabled Whether or not mail subjects should be encrypted
   41.25 + */
   41.26 ++ (void)setUnEncryptedSubjectEnabled:(BOOL)enabled;
   41.27 +
   41.28 +/**
   41.29 + Enable or disable passive mode for all sessions.
   41.30 + */
   41.31 ++ (void)setPassiveModeEnabled:(BOOL)enabled;
   41.32 +
   41.33 +#pragma mark -
   41.34 +
   41.35 +/**
   41.36 + The HOME URL, where all pEp related files will be stored.
   41.37 + */
   41.38 ++ (NSURL * _Nonnull)homeURL;
   41.39 +
   41.40 ++ (void)setupTrustWordsDB;
   41.41 ++ (void)setupTrustWordsDB:(NSBundle * _Nonnull)rootBundle;
   41.42 +
   41.43 +@end
    42.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    42.2 +++ b/pEpObjCAdapterFramework/PEPObjCAdapterFramework.h	Thu Mar 21 12:37:32 2019 +0100
    42.3 @@ -0,0 +1,30 @@
    42.4 +//
    42.5 +//  PEPObjCAdapterFramework.h
    42.6 +//  PEPObjCAdapterFramework
    42.7 +//
    42.8 +//  Created by Dirk Zimmermann on 20.02.19.
    42.9 +//  Copyright © 2019 p≡p. All rights reserved.
   42.10 +//
   42.11 +
   42.12 +#import <UIKit/UIKit.h>
   42.13 +
   42.14 +//! Project version number for PEPObjCAdapterFramework.
   42.15 +FOUNDATION_EXPORT double PEPObjCAdapterFrameworkVersionNumber;
   42.16 +
   42.17 +//! Project version string for PEPObjCAdapterFramework.
   42.18 +FOUNDATION_EXPORT const unsigned char PEPObjCAdapterFrameworkVersionString[];
   42.19 +
   42.20 +// In this header, you should import all the public headers of your framework using statements like #import <PEPObjCAdapterFramework/PublicHeader.h>
   42.21 +
   42.22 +#import <PEPObjCAdapterFramework/PEPIdentity.h>
   42.23 +#import <PEPObjCAdapterFramework/PEPSessionProtocol.h>
   42.24 +#import <PEPObjCAdapterFramework/PEPEngineTypes.h>
   42.25 +#import <PEPObjCAdapterFramework/PEPTypes.h>
   42.26 +#import <PEPObjCAdapterFramework/PEPObjCAdapter.h>
   42.27 +#import <PEPObjCAdapterFramework/PEPSession.h>
   42.28 +#import <PEPObjCAdapterFramework/PEPMessage.h>
   42.29 +#import <PEPObjCAdapterFramework/PEPConstants.h>
   42.30 +#import <PEPObjCAdapterFramework/NSNumber+PEPRating.h>
   42.31 +#import <PEPObjCAdapterFramework/PEPAttachment.h>
   42.32 +#import <PEPObjCAdapterFramework/PEPLanguage.h>
   42.33 +#import <PEPObjCAdapterFramework/NSDictionary+CommType.h>
    43.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    43.2 +++ b/pEpObjCAdapterFramework/PEPSession.h	Thu Mar 21 12:37:32 2019 +0100
    43.3 @@ -0,0 +1,33 @@
    43.4 +//
    43.5 +//  PEPSession.h
    43.6 +//  pEpObjCAdapter
    43.7 +//
    43.8 +//  Created by Andreas Buff on 11.10.17.
    43.9 +//  Copyright © 2017 p≡p. All rights reserved.
   43.10 +//
   43.11 +
   43.12 +#import <Foundation/Foundation.h>
   43.13 +
   43.14 +#import "PEPSessionProtocol.h"
   43.15 +
   43.16 +/**
   43.17 + Fake session to handle to the client.
   43.18 +
   43.19 + Assures all calls are handled on the correct internal session for the thread it is called on.
   43.20 + You can instantiate and use this session how often and wherever you want. Also over multiple threads.
   43.21 +
   43.22 + Note: You must call `cleanup()` once before your process gets terminated to be able to gracefully shutdown.
   43.23 + It is the clients responsibility not to make any calls to PEPSession in between the last call
   43.24 + to `cleanup()` and getting terminated.
   43.25 + */
   43.26 +@interface PEPSession : NSObject <PEPSessionProtocol>
   43.27 +
   43.28 +/**
   43.29 + You must call this method once before your process gets terminated to be able to gracefully shutdown.
   43.30 + You must not make any calls to PEPSession in between the last call to `cleanup()` and getting terminated.
   43.31 +
   43.32 + Only for performance reasons: call this method only if you have to.
   43.33 + */
   43.34 ++ (void)cleanup;
   43.35 +
   43.36 +@end
    44.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    44.2 +++ b/pEpObjCAdapterFramework/PEPSessionProtocol.h	Thu Mar 21 12:37:32 2019 +0100
    44.3 @@ -0,0 +1,263 @@
    44.4 +//
    44.5 +//  PEPSessionProtocol.h
    44.6 +//  pEpObjCAdapter
    44.7 +//
    44.8 +//  Created by Dirk Zimmermann on 30.10.17.
    44.9 +//  Copyright © 2017 p≡p. All rights reserved.
   44.10 +//
   44.11 +
   44.12 +#import <Foundation/Foundation.h>
   44.13 +
   44.14 +#import "PEPTypes.h"
   44.15 +#import "PEPEngineTypes.h"
   44.16 +
   44.17 +@class PEPLanguage;
   44.18 +@class PEPIdentity;
   44.19 +@class PEPMessage;
   44.20 +
   44.21 +@protocol PEPSessionProtocol <NSObject>
   44.22 +
   44.23 +/** Decrypt a message */
   44.24 +- (PEPDict * _Nullable)decryptMessageDict:(PEPMutableDict * _Nonnull)messageDict
   44.25 +                                    flags:(PEPDecryptFlags * _Nullable)flags
   44.26 +                                   rating:(PEPRating * _Nullable)rating
   44.27 +                                extraKeys:(PEPStringList * _Nullable * _Nullable)extraKeys
   44.28 +                                   status:(PEPStatus * _Nullable)status
   44.29 +                                    error:(NSError * _Nullable * _Nullable)error __deprecated;
   44.30 +
   44.31 +/** Decrypt a message */
   44.32 +- (PEPMessage * _Nullable)decryptMessage:(PEPMessage * _Nonnull)message
   44.33 +                                   flags:(PEPDecryptFlags * _Nullable)flags
   44.34 +                                  rating:(PEPRating * _Nullable)rating
   44.35 +                               extraKeys:(PEPStringList * _Nullable * _Nullable)extraKeys
   44.36 +                                  status:(PEPStatus * _Nullable)status
   44.37 +                                   error:(NSError * _Nullable * _Nullable)error;
   44.38 +
   44.39 +/** Re-evaluate rating of decrypted message */
   44.40 +- (BOOL)reEvaluateMessageDict:(PEPDict * _Nonnull)messageDict
   44.41 +                     xKeyList:(PEPStringList *_Nullable)xKeyList
   44.42 +                       rating:(PEPRating * _Nonnull)rating
   44.43 +                       status:(PEPStatus * _Nullable)status
   44.44 +                        error:(NSError * _Nullable * _Nullable)error __deprecated;
   44.45 +
   44.46 +/** Re-evaluate rating of decrypted message */
   44.47 +- (BOOL)reEvaluateMessage:(PEPMessage * _Nonnull)message
   44.48 +                 xKeyList:(PEPStringList *_Nullable)xKeyList
   44.49 +                   rating:(PEPRating * _Nonnull)rating
   44.50 +                   status:(PEPStatus * _Nullable)status
   44.51 +                    error:(NSError * _Nullable * _Nullable)error;
   44.52 +
   44.53 +/**
   44.54 + Encrypt a message dictionary, indicating the encoding format.
   44.55 + @note The resulting message dict could be the input one.
   44.56 + */
   44.57 +- (PEPDict * _Nullable)encryptMessageDict:(PEPDict * _Nonnull)messageDict
   44.58 +                                extraKeys:(PEPStringList * _Nullable)extraKeys
   44.59 +                                encFormat:(PEPEncFormat)encFormat
   44.60 +                                   status:(PEPStatus * _Nullable)status
   44.61 +                                    error:(NSError * _Nullable * _Nullable)error __deprecated;
   44.62 +
   44.63 +/**
   44.64 + Encrypt a message, indicating the encoding format
   44.65 + @note The resulting message dict could be the input one.
   44.66 + */
   44.67 +- (PEPMessage * _Nullable)encryptMessage:(PEPMessage * _Nonnull)message
   44.68 +                               extraKeys:(PEPStringList * _Nullable)extraKeys
   44.69 +                               encFormat:(PEPEncFormat)encFormat
   44.70 +                                  status:(PEPStatus * _Nullable)status
   44.71 +                                   error:(NSError * _Nullable * _Nullable)error;
   44.72 +
   44.73 +/** Encrypt a message with default encryption format (PEP_enc_PEP) */
   44.74 +- (PEPMessage * _Nullable)encryptMessage:(PEPMessage * _Nonnull)message
   44.75 +                               extraKeys:(PEPStringList * _Nullable)extraKeys
   44.76 +                                  status:(PEPStatus * _Nullable)status
   44.77 +                                   error:(NSError * _Nullable * _Nullable)error;
   44.78 +
   44.79 +/** Encrypt a message dict for the given own identity */
   44.80 +- (PEPDict * _Nullable)encryptMessageDict:(PEPDict * _Nonnull)messageDict
   44.81 +                                  forSelf:(PEPIdentity * _Nonnull)ownIdentity
   44.82 +                                extraKeys:(PEPStringList * _Nullable)extraKeys
   44.83 +                                   status:(PEPStatus * _Nullable)status
   44.84 +                                    error:(NSError * _Nullable * _Nullable)error __deprecated;
   44.85 +
   44.86 +/** Encrypt a message for the given own identity */
   44.87 +- (PEPMessage * _Nullable)encryptMessage:(PEPMessage * _Nonnull)message
   44.88 +                                 forSelf:(PEPIdentity * _Nonnull)ownIdentity
   44.89 +                               extraKeys:(PEPStringList * _Nullable)extraKeys
   44.90 +                                  status:(PEPStatus * _Nullable)status
   44.91 +                                   error:(NSError * _Nullable * _Nullable)error;
   44.92 +
   44.93 +/** Encrypt a message dict to the given recipient FPR, attaching the private key */
   44.94 +- (PEPDict * _Nullable)encryptMessageDict:(PEPDict * _Nonnull)messageDict
   44.95 +                                    toFpr:(NSString * _Nonnull)toFpr
   44.96 +                                encFormat:(PEPEncFormat)encFormat
   44.97 +                                    flags:(PEPDecryptFlags)flags
   44.98 +                                   status:(PEPStatus * _Nullable)status
   44.99 +                                    error:(NSError * _Nullable * _Nullable)error __deprecated;
  44.100 +
  44.101 +/** Encrypt a message dict to the given recipient FPR, attaching the private key */
  44.102 +- (PEPMessage * _Nullable)encryptMessage:(PEPMessage * _Nonnull)message
  44.103 +                                   toFpr:(NSString * _Nonnull)toFpr
  44.104 +                               encFormat:(PEPEncFormat)encFormat
  44.105 +                                   flags:(PEPDecryptFlags)flags
  44.106 +                                  status:(PEPStatus * _Nullable)status
  44.107 +                                   error:(NSError * _Nullable * _Nullable)error;
  44.108 +
  44.109 +/** Determine the status color of a message to be sent */
  44.110 +- (NSNumber * _Nullable)outgoingRatingForMessage:(PEPMessage * _Nonnull)theMessage
  44.111 +                                           error:(NSError * _Nullable * _Nullable)error;
  44.112 +
  44.113 +/** Determine the preview status color of a message to be sent */
  44.114 +- (NSNumber * _Nullable)outgoingRatingPreviewForMessage:(PEPMessage * _Nonnull)theMessage
  44.115 +                                                  error:(NSError * _Nullable * _Nullable)error;
  44.116 +
  44.117 +/**
  44.118 + Determine the rating of an identity.
  44.119 + The rating is the rating a _message_ would have, if it is sent to this (and only this) identity.
  44.120 + It is *not* a rating of the identity. In fact, there is no rating for identities.
  44.121 + */
  44.122 +- (NSNumber * _Nullable)ratingForIdentity:(PEPIdentity * _Nonnull)identity
  44.123 +                                    error:(NSError * _Nullable * _Nullable)error;
  44.124 +
  44.125 +/** Get trustwords for a fingerprint */
  44.126 +- (NSArray * _Nullable)trustwordsForFingerprint:(NSString * _Nonnull)fingerprint
  44.127 +                                     languageID:(NSString * _Nonnull)languageID
  44.128 +                                      shortened:(BOOL)shortened
  44.129 +                                          error:(NSError * _Nullable * _Nullable)error;
  44.130 +
  44.131 +/**
  44.132 + Supply an account used by our user himself. The identity is supplemented with the missing parts
  44.133 +
  44.134 + An identity is a `NSDictionary` mapping a field name as `NSString` to different values.
  44.135 + An identity can have the following fields (all other keys are ignored).
  44.136 + It is not necessary to supply all fields; missing fields are supplemented by p≡p engine.
  44.137 +
  44.138 + @"username": real name or nick name (if pseudonymous) of identity
  44.139 + @"address": URI or SMTP address
  44.140 + @"user_id": persistent unique ID for the *user* that belongs to the identity.
  44.141 +                A user can have multiple identities which all of them MUST use the same user_id.
  44.142 + @"lang": preferred languageID for communication with this ID (default: @"en")
  44.143 + @"fpr": fingerprint of key to use for communication with this ID
  44.144 + @"comm_type": communication type code (usually not needed)
  44.145 +
  44.146 + As an example:
  44.147 +
  44.148 + User has a mailbox. The mail address is "Dipul Khatri <dipul@inboxcube.com>". Then this would be:
  44.149 +
  44.150 + NSDictionary *ident = [NSDictionary dictionaryWithObjectsAndKeys:
  44.151 + @"Dipul Khatri", @"username", @"dipul@inboxcube.com", @"address",
  44.152 + @"23", @"user_id", nil];
  44.153 +
  44.154 + */
  44.155 +- (BOOL)mySelf:(PEPIdentity * _Nonnull)identity error:(NSError * _Nullable * _Nullable)error;
  44.156 +
  44.157 +/**
  44.158 + Supplement missing information for an arbitrary identity (used for communication partners).
  44.159 + Will call the engine's myself() or update_identity() internally, depending on the given
  44.160 + identity.
  44.161 + */
  44.162 +- (BOOL)updateIdentity:(PEPIdentity * _Nonnull)identity
  44.163 +                 error:(NSError * _Nullable * _Nullable)error;
  44.164 +
  44.165 +/**
  44.166 + Mark a key as trusted with a person.
  44.167 + See `mySelf:(NSMutableDictionary *)identity` for an explanation of identities.
  44.168 + */
  44.169 +- (BOOL)trustPersonalKey:(PEPIdentity * _Nonnull)identity
  44.170 +                   error:(NSError * _Nullable * _Nullable)error;
  44.171 +
  44.172 +/**
  44.173 + if a key is not trusted by the user tell this using this message
  44.174 + See `mySelf:(NSMutableDictionary *)identity` for an explanation of identities.
  44.175 + */
  44.176 +- (BOOL)keyMistrusted:(PEPIdentity * _Nonnull)identity
  44.177 +                error:(NSError * _Nullable * _Nullable)error;
  44.178 +
  44.179 +/**
  44.180 + Use this to undo keyCompromized or trustPersonalKey
  44.181 + See `mySelf:(NSMutableDictionary *)identity` for an explanation of identities.
  44.182 + */
  44.183 +- (BOOL)keyResetTrust:(PEPIdentity * _Nonnull)identity
  44.184 +                error:(NSError * _Nullable * _Nullable)error;
  44.185 +
  44.186 +#pragma mark -- Internal API (testing etc.)
  44.187 +
  44.188 +/** For testing purpose, manual key import */
  44.189 +- (NSArray<PEPIdentity *> * _Nullable)importKey:(NSString * _Nonnull)keydata
  44.190 +                                          error:(NSError * _Nullable * _Nullable)error;
  44.191 +
  44.192 +- (BOOL)logTitle:(NSString * _Nonnull)title
  44.193 +          entity:(NSString * _Nonnull)entity
  44.194 +     description:(NSString * _Nullable)description
  44.195 +         comment:(NSString * _Nullable)comment
  44.196 +           error:(NSError * _Nullable * _Nullable)error;
  44.197 +
  44.198 +/**
  44.199 + Retrieves the log from the engine, or nil, if there is nothing yet.
  44.200 + */
  44.201 +- (NSString * _Nullable)getLogWithError:(NSError * _Nullable * _Nullable)error;
  44.202 +
  44.203 +/** Determine trustwords for two identities */
  44.204 +- (NSString * _Nullable)getTrustwordsIdentity1:(PEPIdentity * _Nonnull)identity1
  44.205 +                                     identity2:(PEPIdentity * _Nonnull)identity2
  44.206 +                                      language:(NSString * _Nullable)language
  44.207 +                                          full:(BOOL)full
  44.208 +                                         error:(NSError * _Nullable * _Nullable)error;
  44.209 +
  44.210 +/**
  44.211 + @returns The list of supported languages for trustwords.
  44.212 + */
  44.213 +- (NSArray<PEPLanguage *> * _Nullable)languageListWithError:(NSError * _Nullable * _Nullable)error;
  44.214 +
  44.215 +/**
  44.216 + Can convert a string like "cannot_decrypt" into its equivalent PEPRating_cannot_decrypt.
  44.217 + */
  44.218 +- (PEPRating)ratingFromString:(NSString * _Nonnull)string;
  44.219 +
  44.220 +/**
  44.221 + Can convert a pEp rating like PEPRating_cannot_decrypt
  44.222 + into its equivalent string "cannot_decrypt" .
  44.223 + */
  44.224 +- (NSString * _Nonnull)stringFromRating:(PEPRating)rating;
  44.225 +
  44.226 +/**
  44.227 + Is the given identity really a pEp user?
  44.228 + If the engine indicates an error, or the identity is not a pEp user, returns false.
  44.229 + */
  44.230 +- (NSNumber * _Nullable)isPEPUser:(PEPIdentity * _Nonnull)identity
  44.231 +                            error:(NSError * _Nullable * _Nullable)error;
  44.232 +
  44.233 +/**
  44.234 + When (manually) importing (secret) keys, associate them with the given own identity.
  44.235 + */
  44.236 +- (BOOL)setOwnKey:(PEPIdentity * _Nonnull)identity fingerprint:(NSString * _Nonnull)fingerprint
  44.237 +            error:(NSError * _Nullable * _Nullable)error;
  44.238 +
  44.239 +/**
  44.240 + Wraps the engine's `config_passive_mode`.
  44.241 + */
  44.242 +- (void)configurePassiveModeEnabled:(BOOL)enabled;
  44.243 +
  44.244 +/**
  44.245 + Wraps set_identity_flags
  44.246 + */
  44.247 +- (BOOL)setFlags:(PEPIdentityFlags)flags
  44.248 +     forIdentity:(PEPIdentity * _Nonnull)identity
  44.249 +           error:(NSError * _Nullable * _Nullable)error;
  44.250 +
  44.251 +- (BOOL)deliverHandshakeResult:(PEPSyncHandshakeResult)result
  44.252 +                    forPartner:(PEPIdentity * _Nonnull)partner
  44.253 +                         error:(NSError * _Nullable * _Nullable)error;
  44.254 +
  44.255 +/**
  44.256 + Wraps trust_own_key
  44.257 + */
  44.258 +- (BOOL)trustOwnKeyIdentity:(PEPIdentity *)identity
  44.259 +                      error:(NSError * _Nullable * _Nullable)error;
  44.260 +
  44.261 +/**
  44.262 + Wraps color_from_rating.
  44.263 + */
  44.264 +- (PEPColor)colorFromRating:(PEPRating)rating;
  44.265 +
  44.266 +@end
    45.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    45.2 +++ b/pEpObjCAdapterFramework/PEPTypes.h	Thu Mar 21 12:37:32 2019 +0100
    45.3 @@ -0,0 +1,13 @@
    45.4 +//
    45.5 +//  PEPTypes.h
    45.6 +//  PEPObjCAdapterFramework
    45.7 +//
    45.8 +//  Created by Dirk Zimmermann on 01.03.19.
    45.9 +//  Copyright © 2019 p≡p. All rights reserved.
   45.10 +//
   45.11 +
   45.12 +#import <Foundation/Foundation.h>
   45.13 +
   45.14 +typedef NSDictionary<NSString *, id> PEPDict;
   45.15 +typedef NSMutableDictionary<NSString *, id> PEPMutableDict;
   45.16 +typedef NSArray<NSString *> PEPStringList;
    46.1 --- a/pEpObjCTests/PEPMessageUtilTest.m	Wed Feb 20 09:18:34 2019 +0100
    46.2 +++ b/pEpObjCTests/PEPMessageUtilTest.m	Thu Mar 21 12:37:32 2019 +0100
    46.3 @@ -9,7 +9,7 @@
    46.4  #import <XCTest/XCTest.h>
    46.5  
    46.6  #import "PEPMessageUtil.h"
    46.7 -#import "PEPIdentity.h"
    46.8 +#import "PEPObjCAdapterFramework.h"
    46.9  
   46.10  @interface PEPMessageUtilTest : XCTestCase
   46.11  @property pEp_identity *pepIdentitySomeOne;
    47.1 --- a/pEpObjCTests/PEPSessionTest.m	Wed Feb 20 09:18:34 2019 +0100
    47.2 +++ b/pEpObjCTests/PEPSessionTest.m	Thu Mar 21 12:37:32 2019 +0100
    47.3 @@ -8,9 +8,9 @@
    47.4  
    47.5  #import <XCTest/XCTest.h>
    47.6  
    47.7 +#import "PEPObjCAdapterFramework.h"
    47.8 +
    47.9  #import "PEPObjCAdapter.h"
   47.10 -#import "NSDictionary+Extension.h"
   47.11 -#import "PEPIdentity.h"
   47.12  #import "PEPMessage.h"
   47.13  #import "PEPAttachment.h"
   47.14  #import "PEPTestUtils.h"
   47.15 @@ -183,7 +183,7 @@
   47.16                         userID:@"Alice_User_ID"
   47.17                         fingerPrint:@"4ABE3AAF59AC32CFE4F86500A9411D176FF00E97"
   47.18                         session:session];
   47.19 -    XCTAssertEqual([self ratingForIdentity:me session:session], PEP_rating_trusted_and_anonymized);
   47.20 +    XCTAssertEqual([self ratingForIdentity:me session:session], PEPRatingTrustedAndAnonymized);
   47.21  
   47.22      PEPIdentity *alice = [self
   47.23                            checkImportingKeyFilePath:@"6FF00E97_sec.asc"
   47.24 @@ -192,7 +192,7 @@
   47.25                            fingerPrint:@"4ABE3AAF59AC32CFE4F86500A9411D176FF00E97"
   47.26                            session: session];
   47.27      XCTAssertNotNil(alice);
   47.28 -    XCTAssertEqual([self ratingForIdentity:alice session:session], PEP_rating_reliable);
   47.29 +    XCTAssertEqual([self ratingForIdentity:alice session:session], PEPRatingReliable);
   47.30  }
   47.31  
   47.32  /** ENGINE-409 */
   47.33 @@ -211,7 +211,7 @@
   47.34      XCTAssertNil(error);
   47.35  
   47.36      XCTAssertNotNil(me.fingerPrint);
   47.37 -    XCTAssertEqual([self ratingForIdentity:me session:session], PEP_rating_trusted_and_anonymized);
   47.38 +    XCTAssertEqual([self ratingForIdentity:me session:session], PEPRatingTrustedAndAnonymized);
   47.39  
   47.40      PEPIdentity *alice = [self
   47.41                            checkImportingKeyFilePath:@"6FF00E97_sec.asc"
   47.42 @@ -220,11 +220,11 @@
   47.43                            fingerPrint:@"4ABE3AAF59AC32CFE4F86500A9411D176FF00E97"
   47.44                            session: session];
   47.45      XCTAssertNotNil(alice);
   47.46 -    XCTAssertEqual([self ratingForIdentity:alice session:session], PEP_rating_reliable);
   47.47 +    XCTAssertEqual([self ratingForIdentity:alice session:session], PEPRatingReliable);
   47.48  
   47.49      XCTAssertTrue([session keyMistrusted:alice error:&error]);
   47.50      XCTAssertNil(error);
   47.51 -    XCTAssertEqual([self ratingForIdentity:alice session:session], PEP_rating_have_no_key);
   47.52 +    XCTAssertEqual([self ratingForIdentity:alice session:session], PEPRatingHaveNoKey);
   47.53  }
   47.54  
   47.55  - (void)testIdentityRatingTrustResetMistrustUndo
   47.56 @@ -242,7 +242,7 @@
   47.57      XCTAssertNil(error);
   47.58  
   47.59      XCTAssertNotNil(me.fingerPrint);
   47.60 -    XCTAssertEqual([self ratingForIdentity:me session:session], PEP_rating_trusted_and_anonymized);
   47.61 +    XCTAssertEqual([self ratingForIdentity:me session:session], PEPRatingTrustedAndAnonymized);
   47.62  
   47.63      PEPIdentity *alice = [self
   47.64                            checkImportingKeyFilePath:@"6FF00E97_sec.asc"
   47.65 @@ -251,19 +251,19 @@
   47.66                            fingerPrint:@"4ABE3AAF59AC32CFE4F86500A9411D176FF00E97"
   47.67                            session: session];
   47.68      XCTAssertNotNil(alice);
   47.69 -    XCTAssertEqual([self ratingForIdentity:alice session:session], PEP_rating_reliable);
   47.70 +    XCTAssertEqual([self ratingForIdentity:alice session:session], PEPRatingReliable);
   47.71  
   47.72      XCTAssertTrue([session trustPersonalKey:alice error:&error]);
   47.73      XCTAssertNil(error);
   47.74 -    XCTAssertEqual([self ratingForIdentity:alice session:session], PEP_rating_trusted);
   47.75 +    XCTAssertEqual([self ratingForIdentity:alice session:session], PEPRatingTrusted);
   47.76  
   47.77      XCTAssertTrue([session keyResetTrust:alice error:&error]);
   47.78      XCTAssertNil(error);
   47.79 -    XCTAssertEqual([self ratingForIdentity:alice session:session], PEP_rating_reliable);
   47.80 +    XCTAssertEqual([self ratingForIdentity:alice session:session], PEPRatingReliable);
   47.81  
   47.82      XCTAssertTrue([session keyMistrusted:alice error:&error]);
   47.83      XCTAssertNil(error);
   47.84 -    XCTAssertEqual([self ratingForIdentity:alice session:session], PEP_rating_have_no_key);
   47.85 +    XCTAssertEqual([self ratingForIdentity:alice session:session], PEPRatingHaveNoKey);
   47.86  }
   47.87  
   47.88  /** ENGINE-384 */
   47.89 @@ -281,7 +281,7 @@
   47.90      XCTAssertNil(error);
   47.91  
   47.92      XCTAssertNotNil(me.fingerPrint);
   47.93 -    XCTAssertEqual([self ratingForIdentity:me session:session], PEP_rating_trusted_and_anonymized);
   47.94 +    XCTAssertEqual([self ratingForIdentity:me session:session], PEPRatingTrustedAndAnonymized);
   47.95  
   47.96      PEPIdentity *alice = [self
   47.97                            checkImportingKeyFilePath:@"6FF00E97_sec.asc"
   47.98 @@ -290,19 +290,19 @@
   47.99                            fingerPrint:@"4ABE3AAF59AC32CFE4F86500A9411D176FF00E97"
  47.100                            session: session];
  47.101      XCTAssertNotNil(alice);
  47.102 -    XCTAssertEqual([self ratingForIdentity:alice session:session], PEP_rating_reliable);
  47.103 +    XCTAssertEqual([self ratingForIdentity:alice session:session], PEPRatingReliable);
  47.104  
  47.105      XCTAssertTrue([session trustPersonalKey:alice error:&error]);
  47.106      XCTAssertNil(error);
  47.107 -    XCTAssertEqual([self ratingForIdentity:alice session:session], PEP_rating_trusted);
  47.108 +    XCTAssertEqual([self ratingForIdentity:alice session:session], PEPRatingTrusted);
  47.109  
  47.110      XCTAssertTrue([session keyResetTrust:alice error:&error]);
  47.111      XCTAssertNil(error);
  47.112 -    XCTAssertEqual([self ratingForIdentity:alice session:session], PEP_rating_reliable);
  47.113 +    XCTAssertEqual([self ratingForIdentity:alice session:session], PEPRatingReliable);
  47.114  
  47.115      XCTAssertTrue([session keyMistrusted:alice error:&error]);
  47.116      XCTAssertNil(error);
  47.117 -    XCTAssertEqual([self ratingForIdentity:alice session:session], PEP_rating_have_no_key);
  47.118 +    XCTAssertEqual([self ratingForIdentity:alice session:session], PEPRatingHaveNoKey);
  47.119  }
  47.120  
  47.121  /**
  47.122 @@ -322,7 +322,7 @@
  47.123      XCTAssertNil(error);
  47.124  
  47.125      XCTAssertNotNil(me.fingerPrint);
  47.126 -    XCTAssertEqual([self ratingForIdentity:me session:session], PEP_rating_trusted_and_anonymized);
  47.127 +    XCTAssertEqual([self ratingForIdentity:me session:session], PEPRatingTrustedAndAnonymized);
  47.128  
  47.129      PEPIdentity *alice = [self
  47.130                            checkImportingKeyFilePath:@"6FF00E97_sec.asc"
  47.131 @@ -331,7 +331,7 @@
  47.132                            fingerPrint:@"4ABE3AAF59AC32CFE4F86500A9411D176FF00E97"
  47.133                            session: session];
  47.134      XCTAssertNotNil(alice);
  47.135 -    XCTAssertEqual([self ratingForIdentity:alice session:session], PEP_rating_reliable);
  47.136 +    XCTAssertEqual([self ratingForIdentity:alice session:session], PEPRatingReliable);
  47.137  
  47.138      void (^encryptingBlock)(void) = ^{
  47.139          PEPSession *innerSession = [PEPSession new];
  47.140 @@ -342,14 +342,14 @@
  47.141          msg.longMessage = @"Lots and lots of text";
  47.142          msg.direction = PEP_dir_outgoing;
  47.143  
  47.144 -        PEP_STATUS status;
  47.145 +        PEPStatus status;
  47.146          NSError *error = nil;
  47.147          PEPMessage *encMsg = [innerSession
  47.148                                encryptMessage:msg
  47.149                                forSelf:me
  47.150                                extraKeys:nil
  47.151                                status:&status error:&error];
  47.152 -        XCTAssertEqual(status, PEP_STATUS_OK);
  47.153 +        XCTAssertEqual(status, PEPStatusOK);
  47.154          XCTAssertNotNil(encMsg);
  47.155      };
  47.156  
  47.157 @@ -359,15 +359,15 @@
  47.158  
  47.159      XCTAssertTrue([session trustPersonalKey:alice error:&error]);
  47.160      XCTAssertNil(error);
  47.161 -    XCTAssertEqual([self ratingForIdentity:alice session:session], PEP_rating_trusted);
  47.162 +    XCTAssertEqual([self ratingForIdentity:alice session:session], PEPRatingTrusted);
  47.163  
  47.164      XCTAssertTrue([session keyResetTrust:alice error:&error]);
  47.165      XCTAssertNil(error);
  47.166 -    XCTAssertEqual([self ratingForIdentity:alice session:session], PEP_rating_reliable);
  47.167 +    XCTAssertEqual([self ratingForIdentity:alice session:session], PEPRatingReliable);
  47.168  
  47.169      XCTAssertTrue([session keyMistrusted:alice error:&error]);
  47.170      XCTAssertNil(error);
  47.171 -    XCTAssertEqual([self ratingForIdentity:alice session:session], PEP_rating_have_no_key);
  47.172 +    XCTAssertEqual([self ratingForIdentity:alice session:session], PEPRatingHaveNoKey);
  47.173  }
  47.174  
  47.175  - (void)testOutgoingColors
  47.176 @@ -411,7 +411,7 @@
  47.177                                 error:&error];
  47.178          XCTAssertNotNil(numRating);
  47.179          XCTAssertNil(error);
  47.180 -        XCTAssertEqual(numRating.pEpRating, PEP_rating_unencrypted);
  47.181 +        XCTAssertEqual(numRating.pEpRating, PEPRatingUnencrypted);
  47.182      }
  47.183  
  47.184      PEPIdentity *identBob = [self
  47.185 @@ -435,10 +435,10 @@
  47.186      NSNumber *numRating = [self testOutgoingRatingForMessage:msg session:session error:&error];
  47.187      XCTAssertNotNil(numRating);
  47.188      XCTAssertNil(error);
  47.189 -    XCTAssertEqual(numRating.pEpRating, PEP_rating_reliable);
  47.190 +    XCTAssertEqual(numRating.pEpRating, PEPRatingReliable);
  47.191  
  47.192 -    PEP_rating rating = [self ratingForIdentity:identBob session:session];
  47.193 -    XCTAssertEqual(rating, PEP_rating_reliable);
  47.194 +    PEPRating rating = [self ratingForIdentity:identBob session:session];
  47.195 +    XCTAssertEqual(rating, PEPRatingReliable);
  47.196  
  47.197      // Let' say we got that handshake, set PEP_ct_confirmed in Bob's identity
  47.198      XCTAssertTrue([session trustPersonalKey:identBob error:&error]);
  47.199 @@ -448,10 +448,10 @@
  47.200      numRating = [self testOutgoingRatingForMessage:msg session:session error:&error];
  47.201      XCTAssertNotNil(numRating);
  47.202      XCTAssertNil(error);
  47.203 -    XCTAssertEqual(numRating.pEpRating, PEP_rating_trusted);
  47.204 +    XCTAssertEqual(numRating.pEpRating, PEPRatingTrusted);
  47.205  
  47.206      rating = [self ratingForIdentity:identBob session:session];
  47.207 -    XCTAssertEqual(rating, PEP_rating_trusted);
  47.208 +    XCTAssertEqual(rating, PEPRatingTrusted);
  47.209  
  47.210      // Let' say we undo handshake
  47.211      XCTAssertTrue([session keyResetTrust:identBob error:&error]);
  47.212 @@ -461,7 +461,7 @@
  47.213      numRating = [self testOutgoingRatingForMessage:msg session:session error:&error];
  47.214      XCTAssertNotNil(numRating);
  47.215      XCTAssertNil(error);
  47.216 -    XCTAssertEqual(numRating.pEpRating, PEP_rating_reliable);
  47.217 +    XCTAssertEqual(numRating.pEpRating, PEPRatingReliable);
  47.218  
  47.219      // mistrust Bob
  47.220      XCTAssertTrue([session keyMistrusted:identBob error:&error]);
  47.221 @@ -472,11 +472,11 @@
  47.222      XCTAssertNil(error);
  47.223      XCTAssertNil(identBob.fingerPrint);
  47.224  
  47.225 -    // Gray == PEP_rating_unencrypted
  47.226 +    // Gray == PEPRatingUnencrypted
  47.227      numRating = [self testOutgoingRatingForMessage:msg session:session error:&error];
  47.228      XCTAssertNotNil(numRating);
  47.229      XCTAssertNil(error);
  47.230 -    XCTAssertEqual(numRating.pEpRating, PEP_rating_unencrypted);
  47.231 +    XCTAssertEqual(numRating.pEpRating, PEPRatingUnencrypted);
  47.232  }
  47.233  
  47.234  
  47.235 @@ -509,11 +509,11 @@
  47.236      msg.direction = PEP_dir_outgoing;
  47.237  
  47.238      // Test with unknown Bob
  47.239 -    PEP_rating rating;
  47.240 +    PEPRating rating;
  47.241      NSNumber *numRating = [self testOutgoingRatingForMessage:msg session:session error:&error];
  47.242      XCTAssertNotNil(numRating);
  47.243      XCTAssertNil(error);
  47.244 -    XCTAssertEqual(numRating.pEpRating, PEP_rating_unencrypted);
  47.245 +    XCTAssertEqual(numRating.pEpRating, PEPRatingUnencrypted);
  47.246  
  47.247      // Now let see with bob's pubkey already known
  47.248      // pEp Test Bob (test key, don't use) <pep.test.bob@pep-project.org>
  47.249 @@ -533,10 +533,10 @@
  47.250      numRating = [self testOutgoingRatingForMessage:msg session:session error:&error];
  47.251      XCTAssertNotNil(numRating);
  47.252      XCTAssertNil(error);
  47.253 -    XCTAssertEqual(numRating.pEpRating, PEP_rating_reliable);
  47.254 +    XCTAssertEqual(numRating.pEpRating, PEPRatingReliable);
  47.255  
  47.256      rating = [self ratingForIdentity:identBob session:session];
  47.257 -    XCTAssertEqual(rating, PEP_rating_reliable);
  47.258 +    XCTAssertEqual(rating, PEPRatingReliable);
  47.259  
  47.260      // Let' say we got that handshake, set PEP_ct_confirmed in Bob's identity
  47.261      XCTAssertTrue([session trustPersonalKey:identBob error:&error]);
  47.262 @@ -546,10 +546,10 @@
  47.263      numRating = [self testOutgoingRatingForMessage:msg session:session error:&error];
  47.264      XCTAssertNotNil(numRating);
  47.265      XCTAssertNil(error);
  47.266 -    XCTAssertEqual(numRating.pEpRating, PEP_rating_trusted);
  47.267 +    XCTAssertEqual(numRating.pEpRating, PEPRatingTrusted);
  47.268  
  47.269      rating = [self ratingForIdentity:identBob session:session];
  47.270 -    XCTAssertEqual(rating, PEP_rating_trusted);
  47.271 +    XCTAssertEqual(rating, PEPRatingTrusted);
  47.272  
  47.273      // Now let see if it turns back yellow if we add an unconfirmed folk.
  47.274      // pEp Test John (test key, don't use) <pep.test.john@pep-project.org>
  47.275 @@ -572,7 +572,7 @@
  47.276      numRating = [self testOutgoingRatingForMessage:msg session:session error:&error];
  47.277      XCTAssertNotNil(numRating);
  47.278      XCTAssertNil(error);
  47.279 -    XCTAssertEqual(numRating.pEpRating, PEP_rating_reliable);
  47.280 +    XCTAssertEqual(numRating.pEpRating, PEPRatingReliable);
  47.281  
  47.282      XCTAssertTrue([session trustPersonalKey:identJohn error:&error]);
  47.283      XCTAssertNil(error);
  47.284 @@ -581,10 +581,10 @@
  47.285      numRating = [self testOutgoingRatingForMessage:msg session:session error:&error];
  47.286      XCTAssertNotNil(numRating);
  47.287      XCTAssertNil(error);
  47.288 -    XCTAssertEqual(numRating.pEpRating, PEP_rating_trusted);
  47.289 +    XCTAssertEqual(numRating.pEpRating, PEPRatingTrusted);
  47.290  
  47.291      rating = [self ratingForIdentity:identJohn session:session];
  47.292 -    XCTAssertEqual(rating, PEP_rating_trusted);
  47.293 +    XCTAssertEqual(rating, PEPRatingTrusted);
  47.294  }
  47.295  
  47.296  - (void)testDontEncryptForMistrusted
  47.297 @@ -632,11 +632,11 @@
  47.298      msg.longMessage = @"This is a text content";
  47.299      msg.direction = PEP_dir_outgoing;
  47.300  
  47.301 -    // Gray == PEP_rating_unencrypted
  47.302 +    // Gray == PEPRatingUnencrypted
  47.303      NSNumber *numRating = [self testOutgoingRatingForMessage:msg session:session error:&error];
  47.304      XCTAssertNotNil(numRating);
  47.305      XCTAssertNil(error);
  47.306 -    XCTAssertEqual(numRating.pEpRating, PEP_rating_unencrypted);
  47.307 +    XCTAssertEqual(numRating.pEpRating, PEPRatingUnencrypted);
  47.308  
  47.309      PEPMessage *encMsg = [session encryptMessage:msg extraKeys:nil status:nil error:&error];
  47.310      XCTAssertNotNil(encMsg);
  47.311 @@ -712,7 +712,7 @@
  47.312      NSNumber *numRating = [self testOutgoingRatingForMessage:msg session:session error:&error];
  47.313      XCTAssertNotNil(numRating);
  47.314      XCTAssertNil(error);
  47.315 -    XCTAssertEqual(numRating.pEpRating, PEP_rating_trusted_and_anonymized);
  47.316 +    XCTAssertEqual(numRating.pEpRating, PEPRatingTrustedAndAnonymized);
  47.317  
  47.318      PEPMessage *encMsg = [session encryptMessage:msg extraKeys:nil status:nil error:&error];
  47.319      XCTAssertNotNil(encMsg);
  47.320 @@ -721,7 +721,7 @@
  47.321      NSArray *keys;
  47.322  
  47.323      error = nil;
  47.324 -    PEP_rating rating = PEP_rating_undefined;
  47.325 +    PEPRating rating = PEPRatingUndefined;
  47.326      PEPMessage *decmsg = [session
  47.327                            decryptMessage:encMsg
  47.328                            flags:nil
  47.329 @@ -731,7 +731,7 @@
  47.330                            error:&error];
  47.331      XCTAssertNotNil(decmsg);
  47.332      XCTAssertNil(error);
  47.333 -    XCTAssertEqual(rating, PEP_rating_trusted_and_anonymized);
  47.334 +    XCTAssertEqual(rating, PEPRatingTrustedAndAnonymized);
  47.335  }
  47.336  
  47.337  - (void)testEncryptedMailFromMuttWithReencryption
  47.338 @@ -774,8 +774,8 @@
  47.339  
  47.340      XCTAssertEqualObjects(msg, msgOriginal);
  47.341  
  47.342 -    PEP_rating rating = PEP_rating_undefined;
  47.343 -    PEP_decrypt_flags flags = PEP_decrypt_flag_untrusted_server;
  47.344 +    PEPRating rating = PEPRatingUndefined;
  47.345 +    PEPDecryptFlags flags = PEPDecryptFlagsUntrustedServer;
  47.346  
  47.347      PEPMessage *pepDecryptedMail = [session
  47.348                                      decryptMessage:msg
  47.349 @@ -788,7 +788,7 @@
  47.350      XCTAssertNil(error);
  47.351  
  47.352      // Technically, the mail is encrypted, but the signatures don't match
  47.353 -    XCTAssertEqual(rating, PEP_rating_unreliable);
  47.354 +    XCTAssertEqual(rating, PEPRatingUnreliable);
  47.355  
  47.356      // Since we're requesting re-encryption, src should have been changed
  47.357      XCTAssertNotEqualObjects(msg, msgOriginal);
  47.358 @@ -809,8 +809,8 @@
  47.359      XCTAssertTrue([session importKey:pubKeyPartner1 error:&error]);
  47.360      XCTAssertNil(error);
  47.361  
  47.362 -    PEP_rating color = [self ratingForIdentity:partner1Orig session:session];
  47.363 -    XCTAssertEqual(color, PEP_rating_reliable);
  47.364 +    PEPRating color = [self ratingForIdentity:partner1Orig session:session];
  47.365 +    XCTAssertEqual(color, PEPRatingReliable);
  47.366  }
  47.367  
  47.368  - (void)testGetTrustwords
  47.369 @@ -855,43 +855,43 @@
  47.370  - (void)testStringToRating
  47.371  {
  47.372      PEPSession *session = [PEPSession new];
  47.373 -    XCTAssertEqual([session ratingFromString:@"cannot_decrypt"], PEP_rating_cannot_decrypt);
  47.374 -    XCTAssertEqual([session ratingFromString:@"have_no_key"], PEP_rating_have_no_key);
  47.375 -    XCTAssertEqual([session ratingFromString:@"unencrypted"], PEP_rating_unencrypted);
  47.376 +    XCTAssertEqual([session ratingFromString:@"cannot_decrypt"], PEPRatingCannotDecrypt);
  47.377 +    XCTAssertEqual([session ratingFromString:@"have_no_key"], PEPRatingHaveNoKey);
  47.378 +    XCTAssertEqual([session ratingFromString:@"unencrypted"], PEPRatingUnencrypted);
  47.379      XCTAssertEqual([session ratingFromString:@"unencrypted_for_some"],
  47.380 -                   PEP_rating_unencrypted_for_some);
  47.381 -    XCTAssertEqual([session ratingFromString:@"unreliable"], PEP_rating_unreliable);
  47.382 -    XCTAssertEqual([session ratingFromString:@"reliable"], PEP_rating_reliable);
  47.383 -    XCTAssertEqual([session ratingFromString:@"trusted"], PEP_rating_trusted);
  47.384 +                   PEPRatingUnencryptedForSome);
  47.385 +    XCTAssertEqual([session ratingFromString:@"unreliable"], PEPRatingUnreliable);
  47.386 +    XCTAssertEqual([session ratingFromString:@"reliable"], PEPRatingReliable);
  47.387 +    XCTAssertEqual([session ratingFromString:@"trusted"], PEPRatingTrusted);
  47.388      XCTAssertEqual([session ratingFromString:@"trusted_and_anonymized"],
  47.389 -                   PEP_rating_trusted_and_anonymized);
  47.390 -    XCTAssertEqual([session ratingFromString:@"fully_anonymous"], PEP_rating_fully_anonymous);
  47.391 -    XCTAssertEqual([session ratingFromString:@"mistrust"], PEP_rating_mistrust);
  47.392 -    XCTAssertEqual([session ratingFromString:@"b0rken"], PEP_rating_b0rken);
  47.393 -    XCTAssertEqual([session ratingFromString:@"under_attack"], PEP_rating_under_attack);
  47.394 -    XCTAssertEqual([session ratingFromString:@"undefined"], PEP_rating_undefined);
  47.395 -    XCTAssertEqual([session ratingFromString:@"does not exist111"], PEP_rating_undefined);
  47.396 +                   PEPRatingTrustedAndAnonymized);
  47.397 +    XCTAssertEqual([session ratingFromString:@"fully_anonymous"], PEPRatingFullyAnonymous);
  47.398 +    XCTAssertEqual([session ratingFromString:@"mistrust"], PEPRatingMistrust);
  47.399 +    XCTAssertEqual([session ratingFromString:@"b0rken"], PEPRatingB0rken);
  47.400 +    XCTAssertEqual([session ratingFromString:@"under_attack"], PEPRatingUnderAttack);
  47.401 +    XCTAssertEqual([session ratingFromString:@"undefined"], PEPRatingUndefined);
  47.402 +    XCTAssertEqual([session ratingFromString:@"does not exist111"], PEPRatingUndefined);
  47.403  }
  47.404  
  47.405  - (void)testRatingToString
  47.406  {
  47.407      PEPSession *session = [PEPSession new];
  47.408 -    XCTAssertEqualObjects([session stringFromRating:PEP_rating_cannot_decrypt], @"cannot_decrypt");
  47.409 -    XCTAssertEqualObjects([session stringFromRating:PEP_rating_have_no_key], @"have_no_key");
  47.410 -    XCTAssertEqualObjects([session stringFromRating:PEP_rating_unencrypted], @"unencrypted");
  47.411 -    XCTAssertEqualObjects([session stringFromRating:PEP_rating_unencrypted_for_some],
  47.412 +    XCTAssertEqualObjects([session stringFromRating:PEPRatingCannotDecrypt], @"cannot_decrypt");
  47.413 +    XCTAssertEqualObjects([session stringFromRating:PEPRatingHaveNoKey], @"have_no_key");
  47.414 +    XCTAssertEqualObjects([session stringFromRating:PEPRatingUnencrypted], @"unencrypted");
  47.415 +    XCTAssertEqualObjects([session stringFromRating:PEPRatingUnencryptedForSome],
  47.416                            @"unencrypted_for_some");
  47.417 -    XCTAssertEqualObjects([session stringFromRating:PEP_rating_unreliable], @"unreliable");
  47.418 -    XCTAssertEqualObjects([session stringFromRating:PEP_rating_reliable], @"reliable");
  47.419 -    XCTAssertEqualObjects([session stringFromRating:PEP_rating_trusted], @"trusted");
  47.420 -    XCTAssertEqualObjects([session stringFromRating:PEP_rating_trusted_and_anonymized],
  47.421 +    XCTAssertEqualObjects([session stringFromRating:PEPRatingUnreliable], @"unreliable");
  47.422 +    XCTAssertEqualObjects([session stringFromRating:PEPRatingReliable], @"reliable");
  47.423 +    XCTAssertEqualObjects([session stringFromRating:PEPRatingTrusted], @"trusted");
  47.424 +    XCTAssertEqualObjects([session stringFromRating:PEPRatingTrustedAndAnonymized],
  47.425                            @"trusted_and_anonymized");
  47.426 -    XCTAssertEqualObjects([session stringFromRating:PEP_rating_fully_anonymous],
  47.427 +    XCTAssertEqualObjects([session stringFromRating:PEPRatingFullyAnonymous],
  47.428                            @"fully_anonymous");
  47.429 -    XCTAssertEqualObjects([session stringFromRating:PEP_rating_mistrust], @"mistrust");
  47.430 -    XCTAssertEqualObjects([session stringFromRating:PEP_rating_b0rken], @"b0rken");
  47.431 -    XCTAssertEqualObjects([session stringFromRating:PEP_rating_under_attack], @"under_attack");
  47.432 -    XCTAssertEqualObjects([session stringFromRating:PEP_rating_undefined], @"undefined");
  47.433 +    XCTAssertEqualObjects([session stringFromRating:PEPRatingMistrust], @"mistrust");
  47.434 +    XCTAssertEqualObjects([session stringFromRating:PEPRatingB0rken], @"b0rken");
  47.435 +    XCTAssertEqualObjects([session stringFromRating:PEPRatingUnderAttack], @"under_attack");
  47.436 +    XCTAssertEqualObjects([session stringFromRating:PEPRatingUndefined], @"undefined");
  47.437      XCTAssertEqualObjects([session stringFromRating:500], @"undefined");
  47.438  }
  47.439  
  47.440 @@ -916,13 +916,13 @@
  47.441  
  47.442  - (void)testXEncStatusForOutgoingEncryptedMail
  47.443  {
  47.444 -    [self helperXEncStatusForOutgoingEncryptdMailToSelf:NO expectedRating:PEP_rating_reliable];
  47.445 +    [self helperXEncStatusForOutgoingEncryptdMailToSelf:NO expectedRating:PEPRatingReliable];
  47.446  }
  47.447  
  47.448  - (void)testXEncStatusForOutgoingSelfEncryptedMail
  47.449  {
  47.450      [self helperXEncStatusForOutgoingEncryptdMailToSelf:YES
  47.451 -                                         expectedRating:PEP_rating_trusted_and_anonymized];
  47.452 +                                         expectedRating:PEPRatingTrustedAndAnonymized];
  47.453  }
  47.454  
  47.455  - (void)testEncryptMessagesWithoutKeys
  47.456 @@ -956,7 +956,7 @@
  47.457      NSNumber *numRating = [self testOutgoingRatingForMessage:msg session:session error:&error];
  47.458      XCTAssertNotNil(numRating);
  47.459      XCTAssertNil(error);
  47.460 -    XCTAssertEqual(numRating.pEpRating, PEP_rating_unencrypted);
  47.461 +    XCTAssertEqual(numRating.pEpRating, PEPRatingUnencrypted);
  47.462  
  47.463      PEPMessage *encMsg = [session encryptMessage:msg extraKeys:nil status:nil error:&error];
  47.464      XCTAssertNotNil(encMsg);
  47.465 @@ -965,7 +965,7 @@
  47.466      XCTAssertNotNil(encMsg);
  47.467  
  47.468      PEPStringList *keys;
  47.469 -    PEP_rating pEpRating;
  47.470 +    PEPRating pEpRating;
  47.471      error = nil;
  47.472      PEPMessage *decMsg = [session
  47.473                            decryptMessage:encMsg
  47.474 @@ -977,7 +977,7 @@
  47.475      XCTAssertNotNil(decMsg);
  47.476      XCTAssertNil(error);
  47.477  
  47.478 -    XCTAssertEqual(pEpRating, PEP_rating_unencrypted);
  47.479 +    XCTAssertEqual(pEpRating, PEPRatingUnencrypted);
  47.480      XCTAssertNotNil(decMsg);
  47.481  }
  47.482  
  47.483 @@ -1042,8 +1042,8 @@
  47.484  
  47.485      void (^ratingBlock)(void) = ^{
  47.486          PEPSession *innerSession = [PEPSession new];
  47.487 -        PEP_rating rating = [self ratingForIdentity:identAlice session:innerSession];
  47.488 -        XCTAssertEqual(rating, PEP_rating_reliable);
  47.489 +        PEPRating rating = [self ratingForIdentity:identAlice session:innerSession];
  47.490 +        XCTAssertEqual(rating, PEPRatingReliable);
  47.491      };
  47.492  
  47.493      for (int i = 0; i < 4; ++i) {
  47.494 @@ -1094,12 +1094,12 @@
  47.495      message.shortMessage = shortMessage;
  47.496      message.longMessage = longMessage;
  47.497  
  47.498 -    PEP_STATUS status = PEP_KEY_NOT_FOUND;
  47.499 +    PEPStatus status = PEPStatusKeyNotFound;
  47.500      error = nil;
  47.501      PEPMessage *encrypted = [session
  47.502                               encryptMessage:message
  47.503                               toFpr:fprAlice
  47.504 -                             encFormat:PEP_enc_PEP
  47.505 +                             encFormat:PEPEncFormatPEP
  47.506                               flags:0
  47.507                               status:&status error:&error];
  47.508      XCTAssertEqual(status, PEP_ILLEGAL_VALUE);
  47.509 @@ -1211,7 +1211,7 @@
  47.510  
  47.511      error = nil;
  47.512      PEPStringList *keys;
  47.513 -    PEP_rating rating = PEP_rating_undefined;
  47.514 +    PEPRating rating = PEPRatingUndefined;
  47.515      PEPMessage *decmsg = [session
  47.516                            decryptMessage:mail
  47.517                            flags:nil
  47.518 @@ -1221,7 +1221,7 @@
  47.519                            error:&error];
  47.520      XCTAssertNotNil(decmsg);
  47.521      XCTAssertNil(error);
  47.522 -    XCTAssertEqual(rating, PEP_rating_unencrypted);
  47.523 +    XCTAssertEqual(rating, PEPRatingUnencrypted);
  47.524  
  47.525      PEPAttachment *decryptedAttachment = [decmsg.attachments objectAtIndex:0];
  47.526      XCTAssertEqualObjects(decryptedAttachment.mimeType, attachment.mimeType);
  47.527 @@ -1356,7 +1356,7 @@
  47.528      message.shortMessage = shortMessage;
  47.529      message.longMessage = longMessage;
  47.530  
  47.531 -    PEP_STATUS status = PEP_KEY_NOT_FOUND;
  47.532 +    PEPStatus status = PEPStatusKeyNotFound;
  47.533      PEPMessage *encryptedMessage =  [session encryptMessage:message
  47.534                                                    extraKeys:@[]
  47.535                                                       status:&status
  47.536 @@ -1373,9 +1373,9 @@
  47.537  
  47.538  /**
  47.539   Determines the rating for the given identity.
  47.540 - @return PEP_rating_undefined on error
  47.541 + @return PEPRatingUndefined on error
  47.542   */
  47.543 -- (PEP_rating)ratingForIdentity:(PEPIdentity *)identity session:(PEPSession *)session
  47.544 +- (PEPRating)ratingForIdentity:(PEPIdentity *)identity session:(PEPSession *)session
  47.545  {
  47.546      NSError *error;
  47.547      NSNumber *numRating = [session ratingForIdentity:identity error:&error];
  47.548 @@ -1477,7 +1477,7 @@
  47.549                                   shortMessage:shortMessage
  47.550                                    longMessage:longMessage
  47.551                                       outgoing:YES];
  47.552 -    PEP_STATUS status = PEP_UNKNOWN_ERROR;
  47.553 +    PEPStatus status = PEP_UNKNOWN_ERROR;
  47.554      PEPMessage *encMessage = [session
  47.555                                encryptMessage:mail
  47.556                                forSelf:me
  47.557 @@ -1516,7 +1516,7 @@
  47.558      XCTAssertEqual(status, 0);
  47.559      XCTAssertEqualObjects(encMessage.shortMessage, @"p≡p");
  47.560  
  47.561 -    PEP_rating rating;
  47.562 +    PEPRating rating;
  47.563      error = nil;
  47.564      PEPMessage *unencDict = [session
  47.565                               decryptMessage:encMessage
  47.566 @@ -1528,7 +1528,7 @@
  47.567      XCTAssertNotNil(unencDict);
  47.568      XCTAssertNil(error);
  47.569  
  47.570 -    XCTAssertGreaterThanOrEqual(rating, PEP_rating_reliable);
  47.571 +    XCTAssertGreaterThanOrEqual(rating, PEPRatingReliable);
  47.572  
  47.573      XCTAssertEqualObjects(unencDict.shortMessage, shortMessage);
  47.574      XCTAssertEqualObjects(unencDict.longMessage, longMessage);
  47.575 @@ -1542,7 +1542,7 @@
  47.576  }
  47.577  
  47.578  - (void)helperXEncStatusForOutgoingEncryptdMailToSelf:(BOOL)toSelf
  47.579 -                                       expectedRating:(PEP_rating)expectedRating
  47.580 +                                       expectedRating:(PEPRating)expectedRating
  47.581  {
  47.582      PEPSession *session = [PEPSession new];
  47.583  
  47.584 @@ -1580,11 +1580,11 @@
  47.585      NSNumber *numRating = [self testOutgoingRatingForMessage:msg session:session error:&error];
  47.586      XCTAssertNotNil(numRating);
  47.587      XCTAssertNil(error);
  47.588 -    XCTAssertEqual(numRating.pEpRating, PEP_rating_reliable);
  47.589 +    XCTAssertEqual(numRating.pEpRating, PEPRatingReliable);
  47.590  
  47.591      PEPMessage *encMsg;
  47.592  
  47.593 -    PEP_STATUS statusEnc = PEP_VERSION_MISMATCH;
  47.594 +    PEPStatus statusEnc = PEP_VERSION_MISMATCH;
  47.595      if (toSelf) {
  47.596          encMsg = [session
  47.597                    encryptMessage:msg
  47.598 @@ -1601,7 +1601,7 @@
  47.599      XCTAssertNotNil(encMsg);
  47.600  
  47.601      PEPStringList *keys;
  47.602 -    PEP_rating pEpRating;
  47.603 +    PEPRating pEpRating;
  47.604      error = nil;
  47.605      PEPMessage *decMsg = [session
  47.606                            decryptMessage:encMsg
  47.607 @@ -1624,7 +1624,7 @@
  47.608      }
  47.609      XCTAssertNotNil(encStatusField);
  47.610      if (encStatusField) {
  47.611 -        PEP_rating outgoingRating = [session ratingFromString:encStatusField[1]];
  47.612 +        PEPRating outgoingRating = [session ratingFromString:encStatusField[1]];
  47.613          XCTAssertEqual(outgoingRating, expectedRating);
  47.614      }
  47.615  }
    48.1 --- a/pEpObjCTests/TestUtils/PEPTestUtils.m	Wed Feb 20 09:18:34 2019 +0100
    48.2 +++ b/pEpObjCTests/TestUtils/PEPTestUtils.m	Thu Mar 21 12:37:32 2019 +0100
    48.3 @@ -10,8 +10,7 @@
    48.4  
    48.5  #import "PEPTestUtils.h"
    48.6  
    48.7 -#import "NSDictionary+Extension.h"
    48.8 -#import "PEPIdentity.h"
    48.9 +#import "PEPObjCAdapterFramework.h"
   48.10  #import "PEPInternalSession.h"
   48.11  #import "PEPMessage.h"
   48.12  #import "PEPSession.h"
   48.13 @@ -111,7 +110,7 @@
   48.14      PEPMessage *message = [PEPMessage new];
   48.15      message.from = fromIdent;
   48.16      message.to = @[toIdent];
   48.17 -    message.direction = outgoing ? PEP_dir_outgoing:PEP_dir_incoming;
   48.18 +    message.direction = outgoing ? PEPMsgDirectionOutgoing : PEPMsgDirectionIncoming;
   48.19      message.shortMessage = shortMessage;
   48.20      message.longMessage = longMessage;
   48.21      return message;