001/**
002 *
003 * Copyright 2017 Paul Schaub
004 *
005 * Licensed under the Apache License, Version 2.0 (the "License");
006 * you may not use this file except in compliance with the License.
007 * You may obtain a copy of the License at
008 *
009 *     http://www.apache.org/licenses/LICENSE-2.0
010 *
011 * Unless required by applicable law or agreed to in writing, software
012 * distributed under the License is distributed on an "AS IS" BASIS,
013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014 * See the License for the specific language governing permissions and
015 * limitations under the License.
016 */
017package org.jivesoftware.smackx.omemo.util;
018
019/**
020 * Some constants related to OMEMO.
021 *
022 * @author Paul Schaub
023 */
024public final class OmemoConstants {
025
026    /**
027     * Omemo related namespace.
028     */
029    public static final String OMEMO_NAMESPACE_V_AXOLOTL = "eu.siacs.conversations.axolotl";
030    public static final String OMEMO = "OMEMO";
031
032    // PubSub Node names
033    public static final String PEP_NODE_DEVICE_LIST = OMEMO_NAMESPACE_V_AXOLOTL + ".devicelist";
034    public static final String PEP_NODE_BUNDLES = OMEMO_NAMESPACE_V_AXOLOTL + ".bundles";
035
036    /**
037     * How many preKeys do we want to publish?
038     */
039    public static final int PRE_KEY_COUNT_PER_BUNDLE = 100;
040
041    /**
042     * Return the node name of the PEP node containing the device bundle of the device with device id deviceId.
043     *
044     * @param deviceId id of the device
045     * @return node name of the devices bundle node
046     */
047    public static String PEP_NODE_BUNDLE_FROM_DEVICE_ID(int deviceId) {
048        return PEP_NODE_BUNDLES + ":" + deviceId;
049    }
050
051    public static final String BODY_OMEMO_HINT = "I sent you an OMEMO encrypted message but your client doesn't seem to support that. Find more information on https://conversations.im/omemo";
052
053    /**
054     * Information about the keys used for message encryption.
055     */
056    public static final class Crypto {
057        public static final String KEYTYPE = "AES";
058        public static final int KEYLENGTH = 128;
059        public static final String CIPHERMODE = "AES/GCM/NoPadding";
060    }
061}