Class SessionKeys

java.lang.Object
io.github.fherbreteau.vodozemac.olm.SessionKeys

public final class SessionKeys extends Object
The set of Curve25519 public keys that were used to establish an Olm session.

A SessionKeys value is obtained from OlmSession.sessionKeys() and contains three public keys:

  • the long-term Curve25519 identity key of the session initiator,
  • the ephemeral Curve25519 base key created by the initiator to establish the session, and
  • the Curve25519 one-time key that the initiator downloaded from a key server and which was previously published by the recipient.
The session ID is derived as the SHA-256 hash of the concatenation of these three keys, making it (probabilistically) globally unique.
Author:
François HERBRETEAU
See Also:
  • Method Details

    • sessionId

      public String sessionId()
      Returns the globally unique session ID, base64-encoded.

      The session ID is the SHA-256 hash of the concatenation of the identity key, the base key and the one-time key.

      Returns:
      the session ID as a base64 string
    • identityKey

      public Curve25519PublicKey identityKey()
      Returns the long-term Curve25519 public key of the session initiator.
      Returns:
      the identity key as a base64 string
    • baseKey

      public Curve25519PublicKey baseKey()
      Returns the ephemeral Curve25519 public key created by the session initiator to establish the session.
      Returns:
      the base key as a base64 string
    • oneTimeKey

      public Curve25519PublicKey oneTimeKey()
      Returns the one-time Curve25519 public key that the initiator downloaded from a key server, which was previously created and published by the recipient.
      Returns:
      the one-time key as a base64 string
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object