OmemoConstants.java

  1. /**
  2.  *
  3.  * Copyright 2017 Paul Schaub
  4.  *
  5.  * Licensed under the Apache License, Version 2.0 (the "License");
  6.  * you may not use this file except in compliance with the License.
  7.  * You may obtain a copy of the License at
  8.  *
  9.  *     http://www.apache.org/licenses/LICENSE-2.0
  10.  *
  11.  * Unless required by applicable law or agreed to in writing, software
  12.  * distributed under the License is distributed on an "AS IS" BASIS,
  13.  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14.  * See the License for the specific language governing permissions and
  15.  * limitations under the License.
  16.  */
  17. package org.jivesoftware.smackx.omemo.util;

  18. /**
  19.  * Some constants related to OMEMO.
  20.  *
  21.  * @author Paul Schaub
  22.  */
  23. public final class OmemoConstants {

  24.     /**
  25.      * Omemo related namespace.
  26.      */
  27.     public static final String OMEMO_NAMESPACE_V_AXOLOTL = "eu.siacs.conversations.axolotl";
  28.     public static final String OMEMO = "OMEMO";

  29.     // PubSub Node names
  30.     public static final String PEP_NODE_DEVICE_LIST = OMEMO_NAMESPACE_V_AXOLOTL + ".devicelist";
  31.     public static final String PEP_NODE_BUNDLES = OMEMO_NAMESPACE_V_AXOLOTL + ".bundles";

  32.     /**
  33.      * How many preKeys do we want to publish?
  34.      */
  35.     public static final int PRE_KEY_COUNT_PER_BUNDLE = 100;

  36.     /**
  37.      * Return the node name of the PEP node containing the device bundle of the device with device id deviceId.
  38.      *
  39.      * @param deviceId id of the device
  40.      * @return node name of the devices bundle node
  41.      */
  42.     public static String PEP_NODE_BUNDLE_FROM_DEVICE_ID(int deviceId) {
  43.         return PEP_NODE_BUNDLES + ":" + deviceId;
  44.     }

  45.     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";

  46.     /**
  47.      * Information about the keys used for message encryption.
  48.      */
  49.     public static final class Crypto {
  50.         public static final String KEYTYPE = "AES";
  51.         public static final int KEYLENGTH = 128;
  52.         public static final String CIPHERMODE = "AES/GCM/NoPadding";
  53.     }
  54. }