blob: 4afc0e289e36c3d5ce4b011fa574247032d6c725 [file] [log] [blame]
Alexandre Savardf7f9e0b2012-10-15 17:24:07 -04001/**
2 * Copyright (C) 2004-2012 Savoir-Faire Linux Inc.
3 *
4 * Author: Alexandre Savard <alexandre.savard@savoirfairelinux.com>
5 *
6 * This program is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
10 * If you own a pjsip commercial license you can also redistribute it
11 * and/or modify it under the terms of the GNU Lesser General Public License
12 * as an android library.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program. If not, see <http://www.gnu.org/licenses/>.
21 */
22package com.savoirfairelinux.sflphone.utils;
23
24import com.savoirfairelinux.sflphone.R;
25import com.savoirfairelinux.sflphone.utils.AccountDetail;
26
27import java.util.Collection;
28import java.util.Set;
29import java.util.HashMap;
30
31public class AccountDetailSrtp implements AccountDetail{
32
33 public static final String CONFIG_SRTP_ENABLE = "SRTP.enable";
34 public static final String CONFIG_SRTP_KEY_EXCHANGE = "SRTP.keyExchange";
35 public static final String CONFIG_SRTP_ENCRYPTION_ALGO = "SRTP.encryptionAlgorithm"; // Provided by ccRTP,0=NULL,1=AESCM,2=AESF8
36 public static final String CONFIG_SRTP_RTP_FALLBACK = "SRTP.rtpFallback";
37 public static final String CONFIG_ZRTP_HELLO_HASH = "ZRTP.helloHashEnable";
38 public static final String CONFIG_ZRTP_DISPLAY_SAS = "ZRTP.displaySAS";
39 public static final String CONFIG_ZRTP_NOT_SUPP_WARNING = "ZRTP.notSuppWarning";
40 public static final String CONFIG_ZRTP_DISPLAY_SAS_ONCE = "ZRTP.displaySasOnce";
41
42 private HashMap<String, AccountDetail.PreferenceEntry> privateMap;
43
44 public AccountDetailSrtp()
45 {
46 privateMap = new HashMap<String, AccountDetail.PreferenceEntry>();
47
48 privateMap.put(CONFIG_SRTP_ENABLE,
Alexandre Savard20d0de02012-10-16 14:05:44 -040049 new PreferenceEntry(CONFIG_SRTP_ENABLE, R.string.account_srtp_enabled_label, true));
Alexandre Savardf7f9e0b2012-10-15 17:24:07 -040050 privateMap.put(CONFIG_SRTP_KEY_EXCHANGE,
Alexandre Savard20d0de02012-10-16 14:05:44 -040051 new PreferenceEntry(CONFIG_SRTP_KEY_EXCHANGE, R.string.account_srtp_exchange_label, true));
Alexandre Savardf7f9e0b2012-10-15 17:24:07 -040052 privateMap.put(CONFIG_SRTP_ENCRYPTION_ALGO,
Alexandre Savard20d0de02012-10-16 14:05:44 -040053 new PreferenceEntry(CONFIG_SRTP_ENCRYPTION_ALGO, R.string.account_encryption_algo_label, true));
Alexandre Savardf7f9e0b2012-10-15 17:24:07 -040054 privateMap.put(CONFIG_SRTP_RTP_FALLBACK,
Alexandre Savard20d0de02012-10-16 14:05:44 -040055 new PreferenceEntry(CONFIG_SRTP_RTP_FALLBACK, R.string.account_srtp_fallback_label, true));
Alexandre Savardf7f9e0b2012-10-15 17:24:07 -040056 privateMap.put(CONFIG_ZRTP_HELLO_HASH,
Alexandre Savard20d0de02012-10-16 14:05:44 -040057 new PreferenceEntry(CONFIG_ZRTP_HELLO_HASH, R.string.account_hello_hash_enable_label, true));
Alexandre Savardf7f9e0b2012-10-15 17:24:07 -040058 privateMap.put(CONFIG_ZRTP_DISPLAY_SAS,
Alexandre Savard20d0de02012-10-16 14:05:44 -040059 new PreferenceEntry(CONFIG_ZRTP_DISPLAY_SAS, R.string.account_display_sas_label, true));
Alexandre Savardf7f9e0b2012-10-15 17:24:07 -040060 privateMap.put(CONFIG_ZRTP_NOT_SUPP_WARNING,
Alexandre Savard20d0de02012-10-16 14:05:44 -040061 new PreferenceEntry(CONFIG_ZRTP_NOT_SUPP_WARNING, R.string.account_not_supported_warning_label, true));
Alexandre Savardf7f9e0b2012-10-15 17:24:07 -040062 privateMap.put(CONFIG_ZRTP_DISPLAY_SAS_ONCE,
Alexandre Savard20d0de02012-10-16 14:05:44 -040063 new PreferenceEntry(CONFIG_ZRTP_DISPLAY_SAS_ONCE, R.string.account_display_sas_once_label, true));
Alexandre Savardf7f9e0b2012-10-15 17:24:07 -040064 }
65
66 public Set<String> getDetailKeys()
67 {
68 return privateMap.keySet();
69 }
70
71 public Collection<AccountDetail.PreferenceEntry> getDetailValues()
72 {
73 return privateMap.values();
74 }
75}