pEpObjCAdapter/PEPSession.h
branchIOSAD-50
changeset 268 afba0883d4d9
parent 264 32f2cfb49568
     1.1 --- a/pEpObjCAdapter/PEPSession.h	Tue Oct 10 18:51:46 2017 +0200
     1.2 +++ b/pEpObjCAdapter/PEPSession.h	Tue Oct 10 18:56:57 2017 +0200
     1.3 @@ -8,134 +8,11 @@
     1.4  
     1.5  #import <Foundation/Foundation.h>
     1.6  
     1.7 -#import "PEPObjCAdapter.h"
     1.8 -#import "PEPMessage.h"
     1.9 -
    1.10 -typedef NSDictionary<NSString *, id> PEPDict;
    1.11 -typedef NSMutableDictionary<NSString *, id> PEPMutableDict;
    1.12 -typedef NSArray<NSString *> PEPStringList;
    1.13 -
    1.14 -@class PEPSession;
    1.15 -@class PEPLanguage;
    1.16 -
    1.17  /**
    1.18   N threads <-> N sessions, with the constraint that a session is never used
    1.19   in a pEpEngine call more than once at the same time.
    1.20   */
    1.21  @interface PEPSession : NSObject
    1.22 -
    1.23 -/** Decrypt a message */
    1.24 -- (PEP_rating)decryptMessageDict:(nonnull PEPDict *)src
    1.25 -                            dest:(PEPDict * _Nullable * _Nullable)dst
    1.26 -                            keys:(PEPStringList * _Nullable * _Nullable)keys;
    1.27 -
    1.28 -/** Re-evaluate rating of decrypted message */
    1.29 -- (PEP_rating)reEvaluateMessageRating:(nonnull PEPDict *)src;
    1.30 -
    1.31 -/** Encrypt a message */
    1.32 -- (PEP_STATUS)encryptMessageDict:(nonnull PEPDict *)src
    1.33 -                           extra:(nullable PEPStringList *)keys
    1.34 -                            dest:(PEPDict * _Nullable * _Nullable)dst;
    1.35 -
    1.36 -/** Encrypt a message for the given identity, which is usually a mySelf identity */
    1.37 -- (PEP_STATUS)encryptMessageDict:(nonnull PEPDict *)src
    1.38 -                        identity:(nonnull PEPDict *)identity
    1.39 -                            dest:(PEPDict * _Nullable * _Nullable)dst;
    1.40 -
    1.41 -/** Determine the status color of a message to be sent */
    1.42 -- (PEP_rating)outgoingMessageColor:(nonnull PEPDict *)msg;
    1.43 -
    1.44 -/** Determine the rating of an identity */
    1.45 -- (PEP_rating)identityRating:(nonnull PEPDict *)identity;
    1.46 -
    1.47 -/** Get trustwords for a fingerprint */
    1.48 -- (nonnull NSArray *)trustwords:(nonnull NSString *)fpr forLanguage:(nonnull NSString *)languageID
    1.49 -                      shortened:(BOOL)shortened;
    1.50 -
    1.51 -/**
    1.52 - Supply an account used by our user himself. The identity is supplemented with the missing parts
    1.53 -
    1.54 - An identity is a `NSDictionary` mapping a field name as `NSString` to different values.
    1.55 - An identity can have the following fields (all other keys are ignored).
    1.56 - It is not necessary to supply all fields; missing fields are supplemented by p≡p engine.
    1.57 -
    1.58 - @"username": real name or nick name (if pseudonymous) of identity
    1.59 - @"address": URI or SMTP address
    1.60 - @"user_id": persistent unique ID for identity
    1.61 - @"lang": preferred languageID for communication with this ID (default: @"en")
    1.62 - @"fpr": fingerprint of key to use for communication with this ID
    1.63 - @"comm_type": communication type code (usually not needed)
    1.64 -
    1.65 - As an example:
    1.66 -
    1.67 - User has a mailbox. The mail address is "Dipul Khatri <dipul@inboxcube.com>". Then this would be:
    1.68 -
    1.69 - NSDictionary *ident = [NSDictionary dictionaryWithObjectsAndKeys:
    1.70 - @"Dipul Khatri", @"username", @"dipul@inboxcube.com", @"address",
    1.71 - @"23", @"user_id", nil];
    1.72 -
    1.73 - */
    1.74 -- (void)mySelf:(nonnull PEPMutableDict *)identity;
    1.75 -
    1.76 -/**
    1.77 - Supplement missing information for an arbitrary identity (used for communication partners).
    1.78 - See `mySelf:(NSMutableDictionary *)identity` for an explanation of identities.
    1.79 - */
    1.80 -- (void)updateIdentity:(nonnull PEPMutableDict *)identity;
    1.81 -
    1.82 -/**
    1.83 - Mark a key as trusted with a person.
    1.84 - See `mySelf:(NSMutableDictionary *)identity` for an explanation of identities.
    1.85 - */
    1.86 -- (void)trustPersonalKey:(nonnull PEPMutableDict *)identity;
    1.87 -
    1.88 -/**
    1.89 - if a key is not trusted by the user tell this using this message
    1.90 - See `mySelf:(NSMutableDictionary *)identity` for an explanation of identities.
    1.91 - */
    1.92 -- (void)keyMistrusted:(nonnull PEPMutableDict *)identity;
    1.93 -
    1.94 -/**
    1.95 - Use this to undo keyCompromized or trustPersonalKey
    1.96 - See `mySelf:(NSMutableDictionary *)identity` for an explanation of identities.
    1.97 - */
    1.98 -- (void)keyResetTrust:(nonnull PEPMutableDict *)identity;
    1.99 -
   1.100 -#pragma mark -- Internal API (testing etc.)
   1.101 -
   1.102 -/** For testing purpose, manual key import */
   1.103 -- (void)importKey:(nonnull NSString *)keydata;
   1.104 -
   1.105 -- (void)logTitle:(nonnull NSString *)title entity:(nonnull NSString *)entity
   1.106 -     description:(nullable NSString *)description comment:(nullable NSString *)comment;
   1.107 -
   1.108 -/**
   1.109 - Retrieves the log from the engine.
   1.110 - */
   1.111 -- (nonnull NSString *)getLog;
   1.112 -
   1.113 -/** Determine trustwords for two identities */
   1.114 -- (nullable NSString *)getTrustwordsIdentity1:(nonnull PEPDict *)identity1
   1.115 -                                    identity2:(nonnull PEPDict *)identity2
   1.116 -                                     language:(nullable NSString *)language
   1.117 -                                         full:(BOOL)full;
   1.118 -
   1.119 -/** Determine trustwords between sender of a message and receiving identity */
   1.120 -- (nullable NSString *)getTrustwordsMessageDict:(nonnull PEPDict *)messageDict
   1.121 -                                   receiverDict:(nonnull PEPDict *)receiverDict
   1.122 -                                      keysArray:(PEPStringList * _Nullable)keysArray
   1.123 -                                       language:(nullable NSString *)language
   1.124 -                                           full:(BOOL)full
   1.125 -                                resultingStatus:(PEP_STATUS * _Nullable)resultingStatus;
   1.126 -
   1.127 -/**
   1.128 - @returns The list of supported languages for trustwords.
   1.129 - */
   1.130 -- (NSArray<PEPLanguage *> * _Nonnull)languageList;
   1.131 -
   1.132 -/**
   1.133 - Directly invokes the engine's undo_last_mistrust() function
   1.134 - */
   1.135 -- (PEP_STATUS)undoLastMistrust;
   1.136 -
   1.137 +// We do not want the client to use a PEPSession. The client is supposed to use PEPObjCAdapter() only.
   1.138 +// Find everything in PEPSession+Internal.h
   1.139  @end