RNS::Destination
Inherits RNS::Destination::DestinationInterface < Reference < Object
A named endpoint for sending or receiving packets, identified by a hash derived from the application name, aspects, and an optional identity.
Constants
─── Request policy constants ─────────────────────────────────────
─── Direction constants ──────────────────────────────────────────
─── Ratchet constants ────────────────────────────────────────────
─── Proof strategy constants ─────────────────────────────────────
─── Type constants ───────────────────────────────────────────────
Constructors
Creates a new destination.
- identity: the
Identitythat owns this destination (nil for PLAIN type) - direction:
IN(receive) orOUT(send) - type:
SINGLE,GROUP,PLAIN, orLINK - app_name: application name (no dots allowed)
- aspects: additional name components appended after app_name
- register: whether to register with
Transportimmediately
Class methods
Instance methods
Sends an announce packet for this destination, advertising its public key and optional app_data to the network. Only valid for SINGLE/IN destinations.
Decrypts ciphertext using this destination's identity or group key. Returns nil if decryption fails. PLAIN destinations return data unmodified.
Encrypts plaintext using this destination's identity or group key. PLAIN destinations return data unmodified.
Registers a request handler for the given path. The response_generator proc is called when a matching request arrives; allow controls the access policy.
Sets the callback invoked when a new Link is established to this destination.
Sets the callback invoked when a data packet is received at this destination.
Sets the callback invoked to decide whether a proof should be sent for a packet.
Used when proof_strategy is PROVE_APP.
Configures the proof strategy: PROVE_NONE, PROVE_ALL, or PROVE_APP.
Signs message using the identity's private key. Only works for SINGLE destinations.
Appends a short String representation of this object which includes its class name and its object address.
class Person
def initialize(@name : String, @age : Int32)
end
end
Person.new("John", 32).to_s # => #<Person:0x10a199f20>