pEpObjCAdapterFramework/PEPEngineTypes.h
author Dirk Zimmermann <dz@pep.security>
Fri, 20 Sep 2019 17:00:26 +0200
branchIOSAD-132
changeset 1269 f86b14fa343e
parent 1268 e7e25cb25a42
child 1270 28534fa461d5
permissions -rw-r--r--
IOSAD-132 PEPMsgDirection.
dz@815
     1
//
dz@839
     2
//  PEPTypes.h
dz@815
     3
//  pEpObjCAdapter
dz@815
     4
//
dz@815
     5
//  Created by Dirk Zimmermann on 27.02.19.
dz@815
     6
//  Copyright © 2019 p≡p. All rights reserved.
dz@815
     7
//
dz@815
     8
dz@839
     9
#ifndef PEPTypes_h
dz@839
    10
#define PEPTypes_h
dz@815
    11
dz@845
    12
#import <Foundation/Foundation.h>
dz@845
    13
dz@1255
    14
typedef NS_CLOSED_ENUM(int, PEPDecryptFlags) {
dz@1255
    15
    PEPDecryptFlagsNone = 0x0, // not actually defined in the engine
dz@1255
    16
    PEPDecryptFlagsOwnPrivateKey = 0x1, // PEP_decrypt_flag_own_private_key
dz@1255
    17
    PEPDecryptFlagsConsume = 0x2, //PEP_decrypt_flag_consume
dz@1255
    18
    PEPDecryptFlagsIgnore = 0x4, // PEP_decrypt_flag_ignore
dz@1255
    19
    PEPDecryptFlagsSourceModified = 0x8, // PEP_decrypt_flag_src_modified
dz@1255
    20
    PEPDecryptFlagsUntrustedServer = 0x100, // PEP_decrypt_flag_untrusted_server
dz@1255
    21
    PEPDecryptFlagsDontTriggerSync = 0x200, // PEP_decrypt_flag_dont_trigger_sync
dz@1255
    22
};
dz@815
    23
dz@1263
    24
typedef NS_CLOSED_ENUM(int, PEPEncFormat) {
dz@1256
    25
    PEPEncFormatNone = 0, // PEP_enc_none
dz@1256
    26
    PEPEncFormatPieces, // PEP_enc_pieces, PEP_enc_inline
dz@1256
    27
    PEPEncFormatSMIME, // PEP_enc_S_MIME
dz@1256
    28
    PEPEncFormatPGPMIME, // PEP_enc_PGP_MIME
dz@1256
    29
    PEPEncFormatPEP, // PEP_enc_PEP
dz@1256
    30
    PEPEncFormatPGPMIMEOutlook1 // PEP_enc_PGP_MIME_Outlook1
dz@862
    31
};
dz@818
    32
dz@1263
    33
typedef NS_CLOSED_ENUM(int, PEPRating) {
dz@1257
    34
    PEPRatingUndefined = 0, // PEP_rating_undefined
dz@1257
    35
    PEPRatingCannotDecrypt, // PEP_rating_cannot_decrypt
dz@1257
    36
    PEPRatingHaveNoKey, // PEP_rating_have_no_key
dz@1257
    37
    PEPRatingUnencrypted, // PEP_rating_unencrypted
dz@1257
    38
    PEPRatingUnencryptedForSome, // PEP_rating_unencrypted_for_some
dz@1257
    39
    PEPRatingUnreliable, // PEP_rating_unreliable
dz@1257
    40
    PEPRatingReliable, // PEP_rating_reliable
dz@1257
    41
    PEPRatingTrusted, // PEP_rating_trusted
dz@1257
    42
    PEPRatingTrustedAndAnonymized, // PEP_rating_trusted_and_anonymized
dz@1257
    43
    PEPRatingFullyAnonymous, // PEP_rating_fully_anonymous
dz@819
    44
dz@1257
    45
    PEPRatingMistrust = -1, // PEP_rating_mistrust
dz@1257
    46
    PEPRatingB0rken = -2, // PEP_rating_b0rken
dz@1257
    47
    PEPRatingUnderAttack = -3 // PEP_rating_under_attack
dz@862
    48
};
dz@819
    49
dz@1263
    50
typedef NS_CLOSED_ENUM(int, PEPStatus) {
dz@1258
    51
    PEPStatusOK = 0, // PEP_STATUS_OK
dz@820
    52
dz@1258
    53
    PEPStatusInitCannotLoadGPME = 0x0110, // PEP_INIT_CANNOT_LOAD_GPGME
dz@1258
    54
    PEPStatusInitGPGMEInitFailed = 0x0111, // PEP_INIT_GPGME_INIT_FAILED
dz@1258
    55
    PEPStatusInitNoGPGHome = 0x0112, // PEP_INIT_NO_GPG_HOME
dz@1258
    56
    PEPStatusInitNETPGPInitFailed = 0x0113, // PEP_INIT_NETPGP_INIT_FAILED
dz@1258
    57
    PEPStatusInitCannotDetermineGPGVersion = 0x0114, // PEP_INIT_CANNOT_DETERMINE_GPG_VERSION
dz@1258
    58
    PEPStatusInitUnsupportedGPGVersion = 0x0115, // PEP_INIT_UNSUPPORTED_GPG_VERSION
dz@1258
    59
    PEPStatusInitCannotConfigGPGAgent = 0x0116, // PEP_INIT_CANNOT_CONFIG_GPG_AGENT
dz@820
    60
dz@1258
    61
    PEPStatusInitSqlite3WithoutMutex = 0x0120, // PEP_INIT_SQLITE3_WITHOUT_MUTEX
dz@1258
    62
    PEPStatusInitCannotOpenDB = 0x0121, // PEP_INIT_CANNOT_OPEN_DB
dz@1258
    63
    PEPStatusInitCannotOpenSystemDB = 0x0122, // PEP_INIT_CANNOT_OPEN_SYSTEM_DB
dz@1258
    64
    PEPStatusUnknownDBError = 0x01ff, // PEP_UNKNOWN_DB_ERROR
dz@820
    65
dz@1258
    66
    PEPStatusKeyNotFound = 0x0201, // PEP_KEY_NOT_FOUND
dz@1258
    67
    PEPStatusKeyHasAmbigName = 0x0202, // PEP_KEY_HAS_AMBIG_NAME
dz@1258
    68
    PEPStatusGetKeyFailed = 0x0203, // PEP_GET_KEY_FAILED
dz@1258
    69
    PEPStatusCannotExportKey = 0x0204, // PEP_CANNOT_EXPORT_KEY
dz@1258
    70
    PEPStatusCannotEditKey = 0x0205, // PEP_CANNOT_EDIT_KEY
dz@1258
    71
    PEPStatusKeyUnsuitable = 0x0206, // PEP_KEY_UNSUITABLE
dz@1258
    72
    PEPStatusMalformedKeyResetMsg = 0x0210, // PEP_MALFORMED_KEY_RESET_MSG
dz@1258
    73
    PEPStatusKeyNotReset = 0x0211, // PEP_KEY_NOT_RESET
dz@1259
    74
    PEPStatusCannotDeleteKey = 0x0212, // PEP_CANNOT_DELETE_KEY
dz@820
    75
dz@1258
    76
    PEPStatusKeyImported = 0x0220, // PEP_KEY_IMPORTED
dz@1258
    77
    PEPStatusNoKeyImported = 0x0221, // PEP_NO_KEY_IMPORTED
dz@1258
    78
    PEPStatusKeyImportStatusUnknown = 0x0222, // PEP_KEY_IMPORT_STATUS_UNKNOWN
dz@1260
    79
    PEPStatusSomeKeysImported = 0x0223, // PEP_SOME_KEYS_IMPORTED
dz@820
    80
dz@1258
    81
    PEPStatusCannotFindIdentity = 0x0301, // PEP_CANNOT_FIND_IDENTITY
dz@1258
    82
    PEPStatusCannotSetPerson = 0x0381, // PEP_CANNOT_SET_PERSON
dz@1258
    83
    PEPStatusCannotSetPGPKeyPair = 0x0382, // PEP_CANNOT_SET_PGP_KEYPAIR
dz@1258
    84
    PEPStatusCannotSetIdentity = 0x0383, // PEP_CANNOT_SET_IDENTITY
dz@1258
    85
    PEPStatusCannotSetTrust = 0x0384, // PEP_CANNOT_SET_TRUST
dz@1258
    86
    PEPStatusKeyBlacklisted = 0x0385, // PEP_KEY_BLACKLISTED
dz@1258
    87
    PEPStatusCannotFindPerson = 0x0386, // PEP_CANNOT_FIND_PERSON
dz@1149
    88
    PEPStatusCannotSetPEPVersion = 0X0387, // PEP_CANNOT_SET_PEP_VERSION
dz@820
    89
dz@1258
    90
    PEPStatusCannotFindAlias = 0x0391, // PEP_CANNOT_FIND_ALIAS
dz@1258
    91
    PEPStatusCannotSetAlias = 0x0392, // PEP_CANNOT_SET_ALIAS
dz@820
    92
dz@1258
    93
    PEPStatusUnencrypted = 0x0400, // PEP_UNENCRYPTED
dz@1258
    94
    PEPStatusVerified = 0x0401, // PEP_VERIFIED
dz@1258
    95
    PEPStatusDecrypted = 0x0402, // PEP_DECRYPTED
dz@1258
    96
    PEPStatusDecryptedAndVerified = 0x0403, // PEP_DECRYPTED_AND_VERIFIED
dz@1258
    97
    PEPStatusDecryptWrongFormat = 0x0404, // PEP_DECRYPT_WRONG_FORMAT
dz@1258
    98
    PEPStatusDecryptNoKey = 0x0405, // PEP_DECRYPT_NO_KEY
dz@1258
    99
    PEPStatusDecryptSignatureDoesNotMatch = 0x0406, // PEP_DECRYPT_SIGNATURE_DOES_NOT_MATCH
dz@1258
   100
    PEPStatusVerifyNoKey = 0x0407, // PEP_VERIFY_NO_KEY
dz@1258
   101
    PEPStatusVerifiedAndTrusted = 0x0408, // PEP_VERIFIED_AND_TRUSTED
dz@1258
   102
    PEPStatusCannotReencrypt = 0x0409, // PEP_CANNOT_REENCRYPT
dz@1258
   103
    PEPStatusCannotDecryptUnknown = 0x04ff, // PEP_CANNOT_DECRYPT_UNKNOWN
dz@820
   104
dz@1258
   105
    PEPStatusTrustwordNotFound = 0x0501, // PEP_TRUSTWORD_NOT_FOUND
dz@1258
   106
    PEPStatusTrustwordsFPRWrongLength = 0x0502, // PEP_TRUSTWORDS_FPR_WRONG_LENGTH
dz@1258
   107
    PEPStatusTrustwordsDuplicateFPR = 0x0503, // PEP_TRUSTWORDS_DUPLICATE_FPR
dz@820
   108
dz@1258
   109
    PEPStatusCannotCreateKey = 0x0601, // PEP_CANNOT_CREATE_KEY
dz@1258
   110
    PEPStatusCannotSendKey = 0x0602, // PEP_CANNOT_SEND_KEY
dz@820
   111
dz@1258
   112
    PEPStatusPhraseNotFound = 0x0701, // PEP_PHRASE_NOT_FOUND
dz@820
   113
dz@1258
   114
    PEPStatusSendFunctionNotRegistered = 0x0801, // PEP_SEND_FUNCTION_NOT_REGISTERED
dz@1258
   115
    PEPStatusConstraintsViolated = 0x0802, // PEP_CONTRAINTS_VIOLATED
dz@1258
   116
    PEPStatusCannotEncode = 0x0803, // PEP_CANNOT_ENCODE
dz@820
   117
dz@1258
   118
    PEPStatusSyncNoNotifyCallback = 0x0901, // PEP_SYNC_NO_NOTIFY_CALLBACK
dz@1258
   119
    PEPStatusSyncIllegalMessage = 0x0902, // PEP_SYNC_ILLEGAL_MESSAGE
dz@1258
   120
    PEPStatusSyncNoInjectCallback = 0x0903, // PEP_SYNC_NO_INJECT_CALLBACK
dz@1258
   121
    PEPStatusSyncNoChannel = 0x0904, // PEP_SYNC_NO_CHANNEL
dz@1258
   122
    PEPStatusSyncCannotEncrypt = 0x0905, // PEP_SYNC_CANNOT_ENCRYPT
dz@1258
   123
    PEPStatusSyncNoMessageSendCallback = 0x0906, // PEP_SYNC_NO_MESSAGE_SEND_CALLBACK
dz@1261
   124
    PEPStatusSyncCannotStart = 0x0907, // PEP_SYNC_CANNOT_START
dz@820
   125
dz@1258
   126
    PEPStatusCannotIncreaseSequence = 0x0971, // PEP_CANNOT_INCREASE_SEQUENCE
dz@820
   127
dz@1258
   128
    PEPStatusStatemachineError = 0x0980, // PEP_STATEMACHINE_ERROR
dz@1258
   129
    PEPStatusNoTrust = 0x0981, // PEP_NO_TRUST
dz@1258
   130
    PEPStatusStatemachineInvalidState = 0x0982, // PEP_STATEMACHINE_INVALID_STATE
dz@1258
   131
    PEPStatusStatemachineInvalidEvent = 0x0983, // PEP_STATEMACHINE_INVALID_EVENT
dz@1258
   132
    PEPStatusStatemachineInvalidCondition = 0x0984, // PEP_STATEMACHINE_INVALID_CONDITION
dz@1258
   133
    PEPStatusStatemachineInvalidAction = 0x0985, // PEP_STATEMACHINE_INVALID_ACTION
dz@1258
   134
    PEPStatusStatemachineInhibitedEvent = 0x0986, // PEP_STATEMACHINE_INHIBITED_EVENT
dz@1258
   135
    PEPStatusStatemachineCannotSend = 0x0987, // PEP_STATEMACHINE_CANNOT_SEND
dz@820
   136
dz@1258
   137
    PEPStatusCommitFailed = 0xff01, // PEP_COMMIT_FAILED
dz@1258
   138
    PEPStatusMessageConsume = 0xff02, // PEP_MESSAGE_CONSUME
dz@1258
   139
    PEPStatusMessageIgnore = 0xff03, // PEP_MESSAGE_IGNORE
dz@1262
   140
    PEPStatusCannotConfig = 0xff04, // PEP_CANNOT_CONFIG
dz@820
   141
dz@1258
   142
    PEPStatusRecordNotFound = -6, // PEP_RECORD_NOT_FOUND
dz@1258
   143
    PEPStatusCannotCreateTempFile = -5, // PEP_CANNOT_CREATE_TEMP_FILE
dz@1258
   144
    PEPStatusIllegalValue = -4, // PEP_ILLEGAL_VALUE
dz@1258
   145
    PEPStatusBufferTooSmall = -3, // PEP_BUFFER_TOO_SMALL
dz@1258
   146
    PEPStatusOutOfMemory = -2, // PEP_OUT_OF_MEMORY
dz@1258
   147
    PEPStatusUnknownError = -1, // PEP_UNKNOWN_ERROR
dz@820
   148
dz@1258
   149
    PEPStatusVersionMismatch = -7, // PEP_VERSION_MISMATCH
dz@862
   150
};
dz@820
   151
dz@1263
   152
typedef NS_CLOSED_ENUM(int, PEPIdentityFlags) {
dz@1264
   153
    PEPIdentityFlagsNotForSync = 0x0001, // PEP_idf_not_for_sync
dz@1264
   154
    PEPIdentityFlagsList = 0x0002, // PEP_idf_list = 0x0002
dz@1264
   155
    PEPIdentityFlagsDeviceGroup = 0x0100 // PEP_idf_devicegroup
dz@862
   156
};
dz@823
   157
dz@1265
   158
typedef NS_CLOSED_ENUM(int, PEPSyncHandshakeSignal) {
dz@1265
   159
    PEPSyncHandshakeSignalUndefined = 0, // SYNC_NOTIFY_UNDEFINED
dz@933
   160
dz@1265
   161
    PEPSyncHandshakeSignalInitAddOurDevice = 1, // SYNC_NOTIFY_INIT_ADD_OUR_DEVICE
dz@1265
   162
    PEPSyncHandshakeSignalInitAddOtherDevice = 2, // SYNC_NOTIFY_INIT_ADD_OTHER_DEVICE
dz@1265
   163
    PEPSyncHandshakeSignalInitFormGroup = 3, // SYNC_NOTIFY_INIT_FORM_GROUP
dz@933
   164
dz@1265
   165
    PEPSyncHandshakeSignalTimeout = 5, // SYNC_NOTIFY_TIMEOUT
dz@933
   166
dz@1265
   167
    PEPSyncHandshakeSignalAcceptedDeviceAdded = 6, // SYNC_NOTIFY_ACCEPTED_DEVICE_ADDED
dz@1265
   168
    PEPSyncHandshakeSignalAcceptedGroupCreated = 7, // SYNC_NOTIFY_ACCEPTED_GROUP_CREATED
dz@933
   169
dz@1265
   170
    PEPSyncHandshakeSignalOvertaken = 9, // SYNC_NOTIFY_OVERTAKEN
dz@933
   171
dz@1265
   172
    PEPSyncHandshakeSignalFormingGroup = 10, // SYNC_NOTIFY_FORMING_GROUP
andreas@1167
   173
dz@1265
   174
    PEPSyncHandshakeSignalSole = 254, // SYNC_NOTIFY_SOLE
dz@1265
   175
    PEPSyncHandshakeSignalInGroup = 255 // SYNC_NOTIFY_IN_GROUP
dz@933
   176
};
dz@933
   177
