transport

package
v0.0.0-...-95eea6f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 6, 2026 License: UPL-1.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DEFAULT_HTTPS_PROXY_PORT = 80
	TCPCHA                   = 1<<1 | 1<<2 | 1<<3 | 1<<8 | 1<<9 | 1<<12
)

Variables

View Source
var (
	ErrConnectionIncomplete = errors.New("connection incomplete")
)

Functions

func ParsePKCS8EncryptedPrivateKey

func ParsePKCS8EncryptedPrivateKey(block *pem.Block, password []byte) (interface{}, error)

ParsePKCS8EncryptedPrivateKey decrypts a PKCS#8 "ENCRYPTED PRIVATE KEY" PEM block using the given password and returns the private key.

Supports PBES2 + PBKDF2 with AES-128-CBC, AES-192-CBC, AES-256-CBC, and 3DES-CBC.

The returned key is one of *rsa.PrivateKey or *ecdsa.PrivateKey depending on what was stored in the wallet.

Types

type Address

type Address struct {
	naming.Address
	Hostname       string
	HTTPSProxy     string
	HTTPSProxyPort int
}

type NTAdapter

type NTAdapter interface {
	Connect(ctx context.Context, address Address) error
	Send(ctx context.Context, buf []byte) error
	Receive(ctx context.Context, buf []byte, bytes2Read int) (int, error)
	Disconnect() error
}

type NTTCP

type NTTCP struct {
	Cha        int
	Connected  bool
	Secure     bool
	Host       string
	Hostname   string
	OriginHost string
	Port       uint16
	Stream     net.Conn
	Atts       NTattributes
	// contains filtered or unexported fields
}

NTTCP represents a TCP network transport adapter

func NewNTTCP

func NewNTTCP(atts NTattributes, port uint16) *NTTCP

func (*NTTCP) Connect

func (nt *NTTCP) Connect(ctx context.Context, address Address) error

Connect establishes a network transport connection

func (*NTTCP) Disconnect

func (nt *NTTCP) Disconnect() error

func (*NTTCP) NTConnect

func (nt *NTTCP) NTConnect(ctx context.Context, address Address) error

NTConnect establishes a TCP connection

func (*NTTCP) Receive

func (nt *NTTCP) Receive(ctx context.Context, buf []byte, bytes2Read int) (int, error)

Receive read bytes2Read byte form underlying stream parameters:

  • ctx : context to be used while reading
  • buf : the buffer to copy bytes to.
  • bytes2Read: number of byte sot be read

returns :

  • read bytes count
  • error raised during read operation

func (*NTTCP) Send

func (nt *NTTCP) Send(ctx context.Context, buf []byte) error

Send send buffer bytes to the underlying stream parameters:

  • ctx : context to be used while reading
  • buf : the buffer to be sent.

returns :

  • error raised during read operation

type NTTCPS

type NTTCPS struct {
	NTTCP
	// contains filtered or unexported fields
}

NTTCPS represents a TCPS network transport adapter

func NewNTTCPS

func NewNTTCPS(atts NTattributes) *NTTCPS

func (*NTTCPS) Clear

func (nt *NTTCPS) Clear()

Clear out sensitive data

func (*NTTCPS) Connect

func (nt *NTTCPS) Connect(ctx context.Context, address Address) error

Connect establishes a TLS connection

func (*NTTCPS) Disconnect

func (nt *NTTCPS) Disconnect() error

func (*NTTCPS) TLSReneg

func (nt *NTTCPS) TLSReneg()

Perform TLS Handshake to establish a TLS connection

func (*NTTCPS) VerifyPostAcceptDNMatch

func (nt *NTTCPS) VerifyPostAcceptDNMatch() error

type NTattributes

type NTattributes struct {
	TCPNODelay              bool
	SendTimeout             int
	RecvTimeout             int
	ExpireTime              int
	SSLServerDNMatch        bool
	SSLAllowWeakDNMatch     bool
	EnabledDCD              bool
	HttpsProxy              string
	HttpsProxyPort          int
	UseSNI                  bool
	Transportconnecttimeout int
	Connectionidprefix      string
	Connectionid            string
	WalletContent           []byte
	WalletPassword          string
	SSLServerCertDN         string
	Servicename             string
	WalletLocation          string
	UseSystemTrust          bool
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL