private Promise < PrivateKey > fetchPreKey ( byte [ ] publicKey ) { try { return Promise . success ( ManagedList . of ( ownKeys . getPreKeys ( ) ) . filter ( PrivateKey . PRE_KEY_EQUALS ( publicKey ) ) . first ( ) ) ; } catch ( Exception e ) { Log . d ( TAG , "Unable to find own pre key " + Crypto . keyHash ( publicKey ) ) ; for ( PrivateKey p : ownKeys . getPreKeys ( ) ) { Log . d ( TAG , "Have: " + Crypto . keyHash ( p . getPublicKey ( ) ) ) ; } throw e ; } }
Fetching own private pre key by public key