dz@1263
   178
typedef NS_CLOSED_ENUM(int, PEPSyncHandshakeResult) {
dz@1266
   179
    PEPSyncHandshakeResultCancel = -1, // SYNC_HANDSHAKE_CANCEL
dz@1266
   180
    PEPSyncHandshakeResultAccepted = 0, // SYNC_HANDSHAKE_ACCEPTED
dz@1266
   181
    PEPSyncHandshakeResultRejected = 1 // SYNC_HANDSHAKE_REJECTED
dz@862
   182
};
dz@824
   183
dz@1263
   184
typedef NS_CLOSED_ENUM(int, PEPCommType) {
dz@1267
   185
    PEPCommTypeUnknown = 0, // PEP_ct_unknown
dz@1267
   186
    PEPCommTypeNoEncryption = 0x01, // PEP_ct_no_encryption
dz@1267
   187
    PEPCommTypeNoEncrypted_channel = 0x02, // PEP_ct_no_encrypted_channel
dz@1267
   188
    PEPCommTypeKeyNotFound = 0x03, // PEP_ct_key_not_found
dz@1267
   189
    PEPCommTypeKeyExpired = 0x04, // PEP_ct_key_expired
dz@1267
   190
    PEPCommTypeKeyRevoked = 0x05, // PEP_ct_key_revoked
dz@1268
   191
    PEPCommTypeKeyB0rken = 0x06, // PEP_ct_key_b0rken
dz@1267
   192
    PEPCommTypeKeyExpiredButConfirmed = 0x07, // PEP_ct_key_expired_but_confirmed renewal.
dz@1267
   193
    PEPCommTypeMyKeyNotIncluded = 0x09, // PEP_ct_my_key_not_included
dz@832
   194
dz@1267
   195
    PEPCommTypeSecurityByObscurity = 0x0a, // PEP_ct_security_by_obscurity
dz@1268
   196
    PEPCommTypeB0rkenCrypto = 0x0b, // PEP_ct_b0rken_crypto
dz@1267
   197
    PEPCommTypeKeyTooShort = 0x0c, // PEP_ct_key_too_short
dz@832
   198
dz@1267
   199
    PEPCommTypeCompromised = 0x0e, // PEP_ct_compromized
dz@1267
   200
    PEPCommTypeMistrusted = 0x0f, // PEP_ct_mistrusted
dz@832
   201
dz@1267
   202
    PEPCommTypeUnconfirmedEncryption = 0x10, // PEP_ct_unconfirmed_encryption
dz@1267
   203
    PEPCommTypeOpenPGPWeakUnconfirmed = 0x11, // PEP_ct_OpenPGP_weak_unconfirmed
dz@832
   204
dz@1267
   205
    PEPCommTypeToBeChecked = 0x20, // PEP_ct_to_be_checked
dz@1267
   206
    PEPCommTypeSMIMEUnconfirmed = 0x21, // PEP_ct_SMIME_unconfirmed
dz@1267
   207
    PEPCommTypeCMSUnconfirmed = 0x22, // PEP_ct_CMS_unconfirmed
dz@832
   208
dz@1267
   209
    PEPCommTypeStongButUnconfirmed = 0x30, // PEP_ct_strong_but_unconfirmed
dz@1267
   210
    PEPCommTypeOpenPGPUnconfirmed = 0x38, // PEP_ct_OpenPGP_unconfirmed
dz@1267
   211
    PEPCommTypeOTRUnconfirmed = 0x3a, // PEP_ct_OTR_unconfirmed
dz@832
   212
dz@1267
   213
    PEPCommTypeUnconfirmedEncAnon = 0x40, // PEP_ct_unconfirmed_enc_anon
dz@1267
   214
    PEPCommTypePEPUnconfirmed = 0x7f, // PEP_ct_pEp_unconfirmed
dz@832
   215
dz@1267
   216
    PEPCommTypeConfirmed = 0x80, // PEP_ct_confirmed
dz@832
   217
dz@1267
   218
    PEPCommTypeConfirmedEncryption = 0x90, // PEP_ct_confirmed_encryption
dz@1267
   219
    PEPCommTypeOpenPGPWeak = 0x91, // PEP_ct_OpenPGP_weak
dz@832
   220
dz@1267
   221
    PEPCommTypeToBeCheckedConfirmed = 0xa0, // PEP_ct_to_be_checked_confirmed
dz@1267
   222
    PEPCommTypeSMIME = 0xa1, // PEP_ct_SMIME
dz@1267
   223
    PEPCommTypeCMS = 0xa2, // PEP_ct_CMS
dz@832
   224
dz@1267
   225
    PEPCommTypeStongEncryption = 0xb0, // PEP_ct_strong_encryption
dz@1267
   226
    PEPCommTypeOpenPGP = 0xb8, // PEP_ct_OpenPGP
dz@1267
   227
    PEPCommTypeOTR = 0xba, // PEP_ct_OTR
dz@832
   228
dz@1267
   229
    PEPCommTypeConfirmedEncAnon = 0xc0, // PEP_ct_confirmed_enc_anon
dz@1267
   230
    PEPCommTypePEP = 0xff // PEP_ct_pEp
dz@862
   231
};
dz@832
   232
dz@1263
   233
typedef NS_CLOSED_ENUM(int, PEPMsgDirection) {
dz@1269
   234
    PEPMsgDirectionIncoming = 0, // PEP_dir_incoming
dz@1269
   235
    PEPMsgDirectionOutgoing // PEP_dir_outgoing
dz@862
   236
};
dz@844
   237
dz@1263
   238
typedef NS_CLOSED_ENUM(int, PEPColor) {
dz@852
   239
    PEPColorNoColor = 0,
dz@852
   240
    PEPColorYellow,
dz@852
   241
    PEPColorGreen,
dz@852
   242
    PEPColorRed = -1,
dz@862
   243
};
dz@852
   244
dz@1263
   245
typedef NS_CLOSED_ENUM(int, PEPContentDisposition) {
dz@863
   246
    PEPContentDispositionAttachment = 0,
dz@863
   247
    PEPContentDispositionInline = 1,
dz@863
   248
    PEPContentDispositionOther = -1      // must be affirmatively set
dz@862
   249
};
dz@857
   250
dz@839
   251
#endif /* PEPTypes_h */