Package org.signal.libsignal.protocol
Class SessionBuilder
- java.lang.Object
-
- org.signal.libsignal.protocol.SessionBuilder
-
public class SessionBuilder extends java.lang.ObjectSessionBuilder is responsible for setting up encrypted sessions. Once a session has been established,SessionCiphercan be used to encrypt/decrypt messages in that session.Sessions are built from one of three different possible vectors:
- A
PreKeyBundleretrieved from a server. - A
PreKeySignalMessagereceived from a client.
- A
-
-
Constructor Summary
Constructors Constructor Description SessionBuilder(SessionStore sessionStore, PreKeyStore preKeyStore, SignedPreKeyStore signedPreKeyStore, IdentityKeyStore identityKeyStore, SignalProtocolAddress remoteAddress)Constructs a SessionBuilder.SessionBuilder(SignalProtocolStore store, SignalProtocolAddress remoteAddress)Constructs a SessionBuilder
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidprocess(PreKeyBundle preKey)Build a new session from aPreKeyBundleretrieved from a server.
-
-
-
Constructor Detail
-
SessionBuilder
public SessionBuilder(SessionStore sessionStore, PreKeyStore preKeyStore, SignedPreKeyStore signedPreKeyStore, IdentityKeyStore identityKeyStore, SignalProtocolAddress remoteAddress)
Constructs a SessionBuilder.- Parameters:
sessionStore- TheSessionStoreto store the constructed session in.preKeyStore- ThePreKeyStorewhere the client's localPreKeyRecords are stored.identityKeyStore- TheIdentityKeyStorecontaining the client's identity key information.remoteAddress- The address of the remote user to build a session with.
-
SessionBuilder
public SessionBuilder(SignalProtocolStore store, SignalProtocolAddress remoteAddress)
Constructs a SessionBuilder- Parameters:
store- TheSignalProtocolStoreto store all state information in.remoteAddress- The address of the remote user to build a session with.
-
-
Method Detail
-
process
public void process(PreKeyBundle preKey) throws InvalidKeyException, UntrustedIdentityException
Build a new session from aPreKeyBundleretrieved from a server.- Parameters:
preKey- A PreKey for the destination recipient, retrieved from a server.- Throws:
InvalidKeyException- when thePreKeyBundleis badly formatted.UntrustedIdentityException- when the sender'sIdentityKeyis not trusted.
-
-