Class OmemoBundleElement

    • Constructor Summary

      Constructors 
      Constructor Description
      OmemoBundleElement​(int signedPreKeyId, byte[] signedPreKey, byte[] signedPreKeySig, byte[] identityKey, java.util.HashMap<java.lang.Integer,​byte[]> preKeys)
      Constructor to create a Bundle Element from decoded byte arrays.
      OmemoBundleElement​(int signedPreKeyId, java.lang.String signedPreKeyB64, java.lang.String signedPreKeySigB64, java.lang.String identityKeyB64, java.util.HashMap<java.lang.Integer,​java.lang.String> preKeysB64)
      Constructor to create a Bundle Element from base64 Strings.
    • Constructor Detail

      • OmemoBundleElement

        public OmemoBundleElement​(int signedPreKeyId,
                                  java.lang.String signedPreKeyB64,
                                  java.lang.String signedPreKeySigB64,
                                  java.lang.String identityKeyB64,
                                  java.util.HashMap<java.lang.Integer,​java.lang.String> preKeysB64)
        Constructor to create a Bundle Element from base64 Strings.
        Parameters:
        signedPreKeyId - id
        signedPreKeyB64 - base64 encoded signedPreKey
        signedPreKeySigB64 - base64 encoded signedPreKeySignature
        identityKeyB64 - base64 encoded identityKey
        preKeysB64 - HashMap of base64 encoded preKeys
      • OmemoBundleElement

        public OmemoBundleElement​(int signedPreKeyId,
                                  byte[] signedPreKey,
                                  byte[] signedPreKeySig,
                                  byte[] identityKey,
                                  java.util.HashMap<java.lang.Integer,​byte[]> preKeys)
        Constructor to create a Bundle Element from decoded byte arrays.
        Parameters:
        signedPreKeyId - id
        signedPreKey - signedPreKey
        signedPreKeySig - signedPreKeySignature
        identityKey - identityKey
        preKeys - HashMap of preKeys
    • Method Detail

      • getSignedPreKey

        public byte[] getSignedPreKey()
        Return the signedPreKey of the OmemoBundleElement.
        Returns:
        signedPreKey as byte array
      • getSignedPreKeyId

        public int getSignedPreKeyId()
        Return the id of the signedPreKey in the bundle.
        Returns:
        id of signedPreKey
      • getSignedPreKeySignature

        public byte[] getSignedPreKeySignature()
        Get the signature of the signedPreKey.
        Returns:
        signature as byte array
      • getIdentityKey

        public byte[] getIdentityKey()
        Return the public identityKey of the bundles owner. This can be used to check the signedPreKeys signature. The fingerprint of this key is, what the user has to verify.
        Returns:
        public identityKey as byte array
      • getPreKeys

        public java.util.HashMap<java.lang.Integer,​byte[]> getPreKeys()
        Return the HashMap of preKeys in the bundle. The map uses the preKeys ids as key and the preKeys as value.
        Returns:
        preKeys Pre-Keys contained in the bundle
      • getPreKey

        public byte[] getPreKey​(int id)
        Return a single preKey from the map.
        Parameters:
        id - id of the preKey
        Returns:
        the preKey
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object other)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object