Class SignalOmemoKeyUtil


  • public class SignalOmemoKeyUtil
    extends OmemoKeyUtil<org.whispersystems.libsignal.IdentityKeyPair,​org.whispersystems.libsignal.IdentityKey,​org.whispersystems.libsignal.state.PreKeyRecord,​org.whispersystems.libsignal.state.SignedPreKeyRecord,​org.whispersystems.libsignal.state.SessionRecord,​org.whispersystems.libsignal.ecc.ECPublicKey,​org.whispersystems.libsignal.state.PreKeyBundle>
    Concrete implementation of the KeyUtil for an implementation using the Signal library.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      org.whispersystems.libsignal.state.PreKeyBundle bundleFromOmemoBundle​(OmemoBundleElement bundle, OmemoDevice contact, int preKeyId)
      Build a crypto-lib specific PreKeyBundle (T_Bundle) using a PreKey from the OmemoBundleElement 'bundle'.
      org.whispersystems.libsignal.ecc.ECPublicKey ellipticCurvePublicKeyFromBytes​(byte[] data)
      Deserialize an elliptic curve public key from bytes.
      org.whispersystems.libsignal.IdentityKeyPair generateOmemoIdentityKeyPair()
      Generate a new IdentityKeyPair.
      java.util.TreeMap<java.lang.Integer,​org.whispersystems.libsignal.state.PreKeyRecord> generateOmemoPreKeys​(int currentPreKeyId, int count)
      Generate 'count' new PreKeys beginning with id 'startId'.
      org.whispersystems.libsignal.state.SignedPreKeyRecord generateOmemoSignedPreKey​(org.whispersystems.libsignal.IdentityKeyPair identityKeyPair, int currentPreKeyId)
      Generate a new signed preKey.
      OmemoFingerprint getFingerprintOfIdentityKey​(org.whispersystems.libsignal.IdentityKey identityKey)
      Return the fingerprint of an identityKey.
      OmemoFingerprint getFingerprintOfIdentityKeyPair​(org.whispersystems.libsignal.IdentityKeyPair identityKeyPair)
      Returns the fingerprint of the public key of an identityKeyPair.
      byte[] identityKeyForBundle​(org.whispersystems.libsignal.IdentityKey identityKey)
      Prepare an identityKey for transport in an OmemoBundleElement (serialize it).
      org.whispersystems.libsignal.IdentityKey identityKeyFromBytes​(byte[] data)
      Deserialize an identityKey from a byte array.
      org.whispersystems.libsignal.IdentityKey identityKeyFromPair​(org.whispersystems.libsignal.IdentityKeyPair identityKeyPair)
      Extract the public identityKey from an identityKeyPair.
      org.whispersystems.libsignal.IdentityKeyPair identityKeyPairFromBytes​(byte[] data)
      Deserialize an identityKeyPair from a byte array.
      byte[] identityKeyPairToBytes​(org.whispersystems.libsignal.IdentityKeyPair identityKeyPair)
      serialize an identityKeyPair into bytes.
      byte[] identityKeyToBytes​(org.whispersystems.libsignal.IdentityKey identityKey)
      Serialize an identityKey into bytes.
      byte[] preKeyForBundle​(org.whispersystems.libsignal.state.PreKeyRecord preKeyRecord)
      Prepare a preKey for transport in an OmemoBundleElement.
      org.whispersystems.libsignal.state.PreKeyRecord preKeyFromBytes​(byte[] bytes)
      Deserialize a preKey from a byte array.
      byte[] preKeyPublicKeyForBundle​(org.whispersystems.libsignal.ecc.ECPublicKey preKey)
      Prepare an elliptic curve preKey for transport in an OmemoBundleElement.
      byte[] preKeyToBytes​(org.whispersystems.libsignal.state.PreKeyRecord preKeyRecord)
      Serialize a preKey into a byte array.
      org.whispersystems.libsignal.state.SessionRecord rawSessionFromBytes​(byte[] data)
      Deserialize a raw OMEMO Session from bytes.
      byte[] rawSessionToBytes​(org.whispersystems.libsignal.state.SessionRecord session)
      Serialize a raw OMEMO session into a byte array.
      org.whispersystems.libsignal.state.SignedPreKeyRecord signedPreKeyFromBytes​(byte[] data)
      Deserialize a signedPreKey from a byte array.
      int signedPreKeyIdFromKey​(org.whispersystems.libsignal.state.SignedPreKeyRecord signedPreKey)
      return the id of the given signedPreKey.
      byte[] signedPreKeyPublicForBundle​(org.whispersystems.libsignal.state.SignedPreKeyRecord signedPreKey)
      Prepare a public signedPreKey for transport in a bundle.
      byte[] signedPreKeySignatureFromKey​(org.whispersystems.libsignal.state.SignedPreKeyRecord signedPreKey)
      Extract the signature from a signedPreKey.
      byte[] signedPreKeyToBytes​(org.whispersystems.libsignal.state.SignedPreKeyRecord signedPreKeyRecord)
      Serialize a signedPreKey into a byte array.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • generateOmemoIdentityKeyPair

        public org.whispersystems.libsignal.IdentityKeyPair generateOmemoIdentityKeyPair()
        Description copied from class: OmemoKeyUtil
        Generate a new IdentityKeyPair. We should always have only one pair and usually keep this for a long time.
        Specified by:
        generateOmemoIdentityKeyPair in class OmemoKeyUtil<org.whispersystems.libsignal.IdentityKeyPair,​org.whispersystems.libsignal.IdentityKey,​org.whispersystems.libsignal.state.PreKeyRecord,​org.whispersystems.libsignal.state.SignedPreKeyRecord,​org.whispersystems.libsignal.state.SessionRecord,​org.whispersystems.libsignal.ecc.ECPublicKey,​org.whispersystems.libsignal.state.PreKeyBundle>
        Returns:
        deserialized identity key pair
      • generateOmemoPreKeys

        public java.util.TreeMap<java.lang.Integer,​org.whispersystems.libsignal.state.PreKeyRecord> generateOmemoPreKeys​(int currentPreKeyId,
                                                                                                                               int count)
        Description copied from class: OmemoKeyUtil
        Generate 'count' new PreKeys beginning with id 'startId'. These preKeys are published and can be used by contacts to establish sessions with us.
        Specified by:
        generateOmemoPreKeys in class OmemoKeyUtil<org.whispersystems.libsignal.IdentityKeyPair,​org.whispersystems.libsignal.IdentityKey,​org.whispersystems.libsignal.state.PreKeyRecord,​org.whispersystems.libsignal.state.SignedPreKeyRecord,​org.whispersystems.libsignal.state.SessionRecord,​org.whispersystems.libsignal.ecc.ECPublicKey,​org.whispersystems.libsignal.state.PreKeyBundle>
        Parameters:
        currentPreKeyId - start id
        count - how many keys do we want to generate
        Returns:
        Map of new preKeys
      • generateOmemoSignedPreKey

        public org.whispersystems.libsignal.state.SignedPreKeyRecord generateOmemoSignedPreKey​(org.whispersystems.libsignal.IdentityKeyPair identityKeyPair,
                                                                                               int currentPreKeyId)
                                                                                        throws CorruptedOmemoKeyException
        Description copied from class: OmemoKeyUtil
        Generate a new signed preKey.
        Specified by:
        generateOmemoSignedPreKey in class OmemoKeyUtil<org.whispersystems.libsignal.IdentityKeyPair,​org.whispersystems.libsignal.IdentityKey,​org.whispersystems.libsignal.state.PreKeyRecord,​org.whispersystems.libsignal.state.SignedPreKeyRecord,​org.whispersystems.libsignal.state.SessionRecord,​org.whispersystems.libsignal.ecc.ECPublicKey,​org.whispersystems.libsignal.state.PreKeyBundle>
        Parameters:
        identityKeyPair - identityKeyPair used to sign the preKey
        currentPreKeyId - id that the preKey will have
        Returns:
        deserialized signed preKey
        Throws:
        CorruptedOmemoKeyException - when the identityKeyPair is invalid
      • signedPreKeyFromBytes

        public org.whispersystems.libsignal.state.SignedPreKeyRecord signedPreKeyFromBytes​(byte[] data)
                                                                                    throws java.io.IOException
        Description copied from class: OmemoKeyUtil
        Deserialize a signedPreKey from a byte array.
        Specified by:
        signedPreKeyFromBytes in class OmemoKeyUtil<org.whispersystems.libsignal.IdentityKeyPair,​org.whispersystems.libsignal.IdentityKey,​org.whispersystems.libsignal.state.PreKeyRecord,​org.whispersystems.libsignal.state.SignedPreKeyRecord,​org.whispersystems.libsignal.state.SessionRecord,​org.whispersystems.libsignal.ecc.ECPublicKey,​org.whispersystems.libsignal.state.PreKeyBundle>
        Parameters:
        data - byte array
        Returns:
        deserialized signed preKey
        Throws:
        java.io.IOException - when something goes wrong
      • signedPreKeyToBytes

        public byte[] signedPreKeyToBytes​(org.whispersystems.libsignal.state.SignedPreKeyRecord signedPreKeyRecord)
        Description copied from class: OmemoKeyUtil
        Serialize a signedPreKey into a byte array.
        Specified by:
        signedPreKeyToBytes in class OmemoKeyUtil<org.whispersystems.libsignal.IdentityKeyPair,​org.whispersystems.libsignal.IdentityKey,​org.whispersystems.libsignal.state.PreKeyRecord,​org.whispersystems.libsignal.state.SignedPreKeyRecord,​org.whispersystems.libsignal.state.SessionRecord,​org.whispersystems.libsignal.ecc.ECPublicKey,​org.whispersystems.libsignal.state.PreKeyBundle>
        Parameters:
        signedPreKeyRecord - signedPreKey
        Returns:
        byte array
      • rawSessionFromBytes

        public org.whispersystems.libsignal.state.SessionRecord rawSessionFromBytes​(byte[] data)
                                                                             throws java.io.IOException
        Description copied from class: OmemoKeyUtil
        Deserialize a raw OMEMO Session from bytes.
        Specified by:
        rawSessionFromBytes in class OmemoKeyUtil<org.whispersystems.libsignal.IdentityKeyPair,​org.whispersystems.libsignal.IdentityKey,​org.whispersystems.libsignal.state.PreKeyRecord,​org.whispersystems.libsignal.state.SignedPreKeyRecord,​org.whispersystems.libsignal.state.SessionRecord,​org.whispersystems.libsignal.ecc.ECPublicKey,​org.whispersystems.libsignal.state.PreKeyBundle>
        Parameters:
        data - bytes
        Returns:
        raw OMEMO Session
        Throws:
        java.io.IOException - when something goes wrong
      • rawSessionToBytes

        public byte[] rawSessionToBytes​(org.whispersystems.libsignal.state.SessionRecord session)
        Description copied from class: OmemoKeyUtil
        Serialize a raw OMEMO session into a byte array.
        Specified by:
        rawSessionToBytes in class OmemoKeyUtil<org.whispersystems.libsignal.IdentityKeyPair,​org.whispersystems.libsignal.IdentityKey,​org.whispersystems.libsignal.state.PreKeyRecord,​org.whispersystems.libsignal.state.SignedPreKeyRecord,​org.whispersystems.libsignal.state.SessionRecord,​org.whispersystems.libsignal.ecc.ECPublicKey,​org.whispersystems.libsignal.state.PreKeyBundle>
        Parameters:
        session - raw session
        Returns:
        byte array
      • identityKeyPairFromBytes

        public org.whispersystems.libsignal.IdentityKeyPair identityKeyPairFromBytes​(byte[] data)
                                                                              throws CorruptedOmemoKeyException
        Description copied from class: OmemoKeyUtil
        Deserialize an identityKeyPair from a byte array.
        Specified by:
        identityKeyPairFromBytes in class OmemoKeyUtil<org.whispersystems.libsignal.IdentityKeyPair,​org.whispersystems.libsignal.IdentityKey,​org.whispersystems.libsignal.state.PreKeyRecord,​org.whispersystems.libsignal.state.SignedPreKeyRecord,​org.whispersystems.libsignal.state.SessionRecord,​org.whispersystems.libsignal.ecc.ECPublicKey,​org.whispersystems.libsignal.state.PreKeyBundle>
        Parameters:
        data - byte array
        Returns:
        IdentityKeyPair (T_IdKeyPair)
        Throws:
        CorruptedOmemoKeyException - if the key is damaged of malformed
      • identityKeyFromBytes

        public org.whispersystems.libsignal.IdentityKey identityKeyFromBytes​(byte[] data)
                                                                      throws CorruptedOmemoKeyException
        Description copied from class: OmemoKeyUtil
        Deserialize an identityKey from a byte array.
        Specified by:
        identityKeyFromBytes in class OmemoKeyUtil<org.whispersystems.libsignal.IdentityKeyPair,​org.whispersystems.libsignal.IdentityKey,​org.whispersystems.libsignal.state.PreKeyRecord,​org.whispersystems.libsignal.state.SignedPreKeyRecord,​org.whispersystems.libsignal.state.SessionRecord,​org.whispersystems.libsignal.ecc.ECPublicKey,​org.whispersystems.libsignal.state.PreKeyBundle>
        Parameters:
        data - byte array
        Returns:
        identityKey (T_IdKey)
        Throws:
        CorruptedOmemoKeyException - if the key is damaged or malformed
      • ellipticCurvePublicKeyFromBytes

        public org.whispersystems.libsignal.ecc.ECPublicKey ellipticCurvePublicKeyFromBytes​(byte[] data)
                                                                                     throws CorruptedOmemoKeyException
        Description copied from class: OmemoKeyUtil
        Deserialize an elliptic curve public key from bytes.
        Specified by:
        ellipticCurvePublicKeyFromBytes in class OmemoKeyUtil<org.whispersystems.libsignal.IdentityKeyPair,​org.whispersystems.libsignal.IdentityKey,​org.whispersystems.libsignal.state.PreKeyRecord,​org.whispersystems.libsignal.state.SignedPreKeyRecord,​org.whispersystems.libsignal.state.SessionRecord,​org.whispersystems.libsignal.ecc.ECPublicKey,​org.whispersystems.libsignal.state.PreKeyBundle>
        Parameters:
        data - bytes
        Returns:
        elliptic curve public key (T_ECPub)
        Throws:
        CorruptedOmemoKeyException - if the key is damaged or malformed
      • preKeyToBytes

        public byte[] preKeyToBytes​(org.whispersystems.libsignal.state.PreKeyRecord preKeyRecord)
        Description copied from class: OmemoKeyUtil
        Serialize a preKey into a byte array.
        Specified by:
        preKeyToBytes in class OmemoKeyUtil<org.whispersystems.libsignal.IdentityKeyPair,​org.whispersystems.libsignal.IdentityKey,​org.whispersystems.libsignal.state.PreKeyRecord,​org.whispersystems.libsignal.state.SignedPreKeyRecord,​org.whispersystems.libsignal.state.SessionRecord,​org.whispersystems.libsignal.ecc.ECPublicKey,​org.whispersystems.libsignal.state.PreKeyBundle>
        Parameters:
        preKeyRecord - preKey
        Returns:
        byte[]
      • preKeyFromBytes

        public org.whispersystems.libsignal.state.PreKeyRecord preKeyFromBytes​(byte[] bytes)
                                                                        throws java.io.IOException
        Description copied from class: OmemoKeyUtil
        Deserialize a preKey from a byte array.
        Specified by:
        preKeyFromBytes in class OmemoKeyUtil<org.whispersystems.libsignal.IdentityKeyPair,​org.whispersystems.libsignal.IdentityKey,​org.whispersystems.libsignal.state.PreKeyRecord,​org.whispersystems.libsignal.state.SignedPreKeyRecord,​org.whispersystems.libsignal.state.SessionRecord,​org.whispersystems.libsignal.ecc.ECPublicKey,​org.whispersystems.libsignal.state.PreKeyBundle>
        Parameters:
        bytes - byte array
        Returns:
        deserialized preKey
        Throws:
        java.io.IOException - when something goes wrong
      • bundleFromOmemoBundle

        public org.whispersystems.libsignal.state.PreKeyBundle bundleFromOmemoBundle​(OmemoBundleElement bundle,
                                                                                     OmemoDevice contact,
                                                                                     int preKeyId)
                                                                              throws CorruptedOmemoKeyException
        Description copied from class: OmemoKeyUtil
        Build a crypto-lib specific PreKeyBundle (T_Bundle) using a PreKey from the OmemoBundleElement 'bundle'. The PreKeyBundle will contain the identityKey, signedPreKey and signature, as well as a preKey from the OmemoBundleElement.
        Specified by:
        bundleFromOmemoBundle in class OmemoKeyUtil<org.whispersystems.libsignal.IdentityKeyPair,​org.whispersystems.libsignal.IdentityKey,​org.whispersystems.libsignal.state.PreKeyRecord,​org.whispersystems.libsignal.state.SignedPreKeyRecord,​org.whispersystems.libsignal.state.SessionRecord,​org.whispersystems.libsignal.ecc.ECPublicKey,​org.whispersystems.libsignal.state.PreKeyBundle>
        Parameters:
        bundle - OmemoBundleElement
        contact - Contact that the bundle belongs to
        preKeyId - id of the preKey that will be selected from the OmemoBundleElement and that the PreKeyBundle will contain
        Returns:
        PreKeyBundle (T_PreKey)
        Throws:
        CorruptedOmemoKeyException - if some key is damaged or malformed
      • signedPreKeySignatureFromKey

        public byte[] signedPreKeySignatureFromKey​(org.whispersystems.libsignal.state.SignedPreKeyRecord signedPreKey)
        Description copied from class: OmemoKeyUtil
        Extract the signature from a signedPreKey.
        Specified by:
        signedPreKeySignatureFromKey in class OmemoKeyUtil<org.whispersystems.libsignal.IdentityKeyPair,​org.whispersystems.libsignal.IdentityKey,​org.whispersystems.libsignal.state.PreKeyRecord,​org.whispersystems.libsignal.state.SignedPreKeyRecord,​org.whispersystems.libsignal.state.SessionRecord,​org.whispersystems.libsignal.ecc.ECPublicKey,​org.whispersystems.libsignal.state.PreKeyBundle>
        Parameters:
        signedPreKey - signedPreKey
        Returns:
        signature as byte array
      • signedPreKeyIdFromKey

        public int signedPreKeyIdFromKey​(org.whispersystems.libsignal.state.SignedPreKeyRecord signedPreKey)
        Description copied from class: OmemoKeyUtil
        return the id of the given signedPreKey.
        Specified by:
        signedPreKeyIdFromKey in class OmemoKeyUtil<org.whispersystems.libsignal.IdentityKeyPair,​org.whispersystems.libsignal.IdentityKey,​org.whispersystems.libsignal.state.PreKeyRecord,​org.whispersystems.libsignal.state.SignedPreKeyRecord,​org.whispersystems.libsignal.state.SessionRecord,​org.whispersystems.libsignal.ecc.ECPublicKey,​org.whispersystems.libsignal.state.PreKeyBundle>
        Parameters:
        signedPreKey - key
        Returns:
        id of the key
      • identityKeyPairToBytes

        public byte[] identityKeyPairToBytes​(org.whispersystems.libsignal.IdentityKeyPair identityKeyPair)
        Description copied from class: OmemoKeyUtil
        serialize an identityKeyPair into bytes.
        Specified by:
        identityKeyPairToBytes in class OmemoKeyUtil<org.whispersystems.libsignal.IdentityKeyPair,​org.whispersystems.libsignal.IdentityKey,​org.whispersystems.libsignal.state.PreKeyRecord,​org.whispersystems.libsignal.state.SignedPreKeyRecord,​org.whispersystems.libsignal.state.SessionRecord,​org.whispersystems.libsignal.ecc.ECPublicKey,​org.whispersystems.libsignal.state.PreKeyBundle>
        Parameters:
        identityKeyPair - identityKeyPair
        Returns:
        byte array
      • identityKeyFromPair

        public org.whispersystems.libsignal.IdentityKey identityKeyFromPair​(org.whispersystems.libsignal.IdentityKeyPair identityKeyPair)
        Description copied from class: OmemoKeyUtil
        Extract the public identityKey from an identityKeyPair.
        Specified by:
        identityKeyFromPair in class OmemoKeyUtil<org.whispersystems.libsignal.IdentityKeyPair,​org.whispersystems.libsignal.IdentityKey,​org.whispersystems.libsignal.state.PreKeyRecord,​org.whispersystems.libsignal.state.SignedPreKeyRecord,​org.whispersystems.libsignal.state.SessionRecord,​org.whispersystems.libsignal.ecc.ECPublicKey,​org.whispersystems.libsignal.state.PreKeyBundle>
        Parameters:
        identityKeyPair - keyPair
        Returns:
        public key of the pair
      • identityKeyForBundle

        public byte[] identityKeyForBundle​(org.whispersystems.libsignal.IdentityKey identityKey)
        Description copied from class: OmemoKeyUtil
        Prepare an identityKey for transport in an OmemoBundleElement (serialize it).
        Specified by:
        identityKeyForBundle in class OmemoKeyUtil<org.whispersystems.libsignal.IdentityKeyPair,​org.whispersystems.libsignal.IdentityKey,​org.whispersystems.libsignal.state.PreKeyRecord,​org.whispersystems.libsignal.state.SignedPreKeyRecord,​org.whispersystems.libsignal.state.SessionRecord,​org.whispersystems.libsignal.ecc.ECPublicKey,​org.whispersystems.libsignal.state.PreKeyBundle>
        Parameters:
        identityKey - identityKey that will be transported
        Returns:
        key as byte array
      • identityKeyToBytes

        public byte[] identityKeyToBytes​(org.whispersystems.libsignal.IdentityKey identityKey)
        Description copied from class: OmemoKeyUtil
        Serialize an identityKey into bytes.
        Specified by:
        identityKeyToBytes in class OmemoKeyUtil<org.whispersystems.libsignal.IdentityKeyPair,​org.whispersystems.libsignal.IdentityKey,​org.whispersystems.libsignal.state.PreKeyRecord,​org.whispersystems.libsignal.state.SignedPreKeyRecord,​org.whispersystems.libsignal.state.SessionRecord,​org.whispersystems.libsignal.ecc.ECPublicKey,​org.whispersystems.libsignal.state.PreKeyBundle>
        Parameters:
        identityKey - idKey
        Returns:
        byte array representation of the identity key.
      • preKeyPublicKeyForBundle

        public byte[] preKeyPublicKeyForBundle​(org.whispersystems.libsignal.ecc.ECPublicKey preKey)
        Description copied from class: OmemoKeyUtil
        Prepare an elliptic curve preKey for transport in an OmemoBundleElement.
        Specified by:
        preKeyPublicKeyForBundle in class OmemoKeyUtil<org.whispersystems.libsignal.IdentityKeyPair,​org.whispersystems.libsignal.IdentityKey,​org.whispersystems.libsignal.state.PreKeyRecord,​org.whispersystems.libsignal.state.SignedPreKeyRecord,​org.whispersystems.libsignal.state.SessionRecord,​org.whispersystems.libsignal.ecc.ECPublicKey,​org.whispersystems.libsignal.state.PreKeyBundle>
        Parameters:
        preKey - key
        Returns:
        key as byte array
      • preKeyForBundle

        public byte[] preKeyForBundle​(org.whispersystems.libsignal.state.PreKeyRecord preKeyRecord)
        Description copied from class: OmemoKeyUtil
        Prepare a preKey for transport in an OmemoBundleElement.
        Specified by:
        preKeyForBundle in class OmemoKeyUtil<org.whispersystems.libsignal.IdentityKeyPair,​org.whispersystems.libsignal.IdentityKey,​org.whispersystems.libsignal.state.PreKeyRecord,​org.whispersystems.libsignal.state.SignedPreKeyRecord,​org.whispersystems.libsignal.state.SessionRecord,​org.whispersystems.libsignal.ecc.ECPublicKey,​org.whispersystems.libsignal.state.PreKeyBundle>
        Parameters:
        preKeyRecord - preKey
        Returns:
        key as byte array
      • signedPreKeyPublicForBundle

        public byte[] signedPreKeyPublicForBundle​(org.whispersystems.libsignal.state.SignedPreKeyRecord signedPreKey)
        Description copied from class: OmemoKeyUtil
        Prepare a public signedPreKey for transport in a bundle.
        Specified by:
        signedPreKeyPublicForBundle in class OmemoKeyUtil<org.whispersystems.libsignal.IdentityKeyPair,​org.whispersystems.libsignal.IdentityKey,​org.whispersystems.libsignal.state.PreKeyRecord,​org.whispersystems.libsignal.state.SignedPreKeyRecord,​org.whispersystems.libsignal.state.SessionRecord,​org.whispersystems.libsignal.ecc.ECPublicKey,​org.whispersystems.libsignal.state.PreKeyBundle>
        Parameters:
        signedPreKey - signedPreKey
        Returns:
        signedPreKey as byte array
      • getFingerprintOfIdentityKey

        public OmemoFingerprint getFingerprintOfIdentityKey​(org.whispersystems.libsignal.IdentityKey identityKey)
        Description copied from class: OmemoKeyUtil
        Return the fingerprint of an identityKey.
        Specified by:
        getFingerprintOfIdentityKey in class OmemoKeyUtil<org.whispersystems.libsignal.IdentityKeyPair,​org.whispersystems.libsignal.IdentityKey,​org.whispersystems.libsignal.state.PreKeyRecord,​org.whispersystems.libsignal.state.SignedPreKeyRecord,​org.whispersystems.libsignal.state.SessionRecord,​org.whispersystems.libsignal.ecc.ECPublicKey,​org.whispersystems.libsignal.state.PreKeyBundle>
        Parameters:
        identityKey - identityKey
        Returns:
        fingerprint of the key
      • getFingerprintOfIdentityKeyPair

        public OmemoFingerprint getFingerprintOfIdentityKeyPair​(org.whispersystems.libsignal.IdentityKeyPair identityKeyPair)
        Description copied from class: OmemoKeyUtil
        Returns the fingerprint of the public key of an identityKeyPair.
        Specified by:
        getFingerprintOfIdentityKeyPair in class OmemoKeyUtil<org.whispersystems.libsignal.IdentityKeyPair,​org.whispersystems.libsignal.IdentityKey,​org.whispersystems.libsignal.state.PreKeyRecord,​org.whispersystems.libsignal.state.SignedPreKeyRecord,​org.whispersystems.libsignal.state.SessionRecord,​org.whispersystems.libsignal.ecc.ECPublicKey,​org.whispersystems.libsignal.state.PreKeyBundle>
        Parameters:
        identityKeyPair - IdentityKeyPair.
        Returns:
        fingerprint of the public key.