Documentation
¶
Index ¶
- type ClientConfig
- type Conn
- func (c *Conn) Close() error
- func (c *Conn) Handshake() error
- func (c *Conn) LocalAddr() net.Addr
- func (c *Conn) Read(b []byte) (int, error)
- func (c *Conn) RemoteAddr() net.Addr
- func (c *Conn) SetDeadline(t time.Time) error
- func (c *Conn) SetReadDeadline(t time.Time) error
- func (c *Conn) SetWriteDeadline(t time.Time) error
- func (c *Conn) Write(b []byte) (int, error)
- type Relayer
- type RelayerConfig
- type SegmentProcessor
- type ServerConfig
- type ServerConnFetcher
- type SessionVerifier
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClientConfig ¶
type ClientConfig struct {
Topic []byte
ClientCertificate *signcryption.Certificate
ServerCertificate *signcryption.Certificate
RelayerCeriificate *signcryption.Certificate
}
ClientConfig contains configuration needed for a client connection.
type Conn ¶
Conn represents a connection (either a server or a client) on a signcrypted transport layer.
func NewConn ¶
func NewConn(c net.Conn, config *ClientConfig) *Conn
NewConn prepares a connection for use by a client.
func NewServerConn ¶
func NewServerConn(c net.Conn, config *ServerConfig) *Conn
NewServerConn prepares a connection for use by a server.
func (*Conn) Handshake ¶
Handshake performs the handshake procedure that's needed before using the connection.
func (*Conn) RemoteAddr ¶
RemoteAddr returns the address of the remote end of the connection.
func (*Conn) SetDeadline ¶
SetDeadline sets the read/write deadline on the connection.
func (*Conn) SetReadDeadline ¶
SetReadDeadline sets the read deadline on the connection.
func (*Conn) SetWriteDeadline ¶
SetWriteDeadline sets the write deadline on the connection.
type Relayer ¶
Relayer stands in between a client/server connection. A client connection connects directly to a relayer and is then matched with the appropriate server connection. A Relayer can provide NAT traversal, firewalling, and other services at this layer.
func NewRelayer ¶
func NewRelayer(client net.Conn, config *RelayerConfig) *Relayer
NewRelayer instantiates a new Relayer.
type RelayerConfig ¶
type RelayerConfig struct {
Verifier SessionVerifier
ConnFetcher ServerConnFetcher
RelayerCert *signcryption.Certificate
Signcrypter aai.AAI
Processor SegmentProcessor
}
RelayerConfig represents configuration for a Relayer.
type SegmentProcessor ¶
type SegmentProcessor interface {
ProcessSegment(sender, reciever *signcryption.Certificate,
segment []byte, totalBytes uint64)
}
SegmentProcessor processes a segment. This should be used for doing out of band things that depend on tracking the information in each segment.
type ServerConfig ¶
type ServerConfig struct {
ServerCertificate *signcryption.Certificate
SessionVerifier SessionVerifier
}
ServerConfig contains configuration needed for a server connection.
type ServerConnFetcher ¶
type ServerConnFetcher interface {
GetConn(topic []byte, serverCert *signcryption.Certificate) (net.Conn, error)
}
ServerConnFetcher can fetch a server connection based on the client topic and the server certificate.
type SessionVerifier ¶
type SessionVerifier interface {
VerifySession(topic []byte, clientCert, serverCert,
relayerCert *signcryption.Certificate) (bool, error)
}
SessionVerifier ensures that the STL session should exist for the given parties.