Class OmemoBundleElement
java.lang.Object
org.jivesoftware.smackx.omemo.element.OmemoBundleElement
- All Implemented Interfaces:
Element
,ExtensionElement
,NamedElement
,XmlElement
,XmlLangElement
- Direct Known Subclasses:
OmemoBundleElement_VAxolotl
Class that represents an OMEMO Bundle element.
-
Field Summary
-
Constructor Summary
ConstructorDescriptionOmemoBundleElement
(int signedPreKeyId, byte[] signedPreKey, byte[] signedPreKeySig, byte[] identityKey, Map<Integer, byte[]> preKeys) Constructor to create a Bundle Element from decoded byte arrays.OmemoBundleElement
(int signedPreKeyId, String signedPreKeyB64, String signedPreKeySigB64, String identityKeyB64, Map<Integer, String> preKeysB64) Constructor to create a Bundle Element from base64 Strings. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Returns the root element name.byte[]
Return the public identityKey of the bundles owner.byte[]
getPreKey
(int id) Return a single preKey from the map.Return the Map of preKeys in the bundle.byte[]
Return the signedPreKey of the OmemoBundleElement.int
Return the id of the signedPreKey in the bundle.byte[]
Get the signature of the signedPreKey.int
hashCode()
toString()
toXML
(XmlEnvironment enclosingNamespace) Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.jivesoftware.smack.packet.XmlElement
getLanguage, getNamespace, getQName
-
Field Details
-
BUNDLE
- See Also:
-
SIGNED_PRE_KEY_PUB
- See Also:
-
SIGNED_PRE_KEY_ID
- See Also:
-
SIGNED_PRE_KEY_SIG
- See Also:
-
IDENTITY_KEY
- See Also:
-
PRE_KEYS
- See Also:
-
PRE_KEY_PUB
- See Also:
-
PRE_KEY_ID
- See Also:
-
-
Constructor Details
-
OmemoBundleElement
public OmemoBundleElement(int signedPreKeyId, String signedPreKeyB64, String signedPreKeySigB64, String identityKeyB64, Map<Integer, String> preKeysB64) Constructor to create a Bundle Element from base64 Strings.- Parameters:
signedPreKeyId
- idsignedPreKeyB64
- base64 encoded signedPreKeysignedPreKeySigB64
- base64 encoded signedPreKeySignatureidentityKeyB64
- base64 encoded identityKeypreKeysB64
- Map of base64 encoded preKeys
-
OmemoBundleElement
public OmemoBundleElement(int signedPreKeyId, byte[] signedPreKey, byte[] signedPreKeySig, byte[] identityKey, Map<Integer, byte[]> preKeys) Constructor to create a Bundle Element from decoded byte arrays.- Parameters:
signedPreKeyId
- idsignedPreKey
- signedPreKeysignedPreKeySig
- signedPreKeySignatureidentityKey
- identityKeypreKeys
- Map of preKeys
-
-
Method Details
-
getSignedPreKey
Return the signedPreKey of the OmemoBundleElement.- Returns:
- signedPreKey as byte array
-
getSignedPreKeyId
Return the id of the signedPreKey in the bundle.- Returns:
- id of signedPreKey
-
getSignedPreKeySignature
Get the signature of the signedPreKey.- Returns:
- signature as byte array
-
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
Return the Map 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
Return a single preKey from the map.- Parameters:
id
- id of the preKey- Returns:
- the preKey
-
getElementName
Description copied from interface:NamedElement
Returns the root element name.- Specified by:
getElementName
in interfaceNamedElement
- Returns:
- the element name.
-
toXML
-
toString
-
equals
-
hashCode
-