Skip to content

DiscoNet.Net

Fasjeit edited this page Aug 17, 2018 · 2 revisions

Api

Main Disco Api

public static class DiscoNet.Net.Api

Static Methods

Type Name Summary
Connection Connect(String address, Int32 port, Config config) Establish connection to Disco server and perform handshake
PublicKeyVerifierDeligate CreatePublicKeyVerifier(Byte[] rootPublicKey) Create callback function for public key verification
Byte[] CreateStaticPublicKeyProof(Byte[] sodiumPrivateKey, Byte[] publicKey) Create static proof for disco peer
KeyPair GenerateAndSaveDiscoKeyPair(String fileName) Generate a disco key pair (X25519 key pair) and save it to a file in hexadecimal form.
void GenerateAndSaveDiscoRootKeyPair(String discoRootPrivateKeyFile, String discoRootPublicKeyFile) Generate an ed25519 root key pair and save the private and public parts in different files.
HandshakeState InitializeDisco(NoiseHandshakeType handshakeType, Boolean initiator, Byte[] prologue, KeyPair s, KeyPair e, KeyPair rs, KeyPair re) Disco peer initialization
Listener Listen(IPAddress address, Config config, Int32 port = 1800) Listen for Disco client connections
Listener Listen(String address, Config config, Int32 port = 1800) Listen for Disco client connections
KeyPair LoadDiscoKeyPair(String fileName) Load Dico keypair from file
Byte[] LoadDiscoRootPrivateKey(String discoRootPrivaeKeyFile) Load private root key from file
Byte[] LoadDiscoRootPublicKey(String discoRootPublicKeyFile) Load public root key from file

Connection

Represents a secured connection

public class DiscoNet.Net.Connection
    : IDisposable

Methods

Type Name Summary
void Dispose() Dispose connection
Int32 Read(Byte[] data, Int32 offset, Int32 count) Read data from connection
Int32 Write(Byte[] data, Int32 offset, Int32 count) Write data to connection

Listener

Disco Listener

public class DiscoNet.Net.Listener
    : IDisposable

Methods

Type Name Summary
Connection Accept() Accept disco connection
void Dispose() Dispose connection
void Start() Start listening for clients
void Stop() Stop listening for clients
Clone this wiki locally