summaryrefslogtreecommitdiff
path: root/src/kolabcontact.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/kolabcontact.h')
-rw-r--r--src/kolabcontact.h33
1 files changed, 24 insertions, 9 deletions
diff --git a/src/kolabcontact.h b/src/kolabcontact.h
index e4164dd..30d3814 100644
--- a/src/kolabcontact.h
+++ b/src/kolabcontact.h
@@ -212,26 +212,18 @@ struct Crypto {
};
Crypto(): mCryptoTypes(0), mSignPref(Ask), mEncryptPref(Ask){};
bool operator==(const Crypto &other) const { return mCryptoTypes == other.mCryptoTypes &&
- mPGPKey == other.mPGPKey &&
- mSMIMEKey == other.mSMIMEKey &&
mSignPref == other.mSignPref &&
mEncryptPref == other.mEncryptPref; };
- bool isValid() const { return !(!mCryptoTypes && mPGPKey.empty() && mSMIMEKey.empty()); };
+ bool isValid() const { return mCryptoTypes; };
void setAllowed(int cryptoTypes) { mCryptoTypes = cryptoTypes; };
int allowed() const { return mCryptoTypes; };
- void setPGPKey(const std::string &k) { mPGPKey = k; };
- std::string pgpKey() const { return mPGPKey; };
- void setSMIMEKey(const std::string &k) { mSMIMEKey = k; };
- std::string smimeKey() const { return mSMIMEKey; };
void setSignPref(CryptoPref p) { mSignPref = p; };
CryptoPref signPref() const { return mSignPref; };
void setEncryptPref(CryptoPref p) { mEncryptPref = p; };
CryptoPref encryptPref() const { return mEncryptPref; };
private:
int mCryptoTypes;
- std::string mPGPKey;
- std::string mSMIMEKey;
CryptoPref mSignPref;
CryptoPref mEncryptPref;
};
@@ -246,6 +238,26 @@ struct Geo {
double longitude;
};
+struct Key {
+ enum KeyType {
+ Invalid,
+ PGP,
+ PKCS7_MIME
+ };
+ Key(): keytype(Invalid) {};
+ Key(const std::string &k, KeyType type)
+ : mKey(k), keytype(type) {};
+
+ bool operator==(const Key &other) const{ return (mKey == other.mKey && keytype == other.keytype);};
+
+ KeyType type() const { return keytype; };
+ std::string key() const { return mKey; };
+
+private:
+ std::string mKey;
+ KeyType keytype;
+};
+
class DistList {
public:
@@ -364,6 +376,9 @@ public:
void setGPSpos(const std::vector<Geo> &);
std::vector<Geo> gpsPos() const;
+ void setKeys(const std::vector<Key> &);
+ std::vector<Key> keys() const;
+
void setCrypto(const Crypto &);
Crypto crypto() const;