Class OutboundCreationResult

java.lang.Object
io.github.fherbreteau.vodozemac.ecies.OutboundCreationResult
All Implemented Interfaces:
AutoCloseable

public final class OutboundCreationResult extends Object implements AutoCloseable
The result of an outbound ECIES channel establishment.

This is returned by Ecies.establishOutboundChannel(String, byte[]) and contains both the established channel and the initial message to send to the recipient.

Author:
François HERBRETEAU
See Also:
  • Method Details

    • establishedEcies

      public EstablishedEcies establishedEcies()
      Returns the established ECIES channel.

      The returned EstablishedEcies can be used to encrypt and decrypt further messages after the channel has been established.

      Returns:
      the established ECIES channel
    • initialMessage

      public String initialMessage()
      Returns the initial message to send to the recipient.

      The message contains the initiator's ephemeral Curve25519 public key and the ciphertext of the initial plaintext, encoded as a string. The recipient uses this message to establish their side of the channel via Ecies.establishInboundChannel(String).

      The initiator's key embedded in this message is unauthenticated, so authentication must happen out-of-band using the CheckCode to protect against active man-in-the-middle (MITM) attacks.

      Returns:
      the initial message string
    • close

      public void close()
      Closes this resource by releasing its associated native resources.

      This method is idempotent: calling it more than once has no effect.

      Specified by:
      close in interface AutoCloseable
    • 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