Class OmemoKeyUtil.Bundle
- java.lang.Object
-
- org.jivesoftware.smackx.omemo.util.OmemoKeyUtil.Bundle
-
- Enclosing class:
- OmemoKeyUtil<T_IdKeyPair,T_IdKey,T_PreKey,T_SigPreKey,T_Sess,T_ECPub,T_Bundle>
public class OmemoKeyUtil.Bundle extends java.lang.Object
Bundle related methods.
-
-
Constructor Summary
Constructors Constructor Description Bundle()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.HashMap<java.lang.Integer,T_Bundle>
bundles(OmemoBundleElement bundle, OmemoDevice contact)
Break up the OmemoBundleElement into a list of crypto-lib specific bundles (T_PreKey).T_IdKey
identityKey(OmemoBundleElement bundle)
Extract an IdentityKey from a OmemoBundleElement.T_ECPub
preKeyPublic(OmemoBundleElement bundle, int keyId)
Extract the preKey with id 'keyId' from the bundle.int
signedPreKeyId(OmemoBundleElement bundle)
Extract the id of the transported signedPreKey from the bundle.T_ECPub
signedPreKeyPublic(OmemoBundleElement bundle)
Extract a signedPreKey from an OmemoBundleElement.byte[]
signedPreKeySignature(OmemoBundleElement bundle)
Extract the signature of the signedPreKey in the bundle as a byte array.
-
-
-
Constructor Detail
-
Bundle
public Bundle()
-
-
Method Detail
-
identityKey
public T_IdKey identityKey(OmemoBundleElement bundle) throws CorruptedOmemoKeyException
Extract an IdentityKey from a OmemoBundleElement.- Parameters:
bundle
- OmemoBundleElement- Returns:
- identityKey of the bundle
- Throws:
CorruptedOmemoKeyException
- if the key is damaged/malformed
-
signedPreKeyPublic
public T_ECPub signedPreKeyPublic(OmemoBundleElement bundle) throws CorruptedOmemoKeyException
Extract a signedPreKey from an OmemoBundleElement.- Parameters:
bundle
- OmemoBundleElement- Returns:
- signed preKey
- Throws:
CorruptedOmemoKeyException
- if the key is damaged/malformed
-
signedPreKeyId
public int signedPreKeyId(OmemoBundleElement bundle)
Extract the id of the transported signedPreKey from the bundle.- Parameters:
bundle
- OmemoBundleElement- Returns:
- id of the signed preKey
-
signedPreKeySignature
public byte[] signedPreKeySignature(OmemoBundleElement bundle)
Extract the signature of the signedPreKey in the bundle as a byte array.- Parameters:
bundle
- OmemoBundleElement- Returns:
- signature on the signed preKey
-
preKeyPublic
public T_ECPub preKeyPublic(OmemoBundleElement bundle, int keyId) throws CorruptedOmemoKeyException
Extract the preKey with id 'keyId' from the bundle.- Parameters:
bundle
- OmemoBundleElementkeyId
- id of the preKey- Returns:
- the preKey
- Throws:
CorruptedOmemoKeyException
- when the key cannot be parsed from bytes
-
bundles
public java.util.HashMap<java.lang.Integer,T_Bundle> bundles(OmemoBundleElement bundle, OmemoDevice contact) throws CorruptedOmemoKeyException
Break up the OmemoBundleElement into a list of crypto-lib specific bundles (T_PreKey). In case of the signal library, we break the OmemoBundleElement in ~100 PreKeyBundles (one for every transported preKey).- Parameters:
bundle
- OmemoBundleElement containing multiple PreKeyscontact
- Contact that the bundle belongs to- Returns:
- a HashMap with one T_Bundle per preKey and the preKeyId as key
- Throws:
CorruptedOmemoKeyException
- when one of the keys cannot be parsed
-
-